Skip to content

Comments

Meson functional tests#11073

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:meson-functional-tests
Aug 14, 2024
Merged

Meson functional tests#11073
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:meson-functional-tests

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jul 9, 2024

@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 fetching Networking with the outside (non-Nix) world, input locking c api Nix as a C library with a stable interface labels Jul 24, 2024
@Ericson2314 Ericson2314 marked this pull request as ready for review July 25, 2024 04:04
@Ericson2314 Ericson2314 requested a review from edolstra as a code owner 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!

@Ericson2314 Ericson2314 force-pushed the meson-functional-tests branch 2 times, most recently from a66a708 to 4c485d0 Compare August 12, 2024 16:30
@dpulls
Copy link

dpulls bot commented Aug 12, 2024

🎉 All dependencies have been resolved !

@Ericson2314
Copy link
Member Author

It seems that the macOS failure is due to libcurl is failing to initialize:

2024-08-13T14:04:56.2756290Z nix-functional-tests> building '/private/tmp/nix-build-nix-functional-tests-2.25.0pre20240813_1df9fb0.drv-0/nix-test/check/store/98i8amk2i6hj4h9w9fk6hcnmbkcspa3y-eval-okay-xml.exp.xml.drv'...
2024-08-13T14:04:56.2757530Z nix-functional-tests> objc[25124]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
2024-08-13T14:04:56.2759080Z nix-functional-tests> objc[25124]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
2024-08-13T14:04:56.2761140Z nix-functional-tests> error: builder for '/private/tmp/nix-build-nix-functional-tests-2.25.0pre20240813_1df9fb0.drv-0/nix-test/check/store/98i8amk2i6hj4h9w9fk6hcnmbkcspa3y-eval-okay-xml.exp.xml.drv' failed due to signal 6 (Abort trap: 6)

from the last run. Restarting to see if at least Linux will finish now.

Unfortunately, I could not reproduce these failures in a macOS dev shell: those tests just passed normally.

@roberth
Copy link
Member

roberth commented Aug 13, 2024

That is a known issue. You can apply #10164 to work around it.

@Ericson2314 Ericson2314 force-pushed the meson-functional-tests branch from a149c79 to 35c5127 Compare August 13, 2024 18:04
@Ericson2314
Copy link
Member Author

@roberth Look good now?

Copy link
Member

@roberth roberth left a comment

Choose a reason for hiding this comment

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

NixOS VM test is yet to be ported, but looking good so far.
2 suggestions.

Co-Authored-By: Qyriad <[email protected]>
Co-authored-by: Robert Hensing <[email protected]>
@Ericson2314 Ericson2314 force-pushed the meson-functional-tests branch from 88dd900 to 34fe247 Compare August 14, 2024 19:35
@Ericson2314 Ericson2314 enabled auto-merge August 14, 2024 19:35
@Ericson2314 Ericson2314 merged commit b8a09bd into NixOS:master Aug 14, 2024
@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-08-14-nix-team-meeting-minutes-169/50633/1

@Ericson2314 Ericson2314 deleted the meson-functional-tests branch October 11, 2024 16:40
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 documentation fetching Networking with the outside (non-Nix) world, input locking 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.

5 participants