Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract os-autoinst basepath using enviromental variable #6127

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
11 changes: 6 additions & 5 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 @@ -352,14 +353,14 @@ sub setup_share_dir {
$sharedir = path($sharedir, 'openqa', 'share')->make_path;

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 +406,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
Loading