Bugzilla – Attachment 186622 Details for
Bug 39877
CI - Incremental runs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39877: Use OS codename to separate OSes
Bug-39877-Use-OS-codename-to-separate-OSes.patch (text/plain), 3.94 KB, created by
Jonathan Druart
on 2025-09-19 13:05:12 UTC
(
hide
)
Description:
Bug 39877: Use OS codename to separate OSes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-09-19 13:05:12 UTC
Size:
3.94 KB
patch
obsolete
>From cae2055e4a7c24c69c2404b554f8dcdd8349bdc5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 11 Sep 2025 11:41:29 +0200 >Subject: [PATCH] Bug 39877: Use OS codename to separate OSes > >--- > Koha/Devel/CI/IncrementalRuns.pm | 18 +++++++++++++----- > xt/perltidy.t | 5 +++-- > 2 files changed, 16 insertions(+), 7 deletions(-) > >diff --git a/Koha/Devel/CI/IncrementalRuns.pm b/Koha/Devel/CI/IncrementalRuns.pm >index 4ffc39acd2c..f654e5c1daa 100644 >--- a/Koha/Devel/CI/IncrementalRuns.pm >+++ b/Koha/Devel/CI/IncrementalRuns.pm >@@ -84,6 +84,12 @@ sub new { > }; > > if ( $self->{incremental_run} ) { >+ >+ my $codename = qx{lsb_release -s -c 2> /dev/null}; >+ die "Cannot use increment runs if codename is not set (lsb_release not available?)" unless $codename; >+ >+ chomp $codename; >+ > unless ( $self->{test_name} ) { > my @caller_info = caller(); > my $script_filename = $caller_info[1]; >@@ -92,13 +98,15 @@ sub new { > $self->{test_name} =~ s|\..*$||g; > } > >+ $self->{test_dir} = sprintf "%s/%s", $self->{test_name}, $codename; >+ > if ( $self->{git_repo_dir} && $self->{repo_url} ) { > unless ( -d $self->{git_repo_dir} ) { > qx{git clone $self->{repo_url} $self->{git_repo_dir}}; > } > qx{git -C $self->{git_repo_dir} fetch origin}; > >- make_path("$self->{git_repo_dir}/$self->{test_name}"); >+ make_path("$self->{git_repo_dir}/$self->{test_dir}"); > } > } > >@@ -122,7 +130,7 @@ sub get_files_to_test { > my $no_history; > if ( $self->{incremental_run} ) { > my @koha_commit_history = qx{git log --pretty=format:"%h"}; >- my @tested_commit_history = qx{ls $self->{git_repo_dir}/$self->{test_name}}; >+ my @tested_commit_history = qx{ls $self->{git_repo_dir}/$self->{test_dir}}; > chomp for @koha_commit_history, @tested_commit_history; > if (@tested_commit_history) { > my $last_build_commit = firstval { >@@ -131,7 +139,7 @@ sub get_files_to_test { > } > @koha_commit_history; > if ($last_build_commit) { >- @files = @{ from_json( read_file("$self->{git_repo_dir}/$self->{test_name}/$last_build_commit") ) }; >+ @files = @{ from_json( read_file("$self->{git_repo_dir}/$self->{test_dir}/$last_build_commit") ) }; > push @files, $dev_files->ls_files( $filetype, "$last_build_commit HEAD" ); > } else { > >@@ -164,7 +172,7 @@ sub report_results { > my $commit_id = qx{git rev-parse --short HEAD}; > chomp $commit_id; > >- my $failure_file = "$self->{git_repo_dir}/$self->{test_name}/$commit_id"; >+ my $failure_file = "$self->{git_repo_dir}/$self->{test_dir}/$commit_id"; > my $failures = [ > sort map { > my ( $file, $exit_code ) = ( $_, $results->{$_} ); >@@ -175,7 +183,7 @@ sub report_results { > write_file( $failure_file, to_json($failures) ); > > qx{git -C $self->{git_repo_dir} add $failure_file}; >- qx{git -C $self->{git_repo_dir} commit -m "$commit_id - $self->{test_name}"}; >+ qx{git -C $self->{git_repo_dir} commit -m "$commit_id - $self->{test_dir}"}; > ( my $push_domain = $self->{repo_url} ) =~ s{^https://}{}; > my $push_url = "https://gitlab-ci-token:$self->{token}\@$push_domain"; > qx{git -C $self->{git_repo_dir} push $push_url main}; >diff --git a/xt/perltidy.t b/xt/perltidy.t >index 0667daa5bda..2e2792fc309 100755 >--- a/xt/perltidy.t >+++ b/xt/perltidy.t >@@ -2,14 +2,15 @@ > use Modern::Perl; > use Test::PerlTidy; > use Test::More; >-use Test::NoWarnings; > > use Koha::Devel::CI::IncrementalRuns; > > my $ci = Koha::Devel::CI::IncrementalRuns->new( { context => 'tidy' } ); > my @files = $ci->get_files_to_test('pl'); > >-plan tests => scalar(@files) + 1; >+@files = qw(Koha.pm mainpage.pl Koha/Patrons.pm); >+ >+plan tests => scalar(@files); > > my %results; > for my $file (@files) { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39877
:
182308
|
182309
|
182310
|
182311
|
182347
|
182348
|
182349
|
182350
|
182355
|
182356
|
182357
|
182358
|
183795
|
183796
|
183797
|
183798
|
184462
|
184463
|
184464
|
184465
|
184466
|
184779
|
184780
|
184781
|
184782
|
184783
|
184785
|
184875
|
184876
|
184877
|
184878
|
184879
|
184880
|
186320
|
186321
|
186322
|
186323
|
186324
|
186325
|
186327
|
186328
|
186329
|
186330
|
186331
|
186332
|
186362
|
186363
|
186364
|
186365
|
186366
|
186367
|
186368
|
186370
| 186622