Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite still fails when OnlyNeeded option is active #32

Closed
fingolfin opened this issue Feb 21, 2024 · 2 comments · Fixed by #33
Closed

Test suite still fails when OnlyNeeded option is active #32

fingolfin opened this issue Feb 21, 2024 · 2 comments · Fixed by #33
Labels
bug Something isn't working

Comments

@fingolfin
Copy link
Member

I get this

gap> TestPackage("typeset" : OnlyNeeded);
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading typeset 1.2.1 (Automatic typesetting framework for common GAP objects, with LaTeX generation)
by Zachariah Newbery (https://zachnewbery.com).
Homepage: https://gap-packages.github.io/typeset/
Report issues at https://github.com/gap-packages/typeset/issues
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading datastructures 0.3.0 (datastructures - GAP Data Structures)
by Markus Pfeiffer (http://www.morphism.de/~markusp),
   Max Horn (https://www.quendi.de/math),
   Christopher Jefferson (http://caj.host.cs.st-andrews.ac.uk/), and
   Steve Linton (http://sl4.host.cs.st-andrews.ac.uk/).
Homepage: https://gap-packages.github.io/datastructures
Report issues at https://github.com/gap-packages/datastructures/issues
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading Digraphs 1.6.3 (Digraphs - Methods for digraphs)
by Jan De Beule (http://homepages.vub.ac.be/~jdbeule/),
   Julius Jonusas (http://julius.jonusas.work),
   James Mitchell (https://jdbm.me),
   Wilf A. Wilson (https://wilf.me), and
   Michael Young (https://mct25.host.cs.st-andrews.ac.uk).
with contributions by:
   Marina Anagnostopoulou-Merkouri ([email protected]),
   Finn Buck ([email protected]),
   Stuart Burrell (https://stuartburrell.github.io),
   Graham Campbell,
   Reinis Cirpons ([email protected]),
   Ashley Clayton ([email protected]),
   Tom Conti-Leslie (https://tomcontileslie.com),
   Joe Edwards (https://github.com/Joseph-Edwards),
   Luke Elliott ([email protected]),
   Isuru Fernando ([email protected]),
   Ewan Gilligan ([email protected]),
   Sebastian Gutsche ([email protected]),
   Samantha Harper ([email protected]),
   Max Horn (https://www.quendi.de/math),
   Christopher Jefferson (https://caj.host.cs.st-andrews.ac.uk),
   Olexandr Konovalov (https://olexandr-konovalov.github.io/),
   Andrea Lee ([email protected]),
   Markus Pfeiffer (https://www.morphism.de/~markusp/),
   Lea Racine ([email protected]),
   Christopher Russell,
   Artur Schaefer ([email protected]),
   Isabella Scott ([email protected]),
   Kamran Sharma ([email protected]),
   Finn Smith ([email protected]),
   Ben Spiers ([email protected]),
   Maria Tsalakou (https://mariatsalakou.github.io/), and
   Murray Whyte ([email protected]).
maintained by:
   James Mitchell (https://jdbm.me) and
   Wilf A. Wilson (https://wilf.me).
Homepage: https://digraphs.github.io/Digraphs
Report issues at https://github.com/digraphs/Digraphs/issues
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Architecture: aarch64-apple-darwin21-default64-kv9

testing: /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/core.tst
      29 ms (28 ms GC) and 616KB allocated for latex/core.tst
testing: /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/ctbls.tst
      58 ms (27 ms GC) and 16.2MB allocated for latex/ctbls.tst
testing: /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/digraphs.tst
########> Diff in /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/digraphs.tst:6
# Input is:
Typeset(g);
# Expected output:
\begin{center}
\begin{tikzpicture}[>=latex',line join=bevel,]
\begin{dot2tex}[dot,tikz,codeonly,styleonly]
digraph hgn{
node [shape=circle]
1
2
1 -> 1
1 -> 2
2 -> 2
2 -> 1
}
\end{dot2tex}
\end{tikzpicture}
\end{center}
# But found:
<immutable digraph with 2 vertices, 4 edges>
########
########> Diff in /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/digraphs.tst:23
# Input is:
Typeset(g2);
# Expected output:
\begin{center}
\begin{tikzpicture}[>=latex',line join=bevel,]
\begin{dot2tex}[dot,tikz,codeonly,styleonly]
digraph hgn{
node [shape=circle]
1
2
3
4
5
1 -> 1
1 -> 2
2 -> 2
2 -> 3
3 -> 3
3 -> 4
4 -> 4
4 -> 2
5 -> 4
5 -> 1
}
\end{dot2tex}
\end{tikzpicture}
\end{center}
# But found:
<immutable digraph with 5 vertices, 10 edges>
########
########> Diff in /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/digraphs.tst:56
# Input is:
PositionSublist(s, "\\node")<>fail;
# Expected output:
true
# But found:
false
########
      31 ms (31 ms GC) and 104KB allocated for latex/digraphs.tst
testing: /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/generators.tst
      33 ms (26 ms GC) and 2.04MB allocated for latex/generators.tst
testing: /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/polynomials.tst
      30 ms (28 ms GC) and 555KB allocated for latex/polynomials.tst
testing: /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/latex/structdesc.tst
      27 ms (27 ms GC) and 84.3KB allocated for latex/structdesc.tst
testing: /Users/mhorn/Projekte/GAP/repos/pkg/gap-packages/typeset/tst/mathml/core.tst
      25 ms (24 ms GC) and 215KB allocated for mathml/core.tst
-----------------------------------
total       233 ms (191 ms GC) and 19.8MB allocated
              3 failures in 1 of 7 files

#I  Errors detected while testing

So something is fishy. In particular Typeset(g) does not print TeX code but instead... returns (or prints?!?) an immutable digraph?

@fingolfin fingolfin added the bug Something isn't working label Feb 21, 2024
@ZachNewbery
Copy link
Collaborator

@fingolfin Identical error log to here - was typeset loaded prior to the TestPackage call? Either that or it may be an issue with dot2tex not being on the machine, but not sure how this can be checked for in a test...

@fingolfin
Copy link
Member Author

Well TestPackage does two things:

  1. it loads the package
  2. it reads its test file.

So yeah, this is the intentional behavior. Your tst/testall.g is free to load packages that are needed for tests. But it can't retroactively load code you skipped loading earlier.

A possible fix would be to just not run the digraphs specific tests if digraphs is not used. You can use the exclude option to skip specific .tst files. Here is a snippet from the testall.g file of the orb package; it could easily be adapted:

d := DirectoriesPackageLibrary("orb", "tst");
exclude:=[];
if not CompareVersionNumbers(GAPInfo.Version, "4.12") then
  Append(exclude, [
    "m11PF3d24/M11OrbitOnPF3d24.tst",
    "m22p770.tst",
  ]);
fi;

TestDirectory(d[1], rec(exitGAP := true, exclude:=exclude));

Option 2 is to just turn digraphs into an actual dependency.

Option 3: use the new Extensions feature introduced in GAP 4.13.0 to retroactively load the digraphs integration in your package when digraphs is loaded (however that would only work in GAP 4.13.0, so perhaps first consider one of the other two options?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants