mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Add support for test retries and enable three retries on CI
This commit is contained in:
parent
be1373dd3a
commit
d3509ae259
5 changed files with 15 additions and 4 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -101,7 +101,7 @@ jobs:
|
|||
dpl s3 --bucket zotero-download --local_dir build-zip --upload_dir ci/client --acl public_read
|
||||
|
||||
- name: Run tests
|
||||
run: xvfb-run test/runtests.sh -f
|
||||
run: xvfb-run test/runtests.sh -f -r 3
|
||||
|
||||
- name: Cache utilities Node modules
|
||||
id: utilities-node-cache
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ if (processTestOptions) {
|
|||
TestOptions.stopAt = cmdLine.handleFlagWithParam("stopAtTestFile", false);
|
||||
TestOptions.grep = cmdLine.handleFlagWithParam("grep", false);
|
||||
TestOptions.timeout = cmdLine.handleFlagWithParam("ZoteroTestTimeout", false);
|
||||
TestOptions.retries = cmdLine.handleFlagWithParam("retries", false) || 0;
|
||||
|
||||
Services.ww.openWindow(
|
||||
null,
|
||||
|
|
|
|||
|
|
@ -21,4 +21,5 @@ export var TestOptions = {
|
|||
stopAt: false,
|
||||
grep: false,
|
||||
timeout: false,
|
||||
retries: 0,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -115,6 +115,9 @@ function Reporter(runner) {
|
|||
if ('fast' != test.speed) {
|
||||
msg += " ("+Math.round(test.duration)+" ms)";
|
||||
}
|
||||
if (test._currentRetry > 0) {
|
||||
msg += " (passed on retry " + test._currentRetry + ")";
|
||||
}
|
||||
dump(msg+"\n");
|
||||
});
|
||||
|
||||
|
|
@ -163,7 +166,8 @@ mocha.setup({
|
|||
ui: "bdd",
|
||||
reporter: Reporter,
|
||||
timeout: TestOptions.timeout || 10000,
|
||||
grep: TestOptions.grep
|
||||
grep: TestOptions.grep,
|
||||
retries: TestOptions.retries || 0,
|
||||
});
|
||||
|
||||
coMocha(Mocha);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ Options
|
|||
-f stop after first test failure
|
||||
-g only run tests matching the given pattern (grep)
|
||||
-h display this help
|
||||
-r RETRIES retry failed tests the given number of times (default: 0)
|
||||
-s TEST start at the given test
|
||||
-t generate test data and quit
|
||||
-x EXECUTABLE path to Zotero executable (default: $Z_EXECUTABLE)
|
||||
|
|
@ -56,7 +57,8 @@ DONE
|
|||
|
||||
DEBUG=false
|
||||
DEBUG_LEVEL=5
|
||||
while getopts "bcd:e:fg:hs:tx:" opt; do
|
||||
RETRIES=0
|
||||
while getopts "bcd:e:fg:hr:s:tx:" opt; do
|
||||
case $opt in
|
||||
b)
|
||||
Z_ARGS="$Z_ARGS -ZoteroSkipBundledFiles"
|
||||
|
|
@ -83,6 +85,9 @@ while getopts "bcd:e:fg:hs:tx:" opt; do
|
|||
h)
|
||||
usage
|
||||
;;
|
||||
r)
|
||||
RETRIES="$OPTARG"
|
||||
;;
|
||||
s)
|
||||
if [[ -z "$OPTARG" ]] || [[ ${OPTARG:0:1} = "-" ]]; then
|
||||
usage
|
||||
|
|
@ -176,7 +181,7 @@ ZOTERO_TEST=1 "$ROOT_DIR/app/scripts/dir_build" -q
|
|||
|
||||
makePath FX_PROFILE "$PROFILE"
|
||||
MOZ_NO_REMOTE=1 NO_EM_RESTART=1 "$Z_EXECUTABLE" -profile "$FX_PROFILE" \
|
||||
-test "$TESTS" -grep "$GREP" -ZoteroTest $Z_ARGS
|
||||
-test "$TESTS" -grep "$GREP" -retries "$RETRIES" -ZoteroTest $Z_ARGS
|
||||
|
||||
# Check for success
|
||||
test -e "$PROFILE/success"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue