-
Notifications
You must be signed in to change notification settings - Fork 81
Validate hidden modules #1796
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
Validate hidden modules #1796
Conversation
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.
Thanks for looking into this!
You can find tests for haskell_module
here and tests for hidden modules here.
One possible way to test this would be to use failure testing.
hidden_minus_declared_modules = set.difference(set.from_list(ctx.attr.hidden_modules), set.from_list(declared_modules)) | ||
if not hidden_minus_declared_modules == set.empty(): | ||
fail("""Hidden modules must be a subset of all modules, found additional hidden modules {}""".format(set.to_list(hidden_minus_declared_modules))) |
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.
CI invokes |
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, that looks good!
Side note, you can push your branch to the tweag-org's rules_haskell repo to get CI to run on it.
some of these tests failures that don't seem to have anything to do with this work... Do you see anything related to this PR in the output? |
It's the formatting test that fails. You can reformat your code by invoking buildifier on it ( |
Yeah it seems like it doesn't always run automatically for external PRs, but when I pushed the branch of the same name to this repo, it triggered... weird |
Yes, that's unfortunately how it is at the moment. It's the same issue as described here: tweag/rules_nixpkgs#243. |
CI is failing pretty spectacularly on windows |
fixes #1687
I tested this by just manually tweaking test files and monitoring for errors, because I was unsure of how to write a test expecting a failure. If one is required, can you please point me to an example?