Browse Source

Add configurable mocha timeout

Adding an environment variable, MOCHA_TIMEOUT that can be set for slower CI platforms
John Kleinschmidt 7 years ago
parent
commit
99ae56b782
2 changed files with 6 additions and 1 deletions
  1. 1 0
      Jenkinsfile.arm64
  2. 5 1
      spec/static/index.html

+ 1 - 0
Jenkinsfile.arm64

@@ -8,6 +8,7 @@ pipeline {
   environment {
     TARGET_ARCH='arm64'
     DISPLAY=':99.0'
+    MOCHA_TIMEOUT='60000'
   }
   stages {
     stage('Bootstrap') {

+ 5 - 1
spec/static/index.html

@@ -51,7 +51,11 @@
   if (!process.env.MOCHA_REPORTER) {
     mocha.ui('bdd').reporter(isCi ? 'tap' : 'html')
   }
-  mocha.timeout(isCi ? 30000 : 10000)
+  if (process.env.MOCHA_TIMEOUT && process.env.MOCHA_TIMEOUT > 0) {
+    mocha.timeout(process.env.MOCHA_TIMEOUT)
+  } else {
+    mocha.timeout(isCi ? 30000 : 10000)
+  }
 
   const query = Mocha.utils.parseQuery(window.location.search || '')
   if (query.grep) mocha.grep(query.grep)