Skip to content

test: for derivation output selection with .#10316

Merged
Ericson2314 merged 3 commits intoNixOS:masterfrom
dottharun:derivation-output-test
Apr 3, 2024
Merged

test: for derivation output selection with .#10316
Ericson2314 merged 3 commits intoNixOS:masterfrom
dottharun:derivation-output-test

Conversation

@dottharun
Copy link
Contributor

@dottharun dottharun commented Mar 25, 2024

Motivation

added test and fixes #7236

As discussed in #7236, after #6589 the command nix build nixpkgs#libxml2.dev correctly builds the dev output

  • and this pr adds test for this behavior

Also as pointed out by @Ericson2314 Here

image

Context

  • The test uses nix build command with --json and --no-link flags
  • which are then passed to jq with match, keys filters for checking the output names and derivations
  • outputSpecified attribute in Nixpkgs Here
  • meta.outputsToInstall attribute is used in the test because originally with nix: Respect meta.outputsToInstall, and use all outputs by default #6426 outputsToInstall is given more priority that command-line argument, thats why we are testing that behaviour too
  • this pr marks my first contribution to the nix code-base except documentation capturing all my learnings

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 the with-tests Issues related to testing. PRs with tests have some priority label Mar 25, 2024
@dottharun dottharun changed the title test: for derivation output selection with . issue #7236 test: for derivation output selection with . Mar 25, 2024
@dottharun dottharun marked this pull request as ready for review March 25, 2024 04:16
@dottharun dottharun requested a review from edolstra as a code owner March 25, 2024 04:16
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.

IIUC this is also reflected in the output symlinks.

@edolstra
Copy link
Member

flakes.sh is getting very big again, could you put this test in a separate file?

@Ericson2314
Copy link
Member

Yeah our existing functional tests are rather unsystematic, we need to start doing something about that so we have a better idea of test coverage.

@roberth
Copy link
Member

roberth commented Mar 27, 2024

flakes.sh is getting very big again, could you put this test in a separate file?

Figuring out a better categorization for test cases seems out of scope for this PR.

@Ericson2314
Copy link
Member

tests/functional/build.sh looks better even among existing files though

@dottharun
Copy link
Contributor Author

tests/functional/build.sh looks better even among existing files though

this is a flake only behavior though

  • Can I do it here tests/functional/flakes/build-paths.sh?

@Ericson2314 Ericson2314 merged commit 36d92dc into NixOS:master Apr 3, 2024
@Ericson2314
Copy link
Member

Thanks @dottharun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Create test for selecting derivation outputs in "installables" with .

4 participants