Update to upstream version

This commit is contained in:
eabdullin 2022-12-12 08:50:08 +03:00
parent 54425472a1
commit ed59d51d50
3 changed files with 91 additions and 9 deletions

View File

@ -314,4 +314,47 @@ subtest 'create update job' => sub {
is_deeply($body, $expected, 'update job create triggers standardized amqp');
};
subtest 'create update job (new-style ADVISORY_NVR_N)' => sub {
$plugin_mock_callcount = 0;
diag("Count: $plugin_mock_callcount");
delete $settings->{ADVISORY_NVRS};
# these are intentionally not in alphabetical order
$settings->{ADVISORY_NVRS_1} = 'kernel-5.2.8-100.fc29 kernel-tools-5.2.8-100.fc29';
$settings->{ADVISORY_NVRS_2} = 'kernel-headers-5.2.8-100.fc29';
$t->post_ok("/api/v1/jobs" => form => $settings)->status_is(200);
ok(my $newupdatejob = $t->tx->res->json->{id}, 'got ID of new-style update job');
diag("Count: $plugin_mock_callcount");
ok($plugin_mock_callcount == 1, 'mock was called');
my ($body, $headerframe) = @{$published{'org.fedoraproject.stg.ci.fedora-update.test.queued'}};
$expected_artifact = {
alias => 'FEDORA-2019-6bda4c81f4',
builds => [
{
nvr => 'kernel-5.2.8-100.fc29'
},
{
nvr => 'kernel-headers-5.2.8-100.fc29'
},
{
nvr => 'kernel-tools-5.2.8-100.fc29'
}
],
id => 'sha256:b85bba148cec9d9c4dafea3a49785abef1f549fbad368f3818e20d9802340b16',
type => 'fedora-update',
release => {
version => '42',
name => 'F42'
},
};
$expected_run = {
url => "https://openqa.stg.fedoraproject.org/tests/$newupdatejob",
log => "https://openqa.stg.fedoraproject.org/tests/$newupdatejob/file/autoinst-log.txt",
id => $newupdatejob,
};
my $expected = get_expected;
# no image for update message
delete $expected->{'image'};
is_deeply($body, $expected, 'update job create triggers standardized amqp');
};
done_testing();

View File

@ -149,10 +149,24 @@ sub log_event_fedora_ci_messages {
version => $job->VERSION,
name => "F" . $job->VERSION
};
# handle old-style single ADVISORY_NVRS with all NVRs
my @nvrs = split(/ /, $job->settings_hash->{ADVISORY_NVRS} || '');
unless (@nvrs) {
log_error "ADVISORY_NVRS not found for update test $job_id! Cannot publish!";
return;
# handle new-style chunked ADVISORY_NVRS_N settings
my $count = 1;
while ($count) {
if ($job->settings_hash->{"ADVISORY_NVRS_$count"}) {
push @nvrs, split(/ /, $job->settings_hash->{"ADVISORY_NVRS_$count"});
$count++;
}
else {
$count = 0;
}
}
unless (@nvrs) {
log_error "ADVISORY_NVRS(_N) not found for update test $job_id! Cannot publish!";
return;
}
}
@nvrs = sort(@nvrs);
my @builds;

View File

@ -23,9 +23,9 @@
%global github_owner os-autoinst
%global github_name openQA
%global github_version 4.6
%global github_commit 9267281b4e7ec98515f7d6e680c5b17d1944e29a
%global github_commit b93eb7f4b04494cf3c7128a6db7ddb9b689a748b
# if set, will be a post-release snapshot build, otherwise a 'normal' build
%global github_date 20220201
%global github_date 20221123
%global shortcommit %(c=%{github_commit}; echo ${c:0:7})
# can't use linebreaks here!
@ -46,7 +46,7 @@
# Diff from SUSE: we use 'perl-interpreter' where they use 'perl',
# our 'perl' is a metapackage and we don't want all of it
# The following line is generated from dependencies.yaml (upstream)
%define common_requires perl-interpreter >= 5.20.0 perl(Archive::Extract) > 0.7 perl(Carp::Always) >= 0.14.02 perl(Config::IniFiles) perl(Config::Tiny) perl(Cpanel::JSON::XS) >= 4.09 perl(Cwd) perl(Data::Dump) perl(Data::Dumper) perl(Digest::MD5) perl(Filesys::Df) perl(Getopt::Long) perl(Minion) >= 10.22 perl(Mojolicious) >= 9.20 perl(Regexp::Common) perl(Storable) perl(Time::Moment) perl(Try::Tiny)
%define common_requires perl-interpreter >= 5.20.0 perl(Archive::Extract) > 0.7 perl(Carp::Always) >= 0.14.02 perl(Config::IniFiles) perl(Config::Tiny) perl(Cpanel::JSON::XS) >= 4.09 perl(Cwd) perl(Data::Dump) perl(Data::Dumper) perl(Digest::MD5) perl(Filesys::Df) perl(Getopt::Long) perl(Minion) >= 10.25 perl(Mojolicious) >= 9.20 perl(Regexp::Common) perl(Storable) perl(Time::Moment) perl(Try::Tiny)
# runtime requirements for the main package that are not required by other sub-packages
# The following line is generated from dependencies.yaml (upstream)
%define main_requires %assetpack_requires git-core hostname perl(BSD::Resource) perl(Carp) perl(CommonMark) perl(Config::Tiny) perl(DBD::Pg) >= 3.7.4 perl(DBI) >= 1.632 perl(DBIx::Class) >= 0.082801 perl(DBIx::Class::DeploymentHandler) perl(DBIx::Class::DynamicDefault) perl(DBIx::Class::OptimisticLocking) perl(DBIx::Class::ResultClass::HashRefInflator) perl(DBIx::Class::Schema::Config) perl(DBIx::Class::Storage::Statistics) perl(Date::Format) perl(DateTime) perl(DateTime::Duration) perl(DateTime::Format::Pg) perl(Exporter) perl(Fcntl) perl(File::Basename) perl(File::Copy) perl(File::Copy::Recursive) perl(File::Path) perl(File::Spec) perl(FindBin) perl(Getopt::Long::Descriptive) perl(IO::Handle) perl(IPC::Run) perl(JSON::Validator) perl(LWP::UserAgent) perl(Module::Load::Conditional) perl(Module::Pluggable) perl(Mojo::Base) perl(Mojo::ByteStream) perl(Mojo::IOLoop) perl(Mojo::JSON) perl(Mojo::Pg) perl(Mojo::RabbitMQ::Client) >= 0.2 perl(Mojo::URL) perl(Mojo::Util) perl(Mojolicious::Commands) perl(Mojolicious::Plugin) perl(Mojolicious::Static) perl(Net::OpenID::Consumer) perl(POSIX) perl(Pod::POM) perl(SQL::Translator) perl(Scalar::Util) perl(Sort::Versions) perl(Text::Diff) perl(Time::HiRes) perl(Time::ParseDate) perl(Time::Piece) perl(Time::Seconds) perl(URI::Escape) perl(YAML::PP) >= 0.026 perl(YAML::XS) perl(aliased) perl(base) perl(constant) perl(diagnostics) perl(strict) perl(warnings)
@ -55,7 +55,7 @@
# Diff from SUSE 1: case (they have openQA-client, we have openqa-client)
# Diff from SUSE 2: we have 'sqlite' not 'sqlite3'
# The following line is generated from dependencies.yaml (upstream)
%define worker_requires openqa-client optipng os-autoinst < 5 perl(Capture::Tiny) perl(File::Map) perl(Minion::Backend::SQLite) >= 5.0.1 perl(Mojo::IOLoop::ReadWriteProcess) >= 0.26 perl(Mojo::SQLite) psmisc sqlite >= 3.24.0
%define worker_requires openqa-client optipng os-autoinst < 5 perl(Capture::Tiny) perl(File::Map) perl(Minion::Backend::SQLite) >= 5.0.7 perl(Mojo::IOLoop::ReadWriteProcess) >= 0.26 perl(Mojo::SQLite) psmisc sqlite >= 3.24.0
# The following line is generated from dependencies.yaml (upstream)
%define build_requires %assetpack_requires rubygem(sass)
@ -92,7 +92,7 @@
Name: openqa
Version: %{github_version}%{?github_date:^%{github_date}git%{shortcommit}}
Release: 1%{?dist}
Release: 2%{?dist}
Summary: OS-level automated testing framework
License: GPLv2+
Url: http://os-autoinst.github.io/openQA/
@ -353,8 +353,8 @@ mkdir -p %{buildroot}%{_bindir}
ln -s %{_datadir}/openqa/script/client %{buildroot}%{_bindir}/openqa-client
ln -s %{_datadir}/openqa/script/openqa-cli %{buildroot}%{_bindir}/openqa-cli
ln -s %{_datadir}/openqa/script/openqa-clone-job %{buildroot}%{_bindir}/openqa-clone-job
ln -s %{_datadir}/openqa/script/dump_templates %{buildroot}%{_bindir}/openqa-dump-templates
ln -s %{_datadir}/openqa/script/load_templates %{buildroot}%{_bindir}/openqa-load-templates
ln -s %{_datadir}/openqa/script/openqa-dump-templates %{buildroot}%{_bindir}/openqa-dump-templates
ln -s %{_datadir}/openqa/script/openqa-load-templates %{buildroot}%{_bindir}/openqa-load-templates
ln -s %{_datadir}/openqa/script/openqa-clone-custom-git-refspec %{buildroot}%{_bindir}/openqa-clone-custom-git-refspec
ln -s %{_datadir}/openqa/script/openqa-validate-yaml %{buildroot}%{_bindir}/openqa-validate-yaml
ln -s %{_datadir}/openqa/script/setup-db %{buildroot}%{_bindir}/openqa-setup-db
@ -381,6 +381,7 @@ mkdir %{buildroot}%{_localstatedir}/lib/openqa/webui/cache
rm -rf %{buildroot}%{_sysconfdir}/apparmor.d
# these scripts are very SUSE-specific
rm -f %{buildroot}%{_datadir}/openqa/script/openqa-auto-update
rm -f %{buildroot}%{_datadir}/openqa/script/openqa-continuous-update
rm -f %{buildroot}%{_datadir}/openqa/script/openqa-rollback
rm -f %{buildroot}%{_datadir}/openqa/script/openqa-check-devel-repo
@ -415,6 +416,7 @@ export OPENQA_TEST_TIMEOUT_SCALE_CI=15
# docker-compose. Also, these tests are less relevant (or not relevant) for
# packaging
export CONTAINER_TEST=0
export HELM_TEST=0
# GIT_CEILING_DIRECTORIES here avoids a case where git error handling
# can differ when you run the build in mock and cause 16-utils-runcmd
# to fail
@ -580,6 +582,7 @@ fi
%{_prefix}/lib/systemd/system-generators/systemd-openqa-generator
%{_unitdir}/openqa-worker.target
%{_unitdir}/openqa-worker@.service
%{_unitdir}/openqa-worker-plain@.service
%{_unitdir}/openqa-worker-cacheservice-minion.service
%{_unitdir}/openqa-worker-cacheservice.service
%{_unitdir}/openqa-worker-no-cleanup@.service
@ -623,6 +626,8 @@ fi
%{_datadir}/openqa/script/clone_job.pl
%{_datadir}/openqa/script/dump_templates
%{_datadir}/openqa/script/load_templates
%{_datadir}/openqa/script/openqa-dump-templates
%{_datadir}/openqa/script/openqa-load-templates
%{_datadir}/openqa/script/openqa-cli
%{_datadir}/openqa/script/openqa-clone-job
%{_datadir}/openqa/script/openqa-clone-custom-git-refspec
@ -664,6 +669,26 @@ fi
%{_datadir}/openqa/lib/OpenQA/WebAPI/Plugin/FedoraUpdateRestart.pm
%changelog
* Thu Dec 01 2022 Adam Williamson <awilliam@redhat.com> - 4.6^20221123gitb93eb7f-2
- FedoraMessaging: handle chunked ADVISORY_NVRS_N settings
* Thu Nov 24 2022 Adam Williamson <awilliam@redhat.com> - 4.6^20221123gitb93eb7f-1
- Update to latest git, re-sync spec, drop merged patches
* Sat Aug 27 2022 Adam Williamson <awilliam@redhat.com> - 4.6^20220615git8ea2059-3
- Backport PR #4784 to fix a worker startup bug
- Backport PR #4785 to add pagure.io and GNOME gitlab trackers
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.6^20220615git8ea2059-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 20 2022 Adam Williamson <awilliam@redhat.com> - 4.6^20220615git8ea2059-1
- Update to latest git, re-sync spec
- Backport PR #4710 to fix perl 5.36 warnings on @_ use in signed subs
* Tue May 31 2022 Adam Williamson <awilliam@redhat.com> - 4.6^20220531git47fe286-1
- Update to latest git, re-sync spec
* Tue Feb 01 2022 Adam Williamson <awilliam@redhat.com> - 4.6^20220201git9267281-1
- Update to latest git
- Switch to newer caret-based snapshot versioning scheme