boklm pushed to branch main at The Tor Project / Applications / tor-browser-bundle-testsuite Commits: b8c0aa67 by Nicolas Vigier at 2026-10-09T15:43:21+02:00 Bug 40122: Remove TBBTestSuite::TestSuite::BrowserUnitTests - - - - - 16 changed files: - − TBBTestSuite/BrowserGit.pm - − TBBTestSuite/TestSuite/BrowserUnitTests.pm - TBBTestSuite/TestSuites.pm - TBBTestSuite/Tests.pm - − config/browser-unit - install-deps - − tmpl/details_build_firefox.html - − tmpl/details_mochitest.html - − tmpl/details_mochitest_a11y.html - − tmpl/details_mochitest_browser.html - − tmpl/details_mochitest_chrome.html - − tmpl/details_mochitest_plain.html - − tmpl/details_xpcshell.html - tmpl/report.html - − tmpl/report_browserunit.txt - − tmpl/reports_index_browserunit.html Changes: ===================================== TBBTestSuite/BrowserGit.pm deleted ===================================== @@ -1,82 +0,0 @@ -package TBBTestSuite::BrowserGit; - -use strict; -use FindBin; -use TBBTestSuite::Common qw(exit_error); -use Cwd qw(getcwd); -use IO::CaptureOutput qw(capture_exec); - -# TODO: We should merge this into GitRepo.pm - -our (@ISA, @EXPORT_OK); -BEGIN { - require Exporter; - @ISA = qw(Exporter); - @EXPORT_OK = qw(git_clone_fetch get_commits_by_branch parent_commit - git_cmd git_cmd_ch); -} - -my $torbrowsergit = 'https://git.torproject.org/tor-browser.git'; -my $geckodevgit = 'https://github.com/mozilla/gecko-dev'; -our $clone_dir = "$FindBin::Bin/clones/tor-browser"; - -sub git_cmd { - my $oldcwd = getcwd; - chdir $clone_dir || exit_error "Error entering directory $clone_dir"; - my @res = capture_exec(@_); - chdir $oldcwd; - if (!$res[2]) { - exit_error 'Error running ' . join(' ', @_) . ":\n" . $res[1]; - } - return @res; -} - -sub git_cmd_ch { - my (@res) = git_cmd(@_); - chomp @res; - chomp @res; - return @res; -} - -sub git_clone_fetch { - mkdir "$FindBin::Bin/clones" unless -d "$FindBin::Bin/clones"; - if (!-d $clone_dir) { - system('git', 'clone', $torbrowsergit, $clone_dir) == 0 - || exit_error "Error cloning $torbrowsergit"; - } - git_cmd('git', 'checkout', '--detach', '-f'); - git_cmd('git', 'fetch', 'origin', '+refs/heads/*:refs/heads/*'); - my ($r) = git_cmd('git', 'remote'); - git_cmd('git', 'remote', 'add', 'gecko-dev', $geckodevgit) - unless $r =~ m/^gecko-dev$/m; - git_cmd('git', 'fetch', 'gecko-dev'); -} - -sub merge_base { - my ($commit_a, $commit_b) = @_; - my ($out) = git_cmd_ch('git', 'merge-base', $commit_a, $commit_b); - return $out; -} - -sub parent_commits { - my ($c) = @_; - my ($out) = git_cmd_ch('git', 'show', '-s', '--abbrev=20', '--format=%p', $c); - return split(' ', $out); -} - -sub get_commits { - my ($commit, $commit_stop) = @_; - my ($out) = git_cmd_ch('git', 'rev-list', '--topo-order', - "$commit_stop^..$commit"); - return split "\n", $out; -} - -sub get_commits_by_branch { - my ($tb_branch, $esr_branch) = @_; - my $base = merge_base($tb_branch, "gecko-dev/$esr_branch"); - my ($commit) = git_cmd_ch('git', 'show', '-s', '--format=%H', - "$tb_branch^{commit}"); - return get_commits($commit, $base); -} - -1; ===================================== TBBTestSuite/TestSuite/BrowserUnitTests.pm deleted ===================================== @@ -1,323 +0,0 @@ -package TBBTestSuite::TestSuite::BrowserUnitTests; - -use strict; - -use parent 'TBBTestSuite::TestSuite'; - -use FindBin; -use IO::CaptureOutput qw(capture_exec); -use File::Spec; -use File::Find; -use File::Copy; -use File::Slurp; -use XML::LibXML '1.70'; -use JSON; -use TBBTestSuite::Common qw(exit_error get_nbcpu run_to_file); -use TBBTestSuite::Reports qw(load_report); -use TBBTestSuite::Options qw($options); -use TBBTestSuite::XServer qw(start_X stop_X set_Xmode); -use TBBTestSuite::GitRepo; - -sub test_types { - return { - xpcshell => \&xpcshell_test, - mochitest_plain => sub { mochitest_test('mochitest-plain', @_) }, - mochitest_chrome => sub { mochitest_test('mochitest-chrome', @_) }, - mochitest_browser => sub { mochitest_test('mochitest-browser', @_) }, - mochitest_a11y => sub { mochitest_test('mochitest-a11y', @_) }, - build_firefox => \&build_firefox, - }; -} - -sub description { - 'Tor Browser unit tests'; -} - -sub type { - 'browserunit'; -} - -sub new { - my ($ts, $infos) = @_; - return undef unless $infos->{commit}; - my $tbbinfos = { - git_url => 'https://git.torproject.org/tor-browser.git', - %$infos, - type => $ts->type(), - filename => "browser-$infos->{commit}", - tests => [ - { - name => 'build_firefox', - type => 'build_firefox', - fail_type => 'fatal', - descr => 'Build Firefox', - }, - ], - }; - bless $tbbinfos, $ts; - $tbbinfos->{gitrepo} = TBBTestSuite::GitRepo->new({ - name => 'tor-browser', - git_url => $tbbinfos->{git_url}, - }); - $tbbinfos->{gitrepo}->clone_fetch; - chdir $tbbinfos->{gitrepo}->clone_dir; - my ($commit, $err, $success) = capture_exec('git', 'show', '-s', - '--abbrev=20', '--format=%h', $tbbinfos->{commit}); - return undef unless $success; - while (chomp $commit) {}; - $tbbinfos->{commit} = $commit; - $tbbinfos->{filename} = $tbbinfos->name; - return $tbbinfos; -} - -sub name { - my ($testsuite) = @_; - return $testsuite->{name} // "browser-$testsuite->{commit}"; -} - -sub pre_tests { - my ($tbbinfos) = @_; - chdir $tbbinfos->{gitrepo}->clone_dir; - if ($options->{clean_browserdir}) { - system('git', 'clean', '-fxd'); - system('git', 'reset', '--hard'); - } - system('git', 'checkout', $tbbinfos->{commit}) == 0 - or exit_error "Error checking out $tbbinfos->{commit}"; - my ($out, $err, $success) = capture_exec('git', 'show', '-s', - '--abbrev=20', '--format=%p', $tbbinfos->{commit}); - exit_error "Error checking parents of $tbbinfos->{commit}" unless $success; - $tbbinfos->{parent_commits} = [ split(' ', $out) ]; - ($out, $err, $success) = capture_exec('git', 'show', '-s', - '--format=%s', $tbbinfos->{commit}); - exit_error "Error getting commit subject" unless $success; - $tbbinfos->{commit_subject} = $out; - ($out, $err, $success) = capture_exec('git', 'show', '-s', - '--format=%an', $tbbinfos->{commit}); - exit_error "Error getting commit author" unless $success; - $tbbinfos->{commit_author} = $out; - $tbbinfos->find_xpcshell_tests; - $tbbinfos->find_mochitest_tests; - my ($config_guess) = capture_exec('./build/autoconf/config.guess'); - chomp $config_guess; - $tbbinfos->{topobjdir} = "obj-$config_guess"; - if ($options->{xdummy}) { - $tbbinfos->{Xdisplay} = start_X("$tbbinfos->{'results-dir'}/xorg.log"); - } -} - -sub post_tests { - my ($tbbinfos) = @_; - stop_X($tbbinfos->{Xdisplay}) if $options->{xdummy}; -} - -sub tests_by_name { - my ($tests) = @_; - my %res = map { $_->{name} => $_ } @$tests; - return \%res; -} - -sub xpcshell_mochitest_subtests_diff { - my ($t1, $t2) = @_; - my (@fail, @fixed); - my %f1 = ref $t1->{results}{failed} eq 'HASH' ? - %{$t1->{results}{failed}} - : map { $_ => 1 } @{$t1->{results}{failed}}; - my %f2 = ref $t2->{results}{failed} eq 'HASH' ? - %{$t2->{results}{failed}} - : map { $_ => 1 } @{$t2->{results}{failed}}; - my %f = ( %f1, %f2); - foreach my $t (keys %f) { - if ($f2{$t} && !$f1{$t}) { - push @fail, $t; - } - if (!$f2{$t} && $f1{$t}) { - push @fixed, $t; - } - } - if (@fail or @fixed) { - return { fail => \@fail, fixed => \@fixed }; - } - return undef; -} - -sub diff_results { - my ($r1, $r2) = @_; - my %res; - $res{run_time} = $r2->{run_time} - $r1->{run_time}; - $res{fail_tests} = []; - $res{fixed_tests} = []; - $res{tests_time} = {}; - $res{subtests} = {}; - my $r1t = tests_by_name($r1->{tests}); - my $r2t = tests_by_name($r2->{tests}); - foreach my $test (keys %$r2t) { - my ($t1, $t2) = ($r1t->{$test}, $r2t->{$test}); - if (defined $t2->{run_time} && defined $t1->{run_time}) { - $res{tests_time}->{$test} = $t2->{run_time} - $t1->{run_time}; - } - next unless defined $t1->{results}; - next unless defined $t2->{results}; - if (!$t2->{results}{success} && $t1->{results}{success}) { - push @{$res{fail_tests}}, $test; - } - if ($t2->{results}{success} && !$t1->{results}{success}) { - push @{$res{fixed_tests}}, $test; - } - if ($t1->{type} eq 'xpcshell' || $t1->{type} =~ m/^mochitest_/) { - my $s = xpcshell_mochitest_subtests_diff($t1, $t2); - $res{subtests}{$test} = $s if $s; - } - } - return \%res; -} - -sub pre_makereport { - my ($testsuite, $report, $r) = @_; - foreach my $test (@{$testsuite->{tests}}) { - mochitest_error_logs($test); - } - return unless $testsuite->{parent_results}; - $r //= TBBTestSuite::Reports::load_report($testsuite->{parent_results}[0]); - return unless $r; - my $parent = $r->{tbbfiles}{$testsuite->{parent_results}[1]}; - return unless $parent; - $testsuite->{parent_diff} = diff_results($parent, $testsuite); -} - -sub pre_reports_index { - my ($testsuite, $reports, $report) = @_; - foreach my $tbbfile (keys %{$report->{tbbfiles}}) { - my $tbbinfos = $report->{tbbfiles}{$tbbfile}; - $tbbinfos->pre_makereport($report, - $reports->{$tbbinfos->{parent_results}[0]}) - if $tbbinfos->{parent_results}; - foreach my $test (@{$report->{tbbfiles}{$tbbfile}{tests}}) { - mochitest_error_logs($test); - } - } -} - -sub find_xpcshell_tests { - my ($tbbinfos) = @_; - my $browserdir = $tbbinfos->{gitrepo}->clone_dir; - my $wanted = sub { - return unless -f $File::Find::name; - my (undef, $dir, $file) = File::Spec->splitpath($File::Find::name); - return unless $file eq 'xpcshell.ini'; - $dir =~ s{^$browserdir/}{}; - $dir =~ s{/$}{}; - return if $dir =~ m/^obj-/; - push @{$tbbinfos->{tests}}, { - name => "xpcshell:$dir", - type => 'xpcshell', - descr => "xpcshell test in directory $dir", - dir => $dir, - }; - }; - find($wanted, $browserdir); -} - -sub find_mochitest_tests { - my ($tbbinfos) = @_; - my $browserdir = $tbbinfos->{gitrepo}->clone_dir; - my $wanted = sub { - return unless -f $File::Find::name; - my (undef, $dir, $file) = File::Spec->splitpath($File::Find::name); - return unless $file eq 'Makefile.in'; - $dir =~ s{^$browserdir/}{}; - $dir =~ s{/$}{}; - return if $dir =~ m/^obj-/; - my @makefile = read_file $File::Find::name; - my @types; - push @types, 'plain' if grep { m/MOCHITEST_FILES/ } @makefile; - push @types, 'chrome' if grep { m/MOCHITEST_CHROME_FILES/ } @makefile; - push @types, 'browser' if grep { m/MOCHITEST_BROWSER_FILES/ } @makefile; - push @types, 'a11y' if grep { m/MOCHITEST_A11Y_FILES/ } @makefile; - foreach my $type (@types) { - push @{$tbbinfos->{tests}}, { - name => "mochitest-$type:$dir", - type => "mochitest_$type", - descr => "$type mochitest in directory $dir", - dir => $dir, - }; - } - }; - find($wanted, $browserdir); -} - -sub xpcshell_test { - my ($tbbinfos, $test) = @_; - my $xunit_file = "$tbbinfos->{topobjdir}/.mozbuild/xpchsell.xunit.xml"; - unlink $xunit_file if -f $xunit_file; - my @xvfb = $options->{xvfb} ? - ('xvfb-run', '--server-args=-screen 0 1024x768x24') : (); - my ($out, $err, $success) = - capture_exec(@xvfb, './mach', 'xpcshell-test', $test->{dir}); - return unless -f $xunit_file; - $test->{results}{out} = $out; - $test->{results}{failed} = {}; - my $root = eval { - -f $xunit_file - && XML::LibXML->load_xml(location => $xunit_file) - ->documentElement(); - }; - if (!$root) { - $test->{results}{success} = 0; - return; - } - $test->{results}{success} = ($root->getAttribute('failures') // 0)== 0; - foreach my $testcase (@{$root->getChildrenByLocalName('testcase')}) { - if ($testcase->getChildrenByLocalName('failure')) { - $test->{results}{failed}{$testcase->getAttribute('name')} = - ($testcase->getChildrenByLocalName('failure'))[0] - ->textContent; - } - } -} - -sub mochitest_test { - my ($mach_command, $tbbinfos, $test) = @_; - my $failures_file = "$tbbinfos->{topobjdir}/.mozbuild/mochitest_failures.json"; - unlink $failures_file if -f $failures_file; - my @xvfb = $options->{xvfb} ? - ('xvfb-run', '--server-args=-screen 0 1024x768x24') : (); - my ($out, $err, $success) = - capture_exec(@xvfb, './mach', $mach_command, $test->{dir}); - return unless -f $failures_file; - $test->{results}{out} = $out; - my $failed = eval { -f $failures_file - && decode_json(scalar read_file($failures_file)) }; - $test->{results}{failed} = $failed ? [ keys %$failed ] : []; - $test->{results}{success} = $failed && ! @{$test->{results}{failed}}; -} - -sub mochitest_error_logs { - my ($test) = @_; - return unless $test->{type} =~ m/^mochitest_/; - return unless exists $test->{results}; - return unless $test->{results}{out}; - return if exists $test->{results}{error_logs}; - my @logs = split /^/, $test->{results}{out}; - @logs = grep { m/^\s*[^\s]+\s[^\s]+\sERROR/ } @logs; - $test->{results}{error_logs} = join '', @logs; -} - -sub build_firefox { - my ($tbbinfos, $test) = @_; - my $nbcpu = get_nbcpu; - $test->{results}{success} = 0; - copy("$FindBin::Bin/data/mozconfig", '.mozconfig'); - my @l = read_file('.mozconfig'); - foreach (@l) { - s/MOZ_MAKE_FLAGS="-j4"/MOZ_MAKE_FLAGS="-j$nbcpu"/; - } - write_file('.mozconfig', @l); - run_to_file("$tbbinfos->{'results-dir'}/$test->{name}.configure.txt", - 'make', '-f', 'client.mk', 'configure') or return; - run_to_file("$tbbinfos->{'results-dir'}/$test->{name}.build.txt", - 'make', "-j$nbcpu", '-f', 'client.mk', 'build') or return; - $test->{results}{success} = 1; -} - -1; ===================================== TBBTestSuite/TestSuites.pm ===================================== @@ -4,14 +4,13 @@ use strict; use TBBTestSuite::TestSuite::TestTestSuite; use TBBTestSuite::TestSuite::BrowserBundleTests; -use TBBTestSuite::TestSuite::BrowserUnitTests; use TBBTestSuite::TestSuite::RBMBuild; use TBBTestSuite::TestSuite::TorBrowserBuild; use TBBTestSuite::TestSuite::TorBrowserBuildGitlabPipelines; use TBBTestSuite::TestSuite::BrowserBundleHardening; my @testsuite_list = qw(TestTestSuite BrowserBundleTests - BrowserUnitTests RBMBuild TorBrowserBuild + RBMBuild TorBrowserBuild TorBrowserBuildGitlabPipelines BrowserBundleHardening); my %testsuite_types; sub testsuite_types { ===================================== TBBTestSuite/Tests.pm ===================================== @@ -15,7 +15,6 @@ use TBBTestSuite::Common qw(exit_error); use TBBTestSuite::Options qw($options); use TBBTestSuite::TestSuites; use TBBTestSuite::TestSuite::BrowserBundleTests; -use TBBTestSuite::TestSuite::BrowserUnitTests; use TBBTestSuite::XServer qw(set_Xmode); our (@ISA, @EXPORT_OK); ===================================== config/browser-unit deleted ===================================== @@ -1,50 +0,0 @@ -# vim: filetype=perl expandtab - -use strict; -use FindBin; -use TBBTestSuite::Common; -use TBBTestSuite::TestSuite::BrowserUnitTests; -use TBBTestSuite::BrowserGit qw(git_clone_fetch get_commits_by_branch - parent_commit); - -my $torbrowser_branch = 'tor-browser-31.2.0esr-4.x-1'; -my $esr_branch = 'esr31'; -my $testsuite_version = '2'; - -sub commit_to_name { - my ($commit) = @_; - $commit = substr $commit, 0, 20; - return ("browser-$testsuite_version-$commit", "browser-$commit"); -} - -git_clone_fetch; - -my @commits = get_commits_by_branch($torbrowser_branch, $esr_branch); - -my %res = ( - args => [], - 'reports-url' => 'http://tbb-test-reports.mars-attacks.org/reports/', - tags => [ "$torbrowser_branch-build2" ], - 'disable-tests' => [ - 'mochitest-chrome:toolkit/content/tests/chrome', - 'mochitest-chrome:toolkit/content/tests/widgets', - 'mochitest-chrome:toolkit/identity/tests/chrome', - ], -); -my $previous; -for my $commit (reverse @commits) { - my ($name, $fname) = commit_to_name($commit); - if (-d "$options->{'reports-dir'}/r/$name") { - $previous = [ $name, $fname ]; - next; - } - $res{name} = $name; - my $tbbinfos = TBBTestSuite::TestSuite::BrowserUnitTests->new({ - commit => substr($commit, 0, 20), - $previous ? (parent_results => $previous) : (), - }); - $res{args} = [ $tbbinfos ], - return %res; -} - -%res; ===================================== install-deps ===================================== @@ -36,7 +36,7 @@ perlmodules=' Cwd Data::Dump Digest::SHA File::Path File::Slurp File::Spec File::Temp FindBin Getopt::Long IO::CaptureOutput IO::Socket::INET Image::Magick JSON LWP::UserAgent LWP::Protocol::https Template YAML::Syck DateTime -Email::Simple Email::Sender File::Type IPC::Run XML::LibXML Storable +Email::Simple Email::Sender File::Type IPC::Run Storable ' if [ -f /etc/debian_version ] @@ -58,7 +58,7 @@ then libwww-perl liblwp-protocol-https-perl libtemplate-perl \ libyaml-syck-perl libdatetime-perl \ libemail-sender-perl libemail-simple-perl libfile-type-perl \ - libipc-run-perl libxml-libxml-perl + libipc-run-perl apt-get install -y nmap curl fi ===================================== tmpl/details_build_firefox.html deleted ===================================== @@ -1,4 +0,0 @@ -<ul> - <li><a href="results-[% tbbfile %]/[% test.name %].configure.txt">configure logs</a></li> - <li><a href="results-[% tbbfile %]/[% test.name %].build.txt">build logs</a></li> -</ul> ===================================== tmpl/details_mochitest.html deleted ===================================== @@ -1,12 +0,0 @@ -[% IF ! from_index %] -[% IF test.results.failed.size %] -Failed tests: -<ul> -[% FOREACH f IN test.results.failed %] -<li>[% f %]</li> -[% END %] -</ul> -[% END %] -[% IF test.results.error_logs %]<a href="javascript:togglecontent('logs_[% test.name %]');">mochitest error logs</a>[% END %] -[% END %] -<pre [% IF ! from_index %]id="logs_[% report_name %][% test.name %]" style="display:none"[% END %]>[% FILTER html_entity %][% test.results.error_logs %][% END %]</pre> ===================================== tmpl/details_mochitest_a11y.html deleted ===================================== @@ -1 +0,0 @@ -details_mochitest.html \ No newline at end of file ===================================== tmpl/details_mochitest_browser.html deleted ===================================== @@ -1 +0,0 @@ -details_mochitest.html \ No newline at end of file ===================================== tmpl/details_mochitest_chrome.html deleted ===================================== @@ -1 +0,0 @@ -details_mochitest.html \ No newline at end of file ===================================== tmpl/details_mochitest_plain.html deleted ===================================== @@ -1 +0,0 @@ -details_mochitest.html \ No newline at end of file ===================================== tmpl/details_xpcshell.html deleted ===================================== @@ -1,14 +0,0 @@ -[% IF ! from_index %] -[% IF test.results.failed.keys.size %] -Failed tests: -<ul> -[% FOREACH f IN test.results.failed.keys %] -<li><a href="javascript:togglecontent('logs_[% test.name %]_[% f %]');">[% f %]</a> -<pre id="logs_[% test.name %]_[% f %]" style="display:none">[% test.results.failed.$f %]</pre> -</li> -[% END %] -</ul> -[% END %] -<a href="javascript:togglecontent('logs_[% test.name %]');">xpcshell logs</a> -[% END %] -<pre [% IF ! from_index %]id="logs_[% report_name %][% test.name %]" style="display:none"[% END %]>[% FILTER html_entity %][% test.results.out %][% END %]</pre> ===================================== tmpl/report.html ===================================== @@ -18,123 +18,13 @@ [% INCLUDE togglecontent.js %] </head> <body> - [% IF tbbfiles.$tbbfile.type == 'browserunit' %] - <h1>Browser infos</h1> - [% ELSIF tbbfiles.$tbbfile.type == 'browserbundle' %] + [% IF tbbfiles.$tbbfile.type == 'browserbundle' %] <h1>Bundle infos</h1> [% END %] <ul> - [% IF tbbfiles.$tbbfile.type == 'browserunit' %] - <li><b>Commit:</b> <a href="https://gitweb.torproject.org/tor-browser.git/commit/[% tbbfiles.$tbbfile.commit %]">[% tbbfiles.$tbbfile.commit %]</a></li> - <li><b>Commit subject:</b> [% tbbfiles.$tbbfile.commit_subject %]</li> - [% ELSIF tbbfiles.$tbbfile.type == 'browserbundle' %] - <li><b>Filename:</b> [% tbbfiles.$tbbfile.filename %]</li> - <li><b>Version:</b> [% tbbfiles.$tbbfile.version %]</li> - <li><b>Language:</b> [% tbbfiles.$tbbfile.language %]</li> - <li><b>OS:</b> [% tbbfiles.$tbbfile.os %]</li> - <li><b>Architecture:</b> [% tbbfiles.$tbbfile.arch %]</li> - <li><b>sha256sum:</b> [% tbbfiles.$tbbfile.sha256sum %]</li> - [% END %] <li><b>Total run time:</b> [% tbbfiles.$tbbfile.run_time %] seconds</li> </ul> - [% IF tbbfiles.$tbbfile.type == 'browserunit' && tbbfiles.$tbbfile.parent_diff %] - [% SET diff = tbbfiles.$tbbfile.parent_diff %] - <h1>Diff with previous results</h1> - <ul> - [% SET parent_results = tbbfiles.$tbbfile.parent_results %] - <li>Previous results: <a href="../[% parent_results.0 %]/[% parent_results.1 %].html">[% parent_results.0 %]</a></li> - <li><a href="javascript:togglecontent('run_time_diff')"><b>Total run time diff:</b> [% diff.run_time %]</a> - <div id="run_time_diff" style="display:none"> - <ul> - [% FOREACH t IN diff.tests_time.nsort.reverse %] - <li>[% t %]: [% diff.tests_time.$t %]</li> - [% END %] - </ul> - </div> - </li> - - [% IF ! diff.fail_tests.size %] - <li>No new failing tests</li> - [% ELSE %] - <li><a href="javascript:togglecontent('fail_tests_diff')"><b>[% diff.fail_tests.size %] new failing tests</b></a> - <div id="fail_tests_diff" style="display:none"> - <ul> - [% FOREACH t IN diff.fail_tests.sort %] - <li>[% t %]</li> - [% END %] - </ul> - </div> - </li> - [% END %] - - [% - SET nb_js_fail = 0; - SET nb_js_fixed = 0; - FOREACH t IN diff.subtests.keys; - SET nb_js_fail = nb_js_fail + diff.subtests.$t.fail.size; - SET nb_js_fixed = nb_js_fixed + diff.subtests.$t.fixed.size; - END - %] - - [% IF nb_js_fail %] - <li><a href="javascript:togglecontent('fail_js_diff')"><b>[% nb_js_fail %] new js files failing</b></a> - <div id="fail_js_diff" style="display:none"> - <ul> - [% FOREACH t IN diff.subtests.keys %] - [% IF ! diff.subtests.$t.fail.size; NEXT; END %] - <li>[% t %]: - <ul> - [% FOREACH js IN diff.subtests.$t.fail %] - <li>[% js %]</li> - [% END %] - </ul> - </li> - [% END %] - </ul> - </div> - </li> - [% ELSE %] - <li>No new js files failing</li> - [% END %] - - [% IF ! diff.fixed_tests.size %] - <li>No fixed tests</li> - [% ELSE %] - <li><a href="javascript:togglecontent('fixed_tests_diff')"><b>[% diff.fixed_tests.size %] fixed tests</b></a> - <div id="fixed_tests_diff" style="display:none"> - <ul> - [% FOREACH t IN diff.fixed_tests.sort %] - <li>[% t %]</li> - [% END %] - </ul> - </div> - </li> - [% END %] - - [% IF nb_js_fixed %] - <li><a href="javascript:togglecontent('fixed_js_diff')"><b>[% nb_js_fixed %] new js files fixed</b></a> - <div id="fixed_js_diff" style="display:none"> - <ul> - [% FOREACH t IN diff.subtests.keys %] - [% IF ! diff.subtests.$t.fixed.size; NEXT; END %] - <li>[% t %]: - <ul> - [% FOREACH js IN diff.subtests.$t.fixed %] - <li>[% js %]</li> - [% END %] - </ul> - </li> - [% END %] - </ul> - </div> - </li> - [% ELSE %] - <li>No js files fixed</li> - [% END %] - </ul> - [% END %] - <h1>Results</h1> [% IF tbbfiles.$tbbfile.pre_tests_error %] <h2>pre_tests error</h2> ===================================== tmpl/report_browserunit.txt deleted ===================================== @@ -1,11 +0,0 @@ -[% IF tbbfiles.$tbbfile.pre_tests_error -%] - pre_tests error: -[% FILTER indent(' ') -%] -[% tbbfiles.$tbbfile.pre_tests_error %] -[% END %] -[% END -%] -[% FOREACH test IN tbbfiles.$tbbfile.tests -%] -[% IF test.results -%] -[% test.name %]: [% test.results.success ? 'ok' : 'failed (' _ test.fail_type _ ')' %] -[% END -%] -[% END %] ===================================== tmpl/reports_index_browserunit.html deleted ===================================== @@ -1,118 +0,0 @@ -[% USE date -%] -<html> - <head> - <title>Tests reports</title> - <style type="text/css"> - .test_ok { - color: #006600; - font-weight: bold; - } - .test_ok A { - color: #006600; - font-weight: bold; - } - .test_notok { - color: #FF0000; - font-weight: bold; - } - .test_notok A { - color: #FF0000; - } - .reportdate { - font-size: small; - } - </style> - [% INCLUDE togglecontent.js %] - </head> - <body> - <h1>Tor Browser Unit Test Reports: [% title %]</h1> - [% FOREACH report IN reports_list %] - [% - SET tbbfiles = reports.$report.tbbfiles; - SET tbbfile = reports.$report.tbbfiles.keys.0; - SET diff = tbbfiles.$tbbfile.parent_diff; - %] - <ul> - <li><b>Commit:</b> <a href="https://gitweb.torproject.org/tor-browser.git/commit/[% tbbfiles.$tbbfile.commit %]">[% tbbfiles.$tbbfile.commit %]</a></li> - <li><b>Subject:</b> [% tbbfiles.$tbbfile.commit_subject %]</li> - <li><b>Run time:</b> [% tbbfiles.$tbbfile.run_time %] seconds (diff: [% diff.run_time %])</li> - - [% - SET nb_js_fail = 0; - SET nb_js_fixed = 0; - FOREACH t IN diff.subtests.keys; - SET nb_js_fail = nb_js_fail + diff.subtests.$t.fail.size; - SET nb_js_fixed = nb_js_fixed + diff.subtests.$t.fixed.size; - END - %] - - [% IF diff.fail_tests.size %] - <li><b>[% diff.fail_tests.size %] new failing tests</b> - <ul> - [% FOREACH t IN diff.fail_tests.sort %] - <li><a href="javascript:togglecontent('fail_test_[% report %]_[% t %]');">[% t %]</a> - <div id="fail_test_[% report %]_[% t %]" style="display:none"> - [% SET test = test_by_name(tbbfiles.$tbbfile.tests, t); %] - [% SET type = test.type; INCLUDE "details_${type}.html" from_index=1 %] - </div> - </li> - [% END %] - </ul> - </li> - [% END %] - - [% IF nb_js_fail %] - <li><b>[% nb_js_fail %] new js files failing</b> - <ul> - [% FOREACH t IN diff.subtests.keys %] - [% IF ! diff.subtests.$t.fail.size; NEXT; END %] - <li>[% t %]: - <ul> - [% FOREACH js IN diff.subtests.$t.fail %] - <li>[% js %]</li> - [% END %] - </ul> - <a href="javascript:togglecontent('js_fail_test_[% report %]_[% t %]');">logs</a> - <div id="js_fail_test_[% report %]_[% t %]" style="display:none"> - [% SET test = test_by_name(tbbfiles.$tbbfile.tests, t); %] - [% SET type = test.type; INCLUDE "details_${type}.html" from_index=1 %] - </div> - </li> - [% END %] - </ul> - </li> - [% END %] - - [% IF diff.fixed_tests.size %] - <li><b>[% diff.fixed_tests.size %] fixed tests</b> - <ul> - [% FOREACH t IN diff.fixed_tests.sort %] - <li>[% t %]</li> - [% END %] - </ul> - </li> - [% END %] - - [% IF nb_js_fixed %] - <li><b>[% nb_js_fixed %] new js files fixed</b> - <ul> - [% FOREACH t IN diff.subtests.keys %] - [% IF ! diff.subtests.$t.fixed.size; NEXT; END %] - <li>[% t %]: - <ul> - [% FOREACH js IN diff.subtests.$t.fixed %] - <li>[% js %]</li> - [% END %] - </ul> - </li> - [% END %] - </ul> - </li> - [% END %] - - <li><a href="r/[% report %]/[% tbbfile %].html">Details</a></li> - </ul> - <hr /> - [% END %] - </body> -</html> View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-bundle-testsuite/... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-bundle-testsuite/... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help