Skip to content

Commit

Permalink
ci: Try to run all tests with cached built perl
Browse files Browse the repository at this point in the history
Updated test to skip test if not run as admin on windows (test is run as admin in GH)
  • Loading branch information
g-bougard committed Jun 28, 2024
1 parent 4008e9f commit 6799c40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contrib/windows/glpi-agent-built-perl-tests.pl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ sub run {

# Update PATH to include perl/bin for DLLs loading
my $binpath = catfile($self->global->{image_dir}, 'perl/bin');
$ENV{PATH} .= ":$binpath";
$ENV{PATH} = "$binpath:$ENV{PATH}";

# Without defined modules, run the tests
my $perlbin = catfile($binpath, 'perl.exe');
Expand Down Expand Up @@ -106,7 +106,7 @@ sub test {

# Update PATH to include perl/bin for DLLs loading
my $binpath = catfile($self->global->{image_dir}, 'perl/bin');
$ENV{PATH} .= ":$binpath";
$ENV{PATH} = "$binpath:$ENV{PATH}";

# Without defined modules, run the tests
my $makebin = catfile($binpath, 'gmake.exe');
Expand Down Expand Up @@ -247,8 +247,7 @@ sub load_jobfile {
plugin => 'Perl::Dist::GLPI::Agent::Step::Test',
# By default all possible test will be run
test_files => [
#~ qw(t/*.t t/*/*.t t/*/*/*.t t/*/*/*/*.t t/*/*/*/*/*.t t/*/*/*/*/*/*.t)
qw(t/*.t)
qw(t/*.t t/*/*.t t/*/*/*.t t/*/*/*/*.t t/*/*/*/*/*.t t/*/*/*/*/*/*.t)
],
skip_tests => [
# Fails if not run as administrator
Expand Down
1 change: 1 addition & 0 deletions t/agent/config.t
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ ok (scalar(@{$c->{'httpd-trust'}}) == 4);

SKIP: {
skip ('test for Windows only', 7) if ($OSNAME ne 'MSWin32');
skip ('registry access can only be tested as admin', 7) if system("net session 2>nul");
my $settings = GLPI::Test::Utils::openWin32Registry();
ok (defined $settings);
my $testValue = time;
Expand Down

0 comments on commit 6799c40

Please sign in to comment.