From c0ff4322a01e8f4f70ce5f03a6fc7048ecfa805f Mon Sep 17 00:00:00 2001 From: Nicolas Vigier Date: Thu, 14 Jul 2016 17:09:12 +0200 Subject: [PATCH] Bug 18923: Add a script to run all Tor Browser specific tests --- run-tbb-tests | 60 ++++++++++++++++++++++++++++++++++++++++++++ tbb-tests-ignore.txt | 4 +++ 2 files changed, 64 insertions(+) create mode 100755 run-tbb-tests create mode 100644 tbb-tests-ignore.txt diff --git a/run-tbb-tests b/run-tbb-tests new file mode 100755 index 0000000000000..5e266f9ba4cdd --- /dev/null +++ b/run-tbb-tests @@ -0,0 +1,60 @@ +#!/bin/bash + +# This script runs all the Mochitest tests that have been added or +# modified since the last ffxbld commit. +# +# It does not currently run XPCShell tests. We should change this if we +# start using this type or other types of tests. +# +# The logs of the tests are stored in the tbb-tests.log file. +# Ignored tests are listed in the tbb-tests-ignore.txt file. +# +# https://trac.torproject.org/projects/tor/ticket/18923 + +IFS=$'\n' + +if [ -n "$USE_TESTS_LIST" ] && [ -f tbb-tests-list.txt ] +then + echo "Using tests list from file tbb-tests-list.txt" + tests=($(cat tbb-tests-list.txt)) +else + ffxbld_commit=$(git log -500 --format='%an %H' | grep '^ffxbld ' \ + | head -1 | cut -d ' ' -f 2) + + tests=($(git diff --name-status "$ffxbld_commit" HEAD | \ + grep -e '^[AM].*/test_[^/]\+\.\(html\|xul\)$' \ + -e '^[AM].*/browser_[^/]\+\.js$' \ + | sed 's/^[AM]\s\+//')) +fi + +echo 'The following tests will be run:' +for i in "${!tests[@]}" +do + if [ -z "$USE_TESTS_LIST" ] \ + && grep -q "^${tests[$i]}$" tbb-tests-ignore.txt + then + unset "tests[$i]" + continue + fi + echo "- ${tests[$i]}" +done + +if [ -n "$WRITE_TESTS_LIST" ] +then + rm -f tbb-tests-list.txt + for i in "${!tests[@]}" + do + echo "${tests[$i]}" >> tbb-tests-list.txt + done + exit 0 +fi + +rm -f tbb-tests.log +echo $'\n''Starting tests' +./mach mochitest --log-tbpl tbb-tests.log --setpref security.nocertdb=false \ + "${tests[@]}" + +echo "*************************" +echo "*************************" +echo "Summary of failed tests:" +grep --color=never TEST-UNEXPECTED-FAIL tbb-tests.log diff --git a/tbb-tests-ignore.txt b/tbb-tests-ignore.txt new file mode 100644 index 0000000000000..00978dfad9061 --- /dev/null +++ b/tbb-tests-ignore.txt @@ -0,0 +1,4 @@ +# This file contains the list of tests ignored by the run-tbb-tests script + +#19575: Test for privacy.thirdparty.isolate fails with a timeout +dom/tests/mochitest/localstorage/test_localStorageByFirstParty.html -- GitLab