Test fixes

This commit is contained in:
Martin Stransky 2020-12-01 11:17:26 +01:00
parent 02791b1506
commit 42bfda0485
5 changed files with 114 additions and 17 deletions

View File

@ -127,7 +127,7 @@ ExcludeArch: aarch64
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 83.0
Release: 11%{?pre_tag}%{?dist}
Release: 12%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
@ -152,8 +152,10 @@ Source32: node-stdout-nonblocking-wrapper
Source33: firefox.appdata.xml.in
Source34: firefox-search-provider.ini
Source35: google-loc-api-key
Source36: firefox-testing.tar.gz
Source37: site-packages.tar.gz
Source38: print_results
Source39: print_subtest
Source40: run-tests
# Build patches
Patch3: mozilla-build-arm.patch
@ -362,9 +364,7 @@ Summary: Results of testsuite
%description -n %{testsuite_pkg_name}
This package contains results of tests executed during build.
%files -n %{testsuite_pkg_name}
/%{version}%-%{release}/test_general
/%{version}%-%{release}/test_basic
/%{version}%-%{release}/test_wr
/%{version}%-%{release}/test_results
/%{version}%-%{release}/test_summary.txt
%endif
@ -707,13 +707,10 @@ make -C objdir buildsymbols
%endif
%if 0%{?run_firefox_tests}
tar xf %{SOURCE36}
cat > objdir/_virtualenvs/init_py3/pip.conf << EOF
[install]
find-links=`pwd`/mochitest-python
EOF
tar xf %{SOURCE37} -C "objdir/_virtualenvs/init_py3/lib64/python3.9"
cp {SOURCE40} {SOURCE38} {SOURCE39} .
./run-tests
./print_results > test_summary.txt 2>&1
%endif
#---------------------------------------------------------------------
@ -858,12 +855,8 @@ sed -i -e "s/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/" %{buildroot}/%{moz
%endif
%if 0%{?run_firefox_tests}
%{__mkdir_p} %{buildroot}/%{version}%-%{release}/test_general
%{__mkdir_p} %{buildroot}/%{version}%-%{release}/test_basic
%{__mkdir_p} %{buildroot}/%{version}%-%{release}/test_wr
%{__cp} test_general/* %{buildroot}/%{version}%-%{release}/test_general
%{__cp} test_basic/* %{buildroot}/%{version}%-%{release}/test_basic
%{__cp} test_wr/* %{buildroot}/%{version}%-%{release}/test_wr
%{__mkdir_p} %{buildroot}/%{version}%-%{release}/test_results
%{__cp} test_results/* %{buildroot}/%{version}%-%{release}/test_results
%{__cp} test_summary.txt %{buildroot}/%{version}%-%{release}/
%endif
@ -1000,6 +993,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#---------------------------------------------------------------------
%changelog
* Tue Dec 1 2020 Martin Stransky <stransky@redhat.com> - 83.0-12
- More mochitest fixes
* Mon Nov 30 2020 Martin Stransky <stransky@redhat.com> - 83.0-11
- Mochitest tweaking

20
print_results Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/bash
# Analyze and print general test results
export TEST_DIR="test_results"
echo "Test results"
echo "SW"
./print_subtest "test_results" ""
echo "WR"
./print_subtest "test_results" "-wr"
echo "General"
UNPASS=`grep "cppunittests INFO | Passed:" $TEST_DIR/cppunittest | cut -d ' ' -f 5`
UNFAIL=`grep "cppunittests INFO | Failed:" $TEST_DIR/cppunittest | cut -d ' ' -f 5`
echo "CPP UNIT: PASSED: $UNPASS FAILED: $UNFAIL"
JSPASS=`grep "TEST-PASS" $TEST_DIR/jsapi | wc -l`
echo "JSAPI: PASSED: $JSPASS"
echo "JStests: "`tail -n 1 $TEST_DIR/jstests`

37
print_subtest Executable file
View File

@ -0,0 +1,37 @@
#!/usr/bin/bash
# Analyze and print specialized (basic/webrender) test results
TEST_DIR=$1
TEST_FLAVOUR=$2
MPASS=`grep "TEST_END: Test OK" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l`
MERR=`grep "TEST_END: Test ERROR" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l`
MUNEX=`grep "TEST-UNEXPECTED-FAIL" $TEST_DIR/mochitest$TEST_FLAVOUR | wc -l`
echo "Mochitest PASSED: $MPASS FAILED: $MERR UNEXPECTED-FAILURES: $MUNEX"
JSPASS=`grep --text "REFTEST INFO | Successful:" $TEST_DIR/jstestbrowser$TEST_FLAVOUR | cut -d ' ' -f 5`
JSFAILS=`grep --text "REFTEST INFO | Unexpected:" $TEST_DIR/jstestbrowser$TEST_FLAVOUR | cut -d ' ' -f 5`
JSKNOWN=`grep --text "REFTEST INFO | Known problems:" $TEST_DIR/jstestbrowser$TEST_FLAVOUR | cut -d ' ' -f 6`
echo "JSBrowser PASSED: $JSPASS FAILED: $JSFAILS Known issues: $JSKNOWN"
MARPASS=`grep --text "Expected results:" $TEST_DIR/marionette$TEST_FLAVOUR | cut -d ' ' -f 3`
MARSKIP=`grep --text "Skipped:" $TEST_DIR/marionette$TEST_FLAVOUR | cut -d ' ' -f 2`
MARFAILED=`grep --text "Unexpected results:" $TEST_DIR/marionette$TEST_FLAVOUR | cut -d ' ' -f 3`
echo "Marionette: PASSED: $MARPASS FAILED: $MARSKIP Known issues: $MARFAILED"
XPCPASS=`grep --text "INFO INFO | Passed:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 6`
XPCFAIL=`grep --text "INFO INFO | Failed:" $TEST_DIR/xpcshell$TEST_FLAVOUR | cut -d ' ' -f 6`
echo "XPCShell: PASSED: $XPCPASS FAILED: $XPCFAIL"
CRPASS=`grep "REFTEST INFO | Successful:" $TEST_DIR/crashtest$TEST_FLAVOUR | cut -d ' ' -f 5`
CRFAIL=`grep "^REFTEST INFO | Unexpected:" $TEST_DIR/crashtest$TEST_FLAVOUR | cut -d ' ' -f 5`
echo "Crashtest: PASSED: $CRPASS FAILED: $CRFAIL"
RFPASS=`grep --text "REFTEST INFO | Successful:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 5`
RFUN=`grep --text "^REFTEST INFO | Unexpected:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 5`
RFKNOWN=`grep --text "REFTEST INFO | Known problems:" $TEST_DIR/reftest$TEST_FLAVOUR | cut -d ' ' -f 6`
echo "Reftest: PASSED: $RFPASS FAILED: $RFUN Known issues: $RFKNOWN"
GPASS=`grep "\[ PASSED \]" $TEST_DIR/gtest$TEST_FLAVOUR | cut -d ' ' -f 7`
GFAIL=`grep "FAILED TESTS" $TEST_DIR/gtest$TEST_FLAVOUR | cut -d ' ' -f 2`
echo "GTest: PASSED: "$GPASS" FAILED: "$GFAIL

45
run-tests Executable file
View File

@ -0,0 +1,45 @@
#!/usr/bin/bash
set -x
export MACH_USE_SYSTEM_PYTHON=1
export MOZ_NODE_PATH=/usr/bin/node
export X_PARAMS="-screen 0 1600x1200x24"
export MOCHITEST_PARAMS="--timeout 10 --chunk-by-dir 4"
export TEST_DIR="test_results"
# Fix for system nss
ln -s /usr/bin/certutil objdir/dist/bin/certutil
ln -s /usr/bin/pk12util objdir/dist/bin/pk12util
NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"
# Basic render testing
export TEST_PARAMS=""
export TEST_FLAVOUR=""
xvfb-run -s "$X_PARAMS" ./mach mochitest $MOCHITEST_PARAMS $TEST_PARAMS >& $TEST_DIR/mochitest$TEST_FLAVOUR
xvfb-run -s "$X_PARAMS" ./mach jstestbrowser $TEST_PARAMS >& $TEST_DIR/jstestbrowser$TEST_FLAVOUR
xvfb-run -s "$X_PARAMS" ./mach crashtest $TEST_PARAMS --run-tests-in-parallel >& $TEST_DIR/crashtest$TEST_FLAVOUR
xvfb-run -s "$X_PARAMS" ./mach marionette-test $TEST_PARAMS >& $TEST_DIR/marionette$TEST_FLAVOUR
xvfb-run -s "$X_PARAMS" ./mach reftest $TEST_PARAMS --run-tests-in-parallel >& $TEST_DIR/reftest$TEST_FLAVOUR
./mach xpcshell-test $TEST_PARAMS 2>&1 | cat - > $TEST_DIR/xpcshell$TEST_FLAVOUR
./mach gtest -j $NCPUS $TEST_PARAMS >& $TEST_DIR/gtest$TEST_FLAVOUR
# WebRender testing
export TEST_PARAMS="--enable-webrender $TEST_PARAMS"
export TEST_FLAVOUR="-wr"
xvfb-run -s "$X_PARAMS" ./mach mochitest $MOCHITEST_PARAMS $TEST_PARAMS >& $TEST_DIR/mochitest$TEST_FLAVOUR
xvfb-run -s "$X_PARAMS" ./mach jstestbrowser $TEST_PARAMS >& $TEST_DIR/jstestbrowser$TEST_FLAVOUR
xvfb-run -s "$X_PARAMS" ./mach crashtest $TEST_PARAMS --run-tests-in-parallel >& $TEST_DIR/crashtest$TEST_FLAVOUR
xvfb-run -s "$X_PARAMS" ./mach marionette-test $TEST_PARAMS >& $TEST_DIR/marionette$TEST_FLAVOUR
xvfb-run -s "$X_PARAMS" ./mach reftest $TEST_PARAMS --run-tests-in-parallel >& $TEST_DIR/reftest$TEST_FLAVOUR
./mach xpcshell-test $TEST_PARAMS 2>&1 | cat - > $TEST_DIR/xpcshell$TEST_FLAVOUR
./mach gtest -j $NCPUS $TEST_PARAMS >& $TEST_DIR/gtest$TEST_FLAVOUR
# Rest
export TEST_DIR="test"
objdir/dist/bin/jsapi-tests >& $TEST_DIR/jsapi
./mach cppunittest >& $TEST_DIR/cppunittest
./mach jstests >& $TEST_DIR/jstests
rm -f objdir/dist/bin/certutil
rm -f objdir/dist/bin/pk12util

View File

@ -2,4 +2,3 @@ SHA512 (cbindgen-vendor.tar.xz) = 3c925c5523246b7dfbcb4ce563483d5b45315a06dc90f2
SHA512 (firefox-83.0.source.tar.xz) = 4ac49cefed278d1f898907bbedacf81ea4bb4e5784f567d4c0971d9cbc2cf4a2e4472de81a7ded620bc3a516bc972d600b516b7674319cdfc9734c3824a9a2f6
SHA512 (firefox-langpacks-83.0-20201116.tar.xz) = 0d26660a7f09481e82d8d88ac43917001301d422a94dc48d3913dff92805f100221ca6db15fea05e895221efe5a9d74c07780a671aebc26a69d7a588e1cd423d
SHA512 (site-packages.tar.gz) = cdeeb986a0fae736b5e1d6effce1decbb1d5365ea370ca7d88ae379b9a6bd41190f183a6aa934ef287272106f4a323eb8ea75bf9aae6388b7908047875882b85
SHA512 (firefox-testing.tar.gz) = 6c01a09356828e1d86bd700472e14bb62dd956336201f9bbc12bd20fed3aca2d5edaeebbd94dc8e31ec16a44172e1de081a8b25aeefe2a71b41a0173535c0e7d