-
Notifications
You must be signed in to change notification settings - Fork 81
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
Move tests to rules_haskell_test
module
#1903
Conversation
57041bd
to
006e47c
Compare
58bf806
to
2f3635b
Compare
2f3635b
to
fe7a6dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, LGTM!
Could you please adjust the README to include a few words on how to run tests now?
BTW, for rules_sh we added the test module (as a local repository) to the root WORKSPACE too, so you could run all tests with bazel test //... @rules_sh_tests//...
. Maybe this could be done here too, making it a bit easier to run the tests? What do you think?
I would not spend much effort in that direction. WORKSPACE are not loaded transitively, so testing |
To prepare for bzlmod support, this PR moves most tests from rules_haskell to a dedicated module called
rules_haskell_tests
.Testing
rules_haskell
from another module is more realistic (which is particularly important with bzlmod since different modules have different visibility and repository mappings). In addition, once bzlmod is activated, therules_haskell_test
module will be able to depend on therules_haskell_nix
module which will be used to register the the nix toolchains (to avoid a dependency betweenrules_haskell
andrules_nixpkgs
).Some comments
Some targets are still present in rules_haskell's test folder for tests that do not test the public api but are internal to the module such as the
shellcheck
ones or//tests/package_configuration:package_configuration_test
.Dependencies from the WORKSPACE and the
non_module_deps_*
files are split between the two modules. And the dependencies fromnon_module_dev_dep_*
files will be development dependencies with bzlmod.About the CI
The CI was updated so that tests for
rules_haskell
andrules_haskell_tests
happen in parallel. So there are more jobs but the tests for therules_haskell
module should be quick since most tests are now inrules_haskell_tests
.The config was also updated so that
rules_haskell
andrules_haskell_test
use separate caches on windows. This works aroundundeclared inclusions
issues such as this one.This can happen because the
*.d
files (that keep track of C dependencies for hermeticity purposes) such as the one file from this cache hit contain absolute paths that are not the same for both module and should not be shared.The mergify configuration was updated but I think this is not effective until the PR is merged, so it will have to be merged manually.