Skip to content

nixosTests: handleTest -> runTest, batch 1#410569

Merged
roberth merged 1 commit intoNixOS:masterfrom
Prince213:handleTest-runTest
May 27, 2025
Merged

nixosTests: handleTest -> runTest, batch 1#410569
roberth merged 1 commit intoNixOS:masterfrom
Prince213:handleTest-runTest

Conversation

@Prince213
Copy link
Copy Markdown
Member

@Prince213 Prince213 commented May 24, 2025

Partially resolves: #386873

These changes are automated by a sed script, and the changed files are formatted to ensure good style and to make sure it doesn't cause syntax error.

Remaining uses of handleTest are around 220.

I'm willing to work for the remaining uses after this gets merged.

To replicate the changes on local machine:

rg -e '= handleTest \./(.+?\.nix) \{ \};' -o -r '$1' all-tests.nix > files.lst
for file in $(cat files.lst); do
  sed -i -e '/^import \.\.\?\/make-test-python.nix ($/d' -e '$s/^)$//' $file
  nixfmt $file
done
rm files.lst
sed -i 's|handleTest \(\./.\+\?\.nix\) { };|runTest \1;|' all-tests.nix

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (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.

@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label May 24, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels May 24, 2025
@Prince213 Prince213 force-pushed the handleTest-runTest branch from 0d9b62c to bc8329e Compare May 24, 2025 16:34
@github-actions github-actions bot added 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: qt/kde Object-oriented framework for GUI creation 6.topic: pantheon The Pantheon desktop environment 6.topic: testing Tooling for automated testing of packages and modules 6.topic: cinnamon Desktop environment 6.topic: mate The MATE Desktop Environment labels May 24, 2025
@Prince213 Prince213 changed the title nixosTests: handleTest -> runTest nixosTests: handleTest -> runTest, batch 1 May 24, 2025
@Prince213 Prince213 added 8.has: clean-up This PR removes packages or removes other cruft 11.by: nixpkgs-member and removed 2.status: work-in-progress labels May 24, 2025
@Prince213 Prince213 marked this pull request as ready for review May 24, 2025 16:42
@nix-owners nix-owners bot requested a review from joachifm May 24, 2025 16:44
@Prince213 Prince213 force-pushed the handleTest-runTest branch 2 times, most recently from 65bc844 to 40688bc Compare May 26, 2025 03:31
Copy link
Copy Markdown
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.

all-tests.nix has reordered a few attributes.
I assume that's because of rebasing, so let's fix that afterwards.

@roberth
Copy link
Copy Markdown
Member

roberth commented May 26, 2025

Oh, it has conflicts right now. Could you fix the reordered attributes?

@Prince213
Copy link
Copy Markdown
Member Author

Sure.

@Prince213 Prince213 force-pushed the handleTest-runTest branch from 40688bc to f34483b Compare May 26, 2025 12:40
@Prince213 Prince213 added the 12.approvals: 1 This PR was reviewed and approved by one person. label May 26, 2025
@Prince213
Copy link
Copy Markdown
Member Author

Rebased the commit against master and fixed a few previously out-of-order attributes.

@jian-lin
Copy link
Copy Markdown
Contributor

FYI, a new CI check keep-sorted was introduced recently. We can use it for all-tests.nix.

@jian-lin jian-lin requested a review from roberth May 26, 2025 13:30
@roberth roberth merged commit d5226c8 into NixOS:master May 27, 2025
17 of 18 checks passed
@roberth
Copy link
Copy Markdown
Member

roberth commented May 27, 2025

Thank you!

@mweinelt
Copy link
Copy Markdown
Member

I'll make a guess and say this change broke at least the eval of unstable-small.

{UNKNOWN}: aggregate job ‘tested’ failed with the error: nixos.tests.latestKernel.login.x86_64-linux: does not exist
nixos.tests.latestKernel.login.aarch64-linux: does not exist
nixos.tests.login.x86_64-linux: error:
       … while calling the 'head' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/attrsets.nix:1534:13:
         1533|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1534|             head values
             |             ^
         1535|           else

       … while calling the 'head' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/attrsets.nix:1534:13:
         1533|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1534|             head values
             |             ^
         1535|           else

       … while calling the 'deepSeq' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/customisation.nix:479:35:
          478|     in
          479|     if drv == null then null else deepSeq drv' drv';
             |                                   ^
          480|

       … while evaluating the option `nodes.machine.system.build.toplevel':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating the option `nodes.machine.assertions':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/modules/system/boot/kernel.nix':

       … while evaluating the option `nodes.machine.boot.kernelPackages':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/login.nix':

       … while evaluating the module argument `latestKernel' in "/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/login.nix":

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'latestKernel' missing
       at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/modules.nix:652:66:
          651|       extraArgs = mapAttrs (
          652|         name: _: addErrorContext (context name) (args.${name} or config._module.args.${name})
             |                                                                  ^
          653|       ) (functionArgs f);
nixos.tests.login.aarch64-linux: error:
       … while calling the 'head' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/attrsets.nix:1534:13:
         1533|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1534|             head values
             |             ^
         1535|           else

       … while calling the 'deepSeq' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/customisation.nix:479:35:
          478|     in
          479|     if drv == null then null else deepSeq drv' drv';
             |                                   ^
          480|

       … while evaluating the option `nodes.machine.system.build.toplevel':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/modules/system/activation/top-level.nix':

       … while evaluating the option `nodes.machine.assertions':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/modules/system/boot/kernel.nix':

       … while evaluating the option `nodes.machine.boot.kernelPackages':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/login.nix':

       … while evaluating the module argument `latestKernel' in "/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/login.nix":

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'latestKernel' missing
       at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/modules.nix:652:66:
          651|       extraArgs = mapAttrs (
          652|         name: _: addErrorContext (context name) (args.${name} or config._module.args.${name})
             |                                                                  ^
          653|       ) (functionArgs f);
nixos.tests.containers-imperative.x86_64-linux: error:
       … while calling the 'head' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/attrsets.nix:1534:13:
         1533|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1534|             head values
             |             ^
         1535|           else

       … while calling the 'head' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/attrsets.nix:1534:13:
         1533|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1534|             head values
             |             ^
         1535|           else

       … while calling the 'deepSeq' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/customisation.nix:479:35:
          478|     in
          479|     if drv == null then null else deepSeq drv' drv';
             |                                   ^
          480|

       … while evaluating the option `nodes.machine.virtualisation.qemu.options':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/modules/virtualisation/qemu-vm.nix':

       … while evaluating the option `nodes.machine.virtualisation.additionalPaths':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/containers-imperative.nix':

       … while evaluating the module argument `pkgs' in "/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/modules/services/hardware/bluetooth.nix":

       … while evaluating the option `nixpkgs.localSystem':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/containers-imperative.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'localSystem' missing
       at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/containers-imperative.nix:35:52:
           34|             modules = lib.singleton {
           35|               nixpkgs = { inherit (config.nixpkgs) localSystem; };
             |                                                    ^
           36|
nixos.tests.containers-imperative.aarch64-linux: error:
       … while calling the 'head' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/attrsets.nix:1534:13:
         1533|           if length values == 1 || pred here (elemAt values 1) (head values) then
         1534|             head values
             |             ^
         1535|           else

       … while calling the 'deepSeq' builtin
         at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/lib/customisation.nix:479:35:
          478|     in
          479|     if drv == null then null else deepSeq drv' drv';
             |                                   ^
          480|

       … while evaluating the option `nodes.machine.virtualisation.qemu.options':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/modules/virtualisation/qemu-vm.nix':

       … while evaluating the option `nodes.machine.virtualisation.additionalPaths':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/containers-imperative.nix':

       … while evaluating the module argument `pkgs' in "/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/modules/services/hardware/bluetooth.nix":

       … while evaluating the option `nixpkgs.localSystem':

       … while evaluating definitions from `/nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/containers-imperative.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: attribute 'localSystem' missing
       at /nix/store/fbg634nk478h8hjgfrzfa8q3sy8rk5wl-source/nixos/tests/containers-imperative.nix:35:52:
           34|             modules = lib.singleton {
           35|               nixpkgs = { inherit (config.nixpkgs) localSystem; };
             |                                                    ^
           36|
 at /nix/store/alr2c0g777fq0gxshg6zmrqgbphii8da-hydra-perl-deps/lib/perl5/site_perl/5.40.0/Catalyst/Model/DBIC/Schema.pm line 526

@mweinelt
Copy link
Copy Markdown
Member

mweinelt commented May 27, 2025

We lost the following jobs on nixos-unstable. https://hydra.nixos.org/eval/1815634#tabs-removed

nixos.tests.breitbandmessung.x86_64-linux x86_64-linux
nixos.tests.brscan5.x86_64-linux x86_64-linux
nixos.tests.consul.aarch64-linux aarch64-linux
nixos.tests.consul.x86_64-linux x86_64-linux
nixos.tests.deconz.x86_64-linux x86_64-linux
nixos.tests.discourse.aarch64-linux aarch64-linux
nixos.tests.discourse.x86_64-linux x86_64-linux
nixos.tests.fanout.aarch64-linux aarch64-linux
nixos.tests.fanout.x86_64-linux x86_64-linux
nixos.tests.gnome-extensions.aarch64-linux aarch64-linux
nixos.tests.gnome-extensions.x86_64-linux x86_64-linux
nixos.tests.initrd-luks-empty-passphrase.aarch64-linux aarch64-linux
nixos.tests.initrd-luks-empty-passphrase.x86_64-linux x86_64-linux
nixos.tests.minecraft-server.aarch64-linux aarch64-linux
nixos.tests.minecraft-server.x86_64-linux x86_64-linux
nixos.tests.netbox-upgrade.aarch64-linux aarch64-linux
nixos.tests.netbox-upgrade.x86_64-linux x86_64-linux
nixos.tests.odoo.aarch64-linux aarch64-linux
nixos.tests.odoo.x86_64-linux x86_64-linux
nixos.tests.odoo16.aarch64-linux aarch64-linux
nixos.tests.odoo16.x86_64-linux x86_64-linux
nixos.tests.odoo17.aarch64-linux aarch64-linux
nixos.tests.odoo17.x86_64-linux x86_64-linux
nixos.tests.openldap.aarch64-linux aarch64-linux
nixos.tests.openldap.x86_64-linux x86_64-linux
nixos.tests.outline.aarch64-linux aarch64-linux
nixos.tests.outline.x86_64-linux x86_64-linux
nixos.tests.quake3.aarch64-linux aarch64-linux
nixos.tests.quake3.x86_64-linux x86_64-linux
nixos.tests.sabnzbd.aarch64-linux aarch64-linux
nixos.tests.sabnzbd.x86_64-linux x86_64-linux
nixos.tests.squid.aarch64-linux aarch64-linux
nixos.tests.squid.x86_64-linux x86_64-linux
nixos.tests.systemd-analyze.aarch64-linux aarch64-linux
nixos.tests.systemd-analyze.x86_64-linux x86_64-linux
nixos.tests.systemd-initrd-luks-empty-passphrase.aarch64-linux aarch64-linux
nixos.tests.systemd-initrd-luks-empty-passphrase.x86_64-linux x86_64-linux
nixos.tests.systemd-initrd-shutdown.aarch64-linux aarch64-linux
nixos.tests.systemd-initrd-shutdown.x86_64-linux x86_64-linux
nixos.tests.systemd-shutdown.aarch64-linux aarch64-linux
nixos.tests.systemd-shutdown.x86_64-linux x86_64-linux
nixos.tests.without-nix.aarch64-linux aarch64-linux
nixos.tests.without-nix.x86_64-linux x86_64-linux

@Prince213
Copy link
Copy Markdown
Member Author

Okay I'm working on a fix.

@Prince213 Prince213 mentioned this pull request May 28, 2025
13 tasks
@SuperSandro2000
Copy link
Copy Markdown
Member

I just wanted to note that I am currently rebasing a PR for paperless against this PR and it is a bit more tricky than I would like it to be 😓

@roberth
Copy link
Copy Markdown
Member

roberth commented May 28, 2025

Due to the indentation change? Maybe mergiraf could be of help.

@Prince213
Copy link
Copy Markdown
Member Author

I suppose it's #385637? This PR only changes the first and the last line, and other lines only have indent changes. So you should be able to just apply your changes first, then remove the two lines, then format.

@SuperSandro2000
Copy link
Copy Markdown
Member

mergiraf

That supports nix 🤔 I need to look into that. Thanks for the tip!

I suppose it's #385637?

yep

This PR only changes the first and the last line, and other lines only have indent changes. So you should be able to just apply your changes first, then remove the two lines, then format.

That's what I ended up doing 😅 shame that git couldn't resolve it on its own

@trofi
Copy link
Copy Markdown
Contributor

trofi commented May 30, 2025

Bisect claims f34483b nixosTests: handleTest -> runTest, batch 1 broke the eval of discourse.discourseAllPlugins.tests. Attempted at fixing it as:

@Prince213 Prince213 deleted the handleTest-runTest branch June 27, 2025 04:55
Jayman2000 added a commit to Jayman2000/nixpkgs-pr that referenced this pull request Dec 20, 2025
This is a partial backport of f34483b
from NixOS#410569 to the release-25.05 branch. Specifically, this is a
backport of only the Syncthing-related changes from that commit.

The main motivation behind this change is to make it easier to backport
some other commits that depend on changes from f34483b.
I’m backporting those other commits so that I can prevent
syncthing.tests.syncthing-many-devices from failing to build after
Syncthing is updated to version 1.29.7.

Co-authored-by: Jason Yundt <jason@jasonyundt.email>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cinnamon Desktop environment 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: mate The MATE Desktop Environment 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: pantheon The Pantheon desktop environment 6.topic: qt/kde Object-oriented framework for GUI creation 6.topic: testing Tooling for automated testing of packages and modules 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking: migrate NixOS handleTest -> runTest

6 participants