From 2beea85aedd48baa7596d8254d4452033acc96af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Mon, 2 Jan 2023 02:26:46 +0100 Subject: [PATCH] use `nixosTests` for tests The current approach runs e.g. `nix-build nixos/release.nix -A tests.installer`, which is a no-op because `tests.installer` is a set of sets of derivations (e.g. `tests.installer.simple.x86_64-linux`). Use `nixosTests` instead, which doesn't have this extra nesting. --- README.md | 4 ++-- ofborg/src/commentparser.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bb50a45..b3c35ba 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ instructions for ofborg. @ofborg test list of tests ``` -This will run `nix-build ./nixos/release.nix -A tests.list -A tests.of -A -tests.tests` from the root of the Nixpkgs checkout. +This will run `nix-build ./default.nix -A nixosTests.list -A nixosTests.of -A +nixosTests.tests` from the root of the Nixpkgs checkout. Tests will run on all allowed machines. For more information, see the "[Trusted Users](#trusted-users)" section. diff --git a/ofborg/src/commentparser.rs b/ofborg/src/commentparser.rs index 4f925b3..e5d3a39 100644 --- a/ofborg/src/commentparser.rs +++ b/ofborg/src/commentparser.rs @@ -38,8 +38,8 @@ named!( )) | ws!(do_parse!( tag!("test") >> - tests: ws!(many1!(map!(normal_token, |s| format!("tests.{}", s.0)))) >> - (Some(Instruction::Build(Subset::NixOS, tests))) + tests: ws!(many1!(map!(normal_token, |s| format!("nixosTests.{}", s.0)))) >> + (Some(Instruction::Build(Subset::Nixpkgs, tests))) )) | value!(Some(Instruction::Eval), tag!("eval")) | // TODO: Currently keeping previous behaviour of ignoring unknown commands. Maybe @@ -195,11 +195,11 @@ baz", fn test_comment() { assert_eq!( Some(vec![Instruction::Build( - Subset::NixOS, + Subset::Nixpkgs, vec![ - String::from("tests.foo"), - String::from("tests.bar"), - String::from("tests.baz"), + String::from("nixosTests.foo"), + String::from("nixosTests.bar"), + String::from("nixosTests.baz"), ] ),]), parse("@GrahamCOfBorg test foo bar baz")