Skip to content

Commit

Permalink
Enable logs upload for agama playwright tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredi committed Sep 1, 2023
1 parent 3d7784b commit d82f246
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Yam/agama/agama_base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ sub post_fail_hook {
select_console 'root-console';
y2_base::save_upload_y2logs($self, skip_logs_investigation => 1);
save_and_upload_log('journalctl -u agama-auto', "/tmp/agama-auto-log.txt");
upload_traces();
}

sub post_run_hook {
Expand All @@ -35,4 +36,10 @@ sub test_flags {
return {fatal => 1};
}

sub upload_traces {
my ($dest, $sources) = ("/tmp/traces.tar.gz", "test-results/");
script_run("tar czf $dest $sources");
upload_logs($dest, failok => 1);
}

1;
2 changes: 2 additions & 0 deletions tests/yam/agama/agama.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ use testapi qw(
);

sub run {
my $self = shift;
my $test = get_required_var('AGAMA_TEST');

assert_script_run("playwright test --trace on --project chromium --config /usr/share/e2e-agama-playwright tests/" . $test . ".spec.ts", timeout => 1200);
$self->upload_traces();
enter_cmd 'reboot';
}

Expand Down

0 comments on commit d82f246

Please sign in to comment.