[tor-commits] [tor-browser/tor-browser-45.2.0esr-6.5-1] Bug 18923: Add a script to run all Tor Browser specific tests

gk at torproject.org gk at torproject.org
Thu Jul 14 15:34:13 UTC 2016


commit 1198d77c4ef82db7878e04920523b13ab0e678e6
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Thu Jul 14 17:09:12 2016 +0200

    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(+)

diff --git a/run-tbb-tests b/run-tbb-tests
new file mode 100755
index 0000000..5e266f9
--- /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 0000000..00978df
--- /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



More information about the tor-commits mailing list