-
Notifications
You must be signed in to change notification settings - Fork 375
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 Refactor #3066
Merged
Merged
Test Refactor #3066
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
madman-bob
force-pushed
the
test-refactor
branch
from
September 1, 2023 11:01
d7181f3
to
177e408
Compare
Cf. discussion in #1736 Edit: I guess now that |
madman-bob
force-pushed
the
test-refactor
branch
2 times, most recently
from
September 1, 2023 13:50
feeefb6
to
f697ddd
Compare
gallais
added
the
event: IDM 2023/08
Issue tackled during the August 2023 Idris Developers Meeting
label
Sep 1, 2023
madman-bob
force-pushed
the
test-refactor
branch
2 times, most recently
from
September 4, 2023 13:38
9981b1e
to
01731da
Compare
madman-bob
force-pushed
the
test-refactor
branch
2 times, most recently
from
September 5, 2023 09:46
a21036a
to
ebfecd2
Compare
This simplifies most calls to `testsInDir`.
madman-bob
force-pushed
the
test-refactor
branch
from
September 5, 2023 10:55
ebfecd2
to
7c8b411
Compare
buzden
added a commit
to buzden/Idris2
that referenced
this pull request
Oct 3, 2023
buzden
added a commit
to buzden/Idris2
that referenced
this pull request
Oct 3, 2023
buzden
added a commit
to buzden/Idris2
that referenced
this pull request
Oct 3, 2023
buzden
added a commit
to buzden/Idris2
that referenced
this pull request
Oct 3, 2023
gallais
pushed a commit
that referenced
this pull request
Oct 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
admin: continuous-integration
code: refactoring
event: IDM 2023/08
Issue tackled during the August 2023 Idris Developers Meeting
library: test
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A refactor of Idris's tests. I've used this approach in my own projects.
Test Utilities
I've created a utility script
testutils.sh
, which can be imported to provide testing utilities to tests. This helps with consistency, and readability. I've extracted a couple of common patterns here.For example, instead of
$1 --no-banner --console-width 0 --no-color ...
, we can just writeidris2 ...
.Test Directories
Instead of naming the tests explicitly in
Main.idr
, I've usedtestsInDir
as much as possible. This did require me creating an additional directory layer in theidris2
tests. This should prevent tests being added, without being run.Indeed, the following tests weren't acutally being run:
allbackends/evaluator005
chez/barrier001
chez/forkjoin001
node/node014
idris2/builtin012
idris2/linear004
racket/forkjoin001
racket/conditions006
racket/conditions007
For each of these tests, if it was easy to get the test running, I did so. I've deleted
linear004
, as it requires linearity subtyping. I'm considering also deletingevaluator005
, unless we can decide howDouble
s should behave.Backwards Compatibility
This change will cause merge conflicts with some outstanding PRs. If a PR adds a new test, it will likely cause a conflict in the testing
Main.idr
. We can throw away their change here, as thetestsInDir
will pick up the test instead.If the test is added to the
idris2
folder, it should be moved to the appropriate subdirectory.It is not required to use
testutils
in any new test, but I reommend importing it if just for the readability improvement over$1 ...
. Usages of$1
should probably be replaced with one ofidris2
,$idris2
,check
, orrun
.