From 52dda56b9975e78816ab0bc274fa689f6497d793 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sat, 15 Jan 2022 14:18:33 -0500 Subject: [PATCH] hydra-update-gc-roots: add a very basic test validating successful execution --- .../hydra-update-gc-roots/update-gc-roots.t | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 t/scripts/hydra-update-gc-roots/update-gc-roots.t diff --git a/t/scripts/hydra-update-gc-roots/update-gc-roots.t b/t/scripts/hydra-update-gc-roots/update-gc-roots.t new file mode 100644 index 00000000..9729e066 --- /dev/null +++ b/t/scripts/hydra-update-gc-roots/update-gc-roots.t @@ -0,0 +1,22 @@ +use feature 'unicode_strings'; +use strict; +use warnings; +use Setup; +use Test2::V0; + +my $ctx = test_context(); +my $builds = $ctx->makeAndEvaluateJobset( + expression => "one-job.nix", + build => 1 +); + +subtest "Updating GC roots" => sub { + my ($res, $stdout, $stderr) = captureStdoutStderr(5, ("hydra-update-gc-roots")); + is($res, 0, "hydra-update-gc-roots should exit zero"); + if ($res != 0) { + print "gc roots stdout: $stdout\n"; + print "gc roots stderr: $stderr"; + } +}; + +done_testing;