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

introducing: per-module checks #309

Draft
wants to merge 1 commit into
base: v2-main
Choose a base branch
from
Draft

Conversation

cdmistman
Copy link
Contributor

@cdmistman cdmistman commented Apr 10, 2024

Why

we want the testing story to be a lot better for v2 than it was for v1

this testing system allows us to write completely hermetic checks inline with the rest of the module declarations, while also allowing us to test various combinations of modules

the system is very bare-bones but i expect it to grow as we define needs

What changed

  • added new check function as an output to v2/default.nix
  • added new checks option

Test plan

for now, can be tested like so:

$ nix repl
> :lf github:replit/nixmodules/cad/module-checks
> :b packages.x86_64-linux.v2.check { interpreters.nodejs.enable = true; }
  out -> /nix/store/abc123-modules-checks
$ /nix/store/abc123-modules-checks
image

note that passing in 0 enabled modules will result in an empty checks file

Rollout

Describe any procedures or requirements needed to roll this out safely (or check the box below)

  • This is fully backward and forward compatible

@cdmistman cdmistman requested a review from a team as a code owner April 10, 2024 21:41
@cdmistman cdmistman requested review from ryantm and airportyh and removed request for a team April 10, 2024 21:41
Comment on lines +40 to +44
output=$(${nodejs-wrapped}/bin/node --version)
if [ "$output" != "v${nodejs-wrapped.version}" ]; then
echo "Node.js version mismatch: expected v${nodejs-wrapped.version}, got $output"
exit 1
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test could've caught a bug in a previous release of v1!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will be very important when we enforce version pinning. Do not want to accidentally upgrade the version by upgrading a Nix channel.

Copy link
Collaborator

@airportyh airportyh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you setup a way to run all module checks as a command that can be used in ci?

@cdmistman cdmistman marked this pull request as draft April 17, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants