[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser-bundle-testsuite][main] 2 commits: Bug 40121: Include TEST-UNEXPECTED in pipelines reports



Title: GitLab

boklm pushed to branch main at The Tor Project / Applications / tor-browser-bundle-testsuite

Commits:

  • 144c354b
    by Nicolas Vigier at 2026-10-13T10:51:02+02:00
    Bug 40121: Include TEST-UNEXPECTED in pipelines reports
    
  • 4725fbc0
    by Nicolas Vigier at 2026-10-13T10:51:03+02:00
    Bug 40124: Remove empty line in pipelines result email
    

3 changed files:

Changes:

  • TBBTestSuite/TestSuite/TorBrowserBuildGitlabPipelines.pm
    ... ... @@ -70,6 +70,15 @@ sub get_pipeline_status {
    70 70
         return 'timeout';
    
    71 71
     }
    
    72 72
     
    
    73
    +sub get_failed_job_unexpected_fail {
    
    74
    +    my ($url) = @_;
    
    75
    +    my $ua = LWP::UserAgent->new;
    
    76
    +    my $response = $ua->get($url);
    
    77
    +    return () unless $response->is_success;
    
    78
    +    my @lines = split /\n/, $response->decoded_content;
    
    79
    +    return grep { s/.+INFO - TEST-UNEXPECTED/TEST-UNEXPECTED/ } @lines;
    
    80
    +}
    
    81
    +
    
    73 82
     sub get_failed_jobs {
    
    74 83
         my ($pipeline_id) = @_;
    
    75 84
         my @res;
    
    ... ... @@ -80,11 +89,14 @@ sub get_failed_jobs {
    80 89
         my $result = eval { decode_json $response->decoded_content };
    
    81 90
         return \@res unless ref $result eq 'ARRAY';
    
    82 91
         foreach my $job (@$result) {
    
    92
    +        my $job_url = "https://gitlab.torproject.org/tpo/applications/tor-browser-bundle-testsuite/-/jobs/$job->{id}/raw";
    
    93
    +        my @unexpected_fails = get_failed_job_unexpected_fail($job_url);
    
    83 94
             push @res, {
    
    84 95
                 id => $job->{id},
    
    85
    -            url => "https://gitlab.torproject.org/tpo/applications/tor-browser-bundle-testsuite/-/jobs/$job->{id}",
    
    96
    +            url => $job_url,
    
    86 97
                 name => $job->{name},
    
    87 98
                 failure_reason => $job->{failure_reason},
    
    99
    +            @unexpected_fails ? ( unexpected_fails => [ @unexpected_fails ] ) : (),
    
    88 100
             };
    
    89 101
         }
    
    90 102
         return \@res;
    
    ... ... @@ -112,6 +124,7 @@ sub set_tests {
    112 124
         return unless -d $tbb_buildreport;
    
    113 125
         foreach my $pipeline (path($tbb_buildreport)->children(qr/\.trigger-test-pipeline\.stdout\.txt\z/)) {
    
    114 126
             my $url = $pipeline->slurp_utf8;
    
    127
    +        chomp $url;
    
    115 128
             my $name = $pipeline->basename;
    
    116 129
             if ($name =~ m/^(.+)\.trigger-test-pipeline\.stdout\.txt\z/) {
    
    117 130
                 my $test_name = "pipeline-$1";
    

  • tmpl/details_gitlab_pipeline.html
    ... ... @@ -5,7 +5,15 @@
    5 5
         <li><a href="">"[% test.gitlab_pipeline_url %]">GitLab test pipeline</a></li>
    
    6 6
     [% IF test.failed_jobs %]
    
    7 7
         [% FOREACH job = test.failed_jobs %]
    
    8
    -    <li>Failed job: <a href="">"[% job.url %]">[% job.name %](#[% job.id %])</a> - [% job.failure_reason %]</li>
    
    8
    +    <li>Failed job: <a href="">"[% job.url %]">[% job.name %](#[% job.id %])</a> - [% job.failure_reason %]
    
    9
    +    [% IF job.unexpected_fails -%]
    
    10
    +        <ul>
    
    11
    +        [%- FOREACH unexpected_fail = job.unexpected_fails -%]
    
    12
    +          <li>[% unexpected_fail %]</li>
    
    13
    +        [% END %]
    
    14
    +        </ul>
    
    15
    +    [% END %]
    
    16
    +    </li>
    
    9 17
         [% END %]
    
    10 18
     [% END %]
    
    11 19
     </ul>

  • tmpl/report_tor-browser_pipelines.txt
    ... ... @@ -7,11 +7,20 @@ Results
    7 7
     [% FOREACH test IN tbbfiles.$tbbfile.tests -%]
    
    8 8
     [% IF test.results -%]
    
    9 9
       [% test.name %]: [% test.results.success ? 'ok' : 'failed (' _ test.fail_type _ ')' %]
    
    10
    -
    
    11 10
         GitLab test pipeline: [% test.gitlab_pipeline_url ? test.gitlab_pipeline_url : 'failed run' %]
    
    12 11
     [% IF test.failed_jobs -%]
    
    13 12
         [%- FOREACH job = test.failed_jobs -%]
    
    14 13
         Failed job ([% job.failure_reason %]): [% job.url %]
    
    14
    +
    
    15
    +    [%- IF job.unexpected_fails -%]
    
    16
    +      Unexpected fails:
    
    17
    +
    
    18
    +      [%- FOREACH unexpected_fail = job.unexpected_fails -%]
    
    19
    +        [% unexpected_fail %]
    
    20
    +
    
    21
    +      [%- END -%]
    
    22
    +
    
    23
    +    [%- END -%]
    
    15 24
         [%- END -%]
    
    16 25
     
    
    17 26
     [% END -%]
    

  • _______________________________________________
    tor-commits mailing list -- tor-commits@xxxxxxxxxxxxxxxxxxxx
    To unsubscribe send an email to tor-commits-leave@xxxxxxxxxxxxxxxxxxxx