Skip to content

Commit

Permalink
Extract os-autoinst basepath using enviromental variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Wabri committed Jan 17, 2025
1 parent 81f8cc9 commit 355507e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ OPENQA_SCHEDULER_HOST =
OPENQA_WEB_SOCKETS_HOST =
OPENQA_SCHEDULER_STARVATION_PROTECTION_PRIORITY_OFFSET =

# change if os-autoinst project root is different from '../os-autoinst'
OS_AUTOINST_BASEDIR =

.PHONY: help
help:
@echo Call one of the available targets:
Expand Down
10 changes: 6 additions & 4 deletions t/lib/OpenQA/Test/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ BEGIN {
require OpenQA::Utils;
$ENV{MOJO_HOME} = Mojo::Home->new->detect('OpenQA::Utils');
}
$ENV{OS_AUTOINST_BASEDIR} //= '../os-autoinst';
}

our (@EXPORT, @EXPORT_OK);
Expand Down Expand Up @@ -353,13 +354,14 @@ sub setup_share_dir {

path($sharedir, 'factory', 'iso')->make_path;

my $iso_file_path = abs_path('../os-autoinst/t/data/Core-7.2.iso') or die 'Core-7.2.iso not found';
my $iso_file_path = abs_path($ENV{OS_AUTOINST_BASEDIR}, '/t/data/Core-7.2.iso') or die 'Core-7.2.iso not found';
my $iso_link_path = path($sharedir, 'factory', 'iso')->child('Core-7.2.iso')->to_string();
symlink($iso_file_path, $iso_link_path) || die "can't symlink $iso_link_path -> $iso_file_path: $!";

path($sharedir, 'tests')->make_path;

my $tests_dir_path = abs_path('../os-autoinst/t/data/tests/') or die 'tests dir not found';
my $tests_dir_path = abs_path($ENV{OS_AUTOINST_BASEDIR}, '/t/data/tests/')
or die 'tests dir not found';
my $tests_link_path = path($sharedir, 'tests')->child('tinycore');
symlink $tests_dir_path, $tests_link_path or die "can't symlink '$tests_link_path' -> '$tests_dir_path': $!";
note "using tests and needles from $tests_dir_path";
Expand Down Expand Up @@ -405,15 +407,15 @@ sub setup_worker { # uncoverable statement
}

sub start_worker ($connect_args) {
my $os_autoinst_path = '../os-autoinst';
my $os_autoinst_path = $ENV{OS_AUTOINST_BASEDIR};
my $isotovideo_path = $os_autoinst_path . '/isotovideo';

# save testing time as we do not test a webUI host being down for
# multiple minutes
$ENV{OPENQA_WORKER_CONNECT_RETRIES} = 1;
# enable additional diagnostics for serialization errors
$ENV{DEBUG_JSON} = 1;
my @cmd = qw(perl ./script/worker --isotovideo=../os-autoinst/isotovideo --verbose);
my @cmd = ("perl", "./script/worker", "--isotovideo=$isotovideo_path", "--verbose");
push @cmd, @$connect_args;
start \@cmd;
}
Expand Down

0 comments on commit 355507e

Please sign in to comment.