Make TestPackage work if the package is read-only#94
Conversation
We want to run the package tests in the following situations. - In CI tests for the package, the package manual has not been built. In order to run also the manual examples, we read the package's `makedoc.g`. This works because the `doc` and `tst`directories are writable. - When the package has been installed, its `doc` and `tst` directories are in general *not* writable. In this case, we expect that test files containing the manual examples are available, and we do not read `makedoc.g`. The files with manual examples have names `utils*.tst`, if `utils01.tst` does not exist, `testall.g` reports a test failure.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #94 +/- ##
=======================================
Coverage 85.21% 85.21%
=======================================
Files 32 32
Lines 1867 1867
=======================================
Hits 1591 1591
Misses 276 276 🚀 New features to boost your workflow:
|
|
@fingolfin Is this proposal an acceptable solution for the abovementioned problem in GAP.jl, (Also the GAP packages in the rsync distribution of GAP are read-only, thus the problem will occur also in GAP installations via rsync.) |
fingolfin
left a comment
There was a problem hiding this comment.
Seems good to me. @cdwensley ?
|
Of course I am happy to merge this, but I do not understand why these utils0*.tst files are being created. |
|
The file Those .tst files contain the examples given in your package manual. As a result, after running In order to ensue that when running the package tests (by calling @ThomasBreuer proposes a fix which I think would work. But just to say, this is the only package I am aware of doing this. All other packages using
Anyway, all three approaches seems fine to me. Personally I usually go with 1 because it is simplest. |
We want to run the package tests in the following situations.
In CI tests for the package, the package manual has not been built. In order to run also the manual examples, we read the package's
makedoc.g. This works because thedocandtstdirectories are writable.When the package has been installed, its
docandtstdirectories are in general not writable. In this case, we expect that test files containing the manual examples are available, and we do not readmakedoc.g. The files with manual examples have namesutils*.tst, ifutils01.tstdoes not exist,testall.greports a test failure.This is intended to resolve a problem discussed in oscar-system/GAP.jl/pull/1379.