Files
lix/t/scripts/hydra-send-stats.t
T
Maximilian Boschandbenaryorg 909542e1cb Use ref<Store> for localStore/destStore
As suggested by pennae.
The stores don't need to be nullable, so we initialize them right in the
constructor of `State`.

(cherry picked from commit 4b2720816d24c2e9770d1d65b73dbc8974c6dc1d)

The lix changes 7bf3d0fa2aac73a838ee91e1170034dfe3722159...949a5615405d24294abab4d3dfb05958d87c32d6 have caused build errors which are addressed with the changes to hydra herein as well as additional changes in lix.

Fixes: #36

Flake lock file updates:

• Updated input 'lix':
    'git+https://git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=b918f1c307b314daa44407bac60046630f13ed48' (2025-03-27)
  → 'git+https://git.lix.systems/lix-project/lix?ref=refs/heads/main&rev=2ef4b69760af183792a740f425eb371a6aeb0009' (2025-04-06)

Co-authored-by: benaryorg <binary@benary.org>
Signed-off-by: benaryorg <binary@benary.org>
2025-04-07 12:15:11 +00:00

30 lines
960 B
Perl

use feature 'unicode_strings';
use strict;
use warnings;
use Setup;
use Hydra::Helper::Exec;
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", "--once"));
is($stdout, "", "hydra-send-stats stdout should be empty");
# Remove `unknown setting` warnings. These can happen in the dev shell with a
# local `nix.conf` or even in tests since the tests are using a local chroot store,
# but hydra-queue-runner sets store config for a remote store.
# hydra-queue-runner initializes stores in its ctor now, so these warnings get propagated
# in the tests to hydra-send-stats.
$stderr = join "\n", grep { 0 != rindex $_, "warning: unknown setting" } split "\n", $stderr;
is($stderr, "", "hydra-send-stats stderr should be empty");
is($res, 0, "hydra-send-stats --once should exit zero");
done_testing;