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

tests.trivial-builders.references: provide passthru attributes and override interface on non-Linux platforms #273183

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Dec 9, 2023

Description of changes

NixOS VM Tests are not supported outside Linux so far, and we leave tests.trivial-builders.references = { } for non-Linux systems to please the CI.

If applied, non-Linux users will be able to run testScriptBin and access passthru attributes and override interface of test.trivial-builders.references the way Linux users do.

Status: waiting for #178717. It brings several renames and one extra test cases that depends on samples.

Cc: @roberth

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ShamrockLee ShamrockLee changed the title tests.trivial-builders.references: drop irrelevant "shellcheck disable" directive tests.trivial-builders.references: make buildScriptBin available on non-Linux systems and drop irrelevant "shellcheck disable" directive Dec 11, 2023
@ShamrockLee ShamrockLee changed the title tests.trivial-builders.references: make buildScriptBin available on non-Linux systems and drop irrelevant "shellcheck disable" directive tests.trivial-builders.references: pass buildScriptBin on non-Linux and drop irrelevant shellcheck directive Dec 11, 2023
@ShamrockLee ShamrockLee force-pushed the test-references-shellcheck-fix branch from 1c4c1d4 to b546bb0 Compare March 18, 2024 21:02
@ShamrockLee ShamrockLee changed the title tests.trivial-builders.references: pass buildScriptBin on non-Linux and drop irrelevant shellcheck directive tests.trivial-builders.references: provide passthru attributes and override interface on non-Linux platforms Mar 18, 2024
Forward override interface and essential passthru attributes of
`tests.trivial-builders.references` to non-Linux platforms.

Enable `pkgs`-wide `samples` overriding via the override interface
of `tests.trivial-builders.references` in Nixpkgs overlays.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather suggest to keep static attribute names, but set meta.platforms so that the attributes aren't evaluated outside linux

Copy link
Contributor Author

@ShamrockLee ShamrockLee Mar 25, 2024

Choose a reason for hiding this comment

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

Unfortunately, the NixOS test modules do not provide an option to specify/expose meta.platforms, nor does the result derivation come with overrideAttrs.

Copy link
Contributor

@SomeoneSerge SomeoneSerge Mar 26, 2024

Choose a reason for hiding this comment

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

Interesting

nix-repl> :lf github:ShamrockLee/nixpkgs/test-references-shellcheck-fix
nix-repl> legacyPackages.x86_64-linux.tests.trivial-builders.references.meta                      
{ broken = false; maintainers = [ ... ]; timeout = 3600; }
nix-repl> legacyPackages.x86_64-linux.tests.trivial-builders.references.override<TAB>
legacyPackages.x86_64-linux.tests.trivial-builders.references.override
legacyPackages.x86_64-linux.tests.trivial-builders.references.overrideDerivation

Copy link
Member

Choose a reason for hiding this comment

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

Are you sure you need meta.platforms? If so, it can be added in nixos/lib/testing/meta.nix, or we could give that a freeformType.

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

Successfully merging this pull request may close these issues.

4 participants