Skip to content

Conversation

perlpunk
Copy link
Contributor

@perlpunk perlpunk commented Sep 4, 2025

Issue: https://progress.opensuse.org/issues/188310
This is just a proof of concept on how we could allow multple machines per job template in SCENARIO_DEFINITIONs.

It came up because we possibly want to run openqa-in-openqa jobs for both machines, and it's a useful feature in general.

Here it how our scenario file would look like:
https://github.com/perlpunk/os-autoinst-distri-openQA/blob/multiple-machines/scenario-definitions.yaml

Two possibilities to define machines per job template:

job_templates:

  # define traditionally as mapping key, as a string or an array of strings
  openqa_from_git:
    machine: [64bit-2G , uefi-2G]
    <<: *common
    settings:
      DESKTOP: minimalx
      OPENQA_FROM_GIT: "1"

  # define as template suffix
  openqa_from_containers@(64bit-2G,uefi2G):
    <<: *common
    settings:
      DESKTOP: minimalx
      LOAD_PYTHON_TEST_MODULES: "0"
      OPENQA_CONTAINERS: "1"
      OPENQA_FROM_GIT: "1"

@perlpunk perlpunk force-pushed the jobtemplate-machines branch from 2a8dab6 to 19f1c78 Compare September 5, 2025 08:12
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

❌ Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.22%. Comparing base (c55624c) to head (19f1c78).
⚠️ Report is 168 commits behind head on master.

Files with missing lines Patch % Lines
lib/OpenQA/Schema/Result/ScheduledProducts.pm 88.23% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (88.23%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6714      +/-   ##
==========================================
- Coverage   99.23%   99.22%   -0.01%     
==========================================
  Files         398      398              
  Lines       40942    40957      +15     
==========================================
+ Hits        40628    40641      +13     
- Misses        314      316       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this makes sense. The array syntax would be enough so maybe it would be best to only allow that. But I also don't really care as the code for allowing @(…) isn't really complicated.

elsif ($template->{machine}) {
my $machine = delete $template->{machine};
if (ref $machine eq 'ARRAY') {
@machines = @$machine;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also remove empty machines here for the sake of consistency:

Suggested change
@machines = @$machine;
@machines = grep { length } @$machine;

my $job_template = $job_templates->{$key};
my $settings = $job_template->{settings} // {};
my $template = $job_templates->{$key};
my %new_template = (%$template, name => $key);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is never used as a hash so we could avoid hashing:

Suggested change
my %new_template = (%$template, name => $key);
my @new_template = (%$template, name => $key);

@okurz
Copy link
Member

okurz commented Sep 7, 2025

Issue: https://progress.opensuse.org/issues/188310 This is just a proof of concept on how we could allow multple machines per job template in SCENARIO_DEFINITIONs.

With "allow" do you mean to add the array syntax to schedule all specified variants?

@perlpunk
Copy link
Contributor Author

perlpunk commented Sep 8, 2025

With "allow" do you mean to add the array syntax to schedule all specified variants?

Yes. Unless you specify the machine on the command line. I haven't implemented/tested that yet.

@perlpunk
Copy link
Contributor Author

perlpunk commented Sep 8, 2025

I think it would also be useful to have a default like in jobgroup templates, so that we don't have to specify any machine if it's the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants