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

This commit is contained in:
Graham Christensen 2021-03-20 09:06:54 -04:00
parent aeb3d2f44c
commit 6f662a606a
No known key found for this signature in database
GPG key ID: FE918C3A98C1030F
2 changed files with 24 additions and 1 deletions

View file

@ -9,7 +9,10 @@ use File::Basename;
use Cwd qw(abs_path getcwd);
our @ISA = qw(Exporter);
our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobset nrQueuedBuildsForJobset createBaseJobset createJobsetWithOneInput evalSucceeds runBuild sendNotifications updateRepository);
our @EXPORT = qw(test_init hydra_setup nrBuildsForJobset queuedBuildsForJobset
nrQueuedBuildsForJobset createBaseJobset createJobsetWithOneInput
evalSucceeds runBuild sendNotifications updateRepository
captureStdoutStderr);
# Set up the environment for running tests.
#

View file

@ -0,0 +1,20 @@
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;