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

Meson functional tests #11073

Open
wants to merge 31 commits into
base: master
Choose a base branch
from

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jul 9, 2024

Motivation

Run the functional test suite with Meson

Context

#2503

Depends on #11176
Depends on #11177
Depends on #11178
Depends on #11179

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority labels Jul 9, 2024
@fricklerhandwerk
Copy link
Contributor

Triaged in Nix team meeting:

  • @roberth tried to work around some failures and also had design questions
    • it should probably follow the convention we already have for the unit tests, even if we're not building much
    • @Ericson2314: instead of copying the sources to the build directory we could actually "install" them
  • @roberth: this also needs to work in the VM test
    • can definitely be done
    • would be fantastic if we could just package the tests, but maybe it's just not how it works
    • @Ericson2314: we could absolutely do both, but there's still a lot of reworking to get the functional tests how we want them

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2024-07-10-nix-team-meeting-minutes-160/49101/1

@Ericson2314
Copy link
Member Author

Ericson2314 commented Jul 18, 2024

@GoldsteinE might you be interested in helping out with this? I think I just (hackily) fixed the CI eval issue so the actual interesting failures will show up.

The differences between the Meson and Make bash environments for the functional tests is...very subtle! :( It makes debugging these failures hard.

Comment on lines -16 to -21
(! nix-instantiate --restrict-eval --eval -E 'builtins.readDir ../../src/nix-channel')
nix-instantiate --restrict-eval --eval -E 'builtins.readDir ../../src/nix-channel' -I src=../../src

Copy link
Member Author

Choose a reason for hiding this comment

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

Fishing out some non-test-suite files like this is no good with the broken-up build. If we want to test .. we should do it a different way (e.g. make some dirs in $TEST_ROOT and cd inside there).

@GoldsteinE
Copy link
Contributor

I’ll take a look, but I don’t really know Meson.

Unrelated, but I think one of the end goals here should be rewriting functional tests to something that is not bash. Writing logic in bash is extremely error-prone and I think replacing it with e.g. Python would make all of this logic much less brittle.

@Ericson2314
Copy link
Member Author

@GoldsteinE Thank you!!

Unrelated, but I think one of the end goals here should be rewriting functional tests to something that is not bash.

I agree! I wrote up #10823 for this.

@github-actions github-actions bot added store Issues and pull requests concerning the Nix store repl The Read Eval Print Loop, "nix repl" command and debugger labels Jul 24, 2024
@github-actions github-actions bot added fetching Networking with the outside (non-Nix) world c api Nix as a C library with a stable interface labels Jul 25, 2024
- They should all be built in parallel

- They should all use strict deps by default
This is a nice thing to have, and it made it easier to work on the
Meson-ifcation of these functional tests too.
The symlinked `nix-profile.sh.in` was getting rewritten per the `%.in ->
%` rule, which was clobbering the test also named `nix-profile.sh`.
@Ericson2314 Ericson2314 marked this pull request as ready for review July 25, 2024 04:04
@Ericson2314 Ericson2314 mentioned this pull request Jul 25, 2024
@Ericson2314
Copy link
Member Author

The PRs that this depends on should be reviewed separately, but then it's good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api Nix as a C library with a stable interface fetching Networking with the outside (non-Nix) world new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger store Issues and pull requests concerning the Nix store with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants