Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
ee382915
Commit
ee382915
authored
6 years ago
by
Johann-S
Browse files
Options
Download
Email Patches
Plain Diff
detect test exceeded maximum duration on Sauce Labs
parent
1470e11a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/saucelabs-unit-test.js
+9
-4
build/saucelabs-unit-test.js
with
9 additions
and
4 deletions
+9
-4
build/saucelabs-unit-test.js
+
9
-
4
View file @
ee382915
...
@@ -25,6 +25,10 @@ const jsUnitSaucelabs = new JSUnitSaucelabs({
...
@@ -25,6 +25,10 @@ const jsUnitSaucelabs = new JSUnitSaucelabs({
const
testURL
=
'
http://localhost:3000/js/tests/index.html?hidepassed
'
const
testURL
=
'
http://localhost:3000/js/tests/index.html?hidepassed
'
const
browsersFile
=
require
(
path
.
resolve
(
__dirname
,
'
./sauce_browsers.json
'
))
const
browsersFile
=
require
(
path
.
resolve
(
__dirname
,
'
./sauce_browsers.json
'
))
const
errorMessages
=
[
'
Test exceeded maximum duration
'
,
'
Test exceeded maximum duration after 180 seconds
'
]
let
jobsDone
=
0
let
jobsDone
=
0
let
jobsSucceeded
=
0
let
jobsSucceeded
=
0
...
@@ -43,11 +47,12 @@ const waitingCallback = (error, body, id) => {
...
@@ -43,11 +47,12 @@ const waitingCallback = (error, body, id) => {
},
2000
)
},
2000
)
}
else
{
}
else
{
const
test
=
body
[
'
js tests
'
][
0
]
const
test
=
body
[
'
js tests
'
][
0
]
const
platform
=
test
.
platform
.
join
(
'
,
'
)
let
passed
=
false
let
passed
=
false
let
errorStr
=
false
let
errorStr
=
false
if
(
test
.
result
!==
null
)
{
if
(
test
.
result
!==
null
)
{
if
(
typeof
test
.
result
===
'
string
'
&&
test
.
result
===
'
Test exceeded maximum duration
'
)
{
if
(
typeof
test
.
result
===
'
string
'
&&
errorMessages
.
includes
(
test
.
result
)
)
{
errorStr
=
test
.
result
errorStr
=
test
.
result
}
else
{
}
else
{
passed
=
test
.
result
.
total
===
test
.
result
.
passed
passed
=
test
.
result
.
total
===
test
.
result
.
passed
...
@@ -55,12 +60,12 @@ const waitingCallback = (error, body, id) => {
...
@@ -55,12 +60,12 @@ const waitingCallback = (error, body, id) => {
}
}
console
.
log
(
`Tested
${
testURL
}
`
)
console
.
log
(
`Tested
${
testURL
}
`
)
console
.
log
(
`Platform:
${
test
.
platform
.
join
(
'
,
'
)
}
`
)
console
.
log
(
`Platform:
${
platform
}
`
)
console
.
log
(
`Passed:
${
passed
.
toString
()
}
`
)
console
.
log
(
`Passed:
${
passed
}
`
)
console
.
log
(
`URL:
${
test
.
url
}
\n`
)
console
.
log
(
`URL:
${
test
.
url
}
\n`
)
if
(
errorStr
)
{
if
(
errorStr
)
{
console
.
error
(
errorStr
)
console
.
error
(
`
${
platform
}
:
${
errorStr
}
`
)
}
}
if
(
passed
)
{
if
(
passed
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment