hydra-send-stats: add a failing test asserting it can run

[?]
Mar 20, 2021, 1:06 PM
DNOLOMX7MSBZMPOZUQPCCGQJ2OKV3642C4FWY6P6SK4LR5U26LTQC

Dependencies

  • [2] 2JJP7673 tests: move to t, allow `yath test` from root
  • [3] UIA3ULNU Give each test its own Nix directories
  • [4] FAIJDQKZ
  • [5] HX4QYOYA add first evaluations tests
  • [6] HE3GX5IP Optimize fetch-git.
  • [7] OWRS526H Create an ephemeral PostgreSQL database per test
  • [8] 3AKZKWCR RunCommand: Test
  • [9] YIZWKGFI tests: add jobsdir and testdir to ctx hash

Change contents

  • replacement in t/lib/Setup.pm at line 12
    [3.587][3.695:899]()
    our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobset nrQueuedBuildsForJobset createBaseJobset createJobsetWithOneInput evalSucceeds runBuild sendNotifications updateRepository);
    [3.587]
    [3.1502]
    our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobset
    nrQueuedBuildsForJobset createBaseJobset createJobsetWithOneInput
    evalSucceeds runBuild sendNotifications updateRepository
    captureStdoutStderr);
  • file addition: scripts (d--r------)
    [2.697]
  • file addition: hydra-send-stats.t (----------)
    [0.277]
    use feature 'unicode_strings';
    use strict;
    use Setup;
    my %ctx = test_init();
    require Hydra::Schema;
    require Hydra::Model::DB;
    use Test2::V0;
    my $db = Hydra::Model::DB->new;
    hydra_setup($db);
    my ($res, $stdout, $stderr) = captureStdoutStderr(60, ("hydra-send-stats"));
    is($stdout, "", "hydra-send-stats stdout should be empty");
    is($stderr, "", "hydra-send-stats stderr should be empty");
    is($res, 0, "hydra-send-stats --once should exit zero");
    done_testing;