From 1861d88ec84e9a918480ec36eedaaa789fa3b964 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Fri, 29 Mar 2024 15:43:10 -0300 Subject: [PATCH] cue: move custom installCheckPhase to passthru.tests As recommended by the Nixpkgs documentation, custom tests are better served by passthru.tests, whilst installCheckPhase is recommended for tests that come from the upstream. --- pkgs/development/tools/cue/default.nix | 7 +------ pkgs/development/tools/cue/tests/001-all-good.nix | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/tools/cue/tests/001-all-good.nix diff --git a/pkgs/development/tools/cue/default.nix b/pkgs/development/tools/cue/default.nix index fd82fc9df869..6f86bd745a24 100644 --- a/pkgs/development/tools/cue/default.nix +++ b/pkgs/development/tools/cue/default.nix @@ -27,21 +27,16 @@ buildGoModule rec { ldflags = [ "-s" "-w" "-X cuelang.org/go/cmd/cue/cmd.version=${version}" ]; postInstall = '' - # Completions installShellCompletion --cmd cue \ --bash <($out/bin/cue completion bash) \ --fish <($out/bin/cue completion fish) \ --zsh <($out/bin/cue completion zsh) ''; - doInstallCheck = true; - installCheckPhase = '' - $out/bin/cue eval - <<<'a: "all good"' > /dev/null - ''; - passthru = { writeCueValidator = callPackage ./validator.nix { }; tests = { + test-001-all-good = callPackage ./tests/001-all-good.nix { }; version = testers.testVersion { package = cue; command = "cue version"; diff --git a/pkgs/development/tools/cue/tests/001-all-good.nix b/pkgs/development/tools/cue/tests/001-all-good.nix new file mode 100644 index 000000000000..d9919cd7fee4 --- /dev/null +++ b/pkgs/development/tools/cue/tests/001-all-good.nix @@ -0,0 +1,11 @@ +{ lib +, cue +, runCommand +}: + +runCommand "cue-test-001-all-good-${cue.version}" { + nativeBuildInputs = [ cue ]; + meta.timeout = 10; +} '' + cue eval - <<<'a: "all good"' > $out + ''