-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: update status for jobs in saucelabs (#713)
- Loading branch information
1 parent
7da455b
commit d133dc0
Showing
4 changed files
with
71 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { event, container } = require('codeceptjs'); | ||
const SauceLabs = require('saucelabs'); | ||
|
||
const { SAUCE_USERNAME, SAUCE_ACCESS_KEY } = process.env; | ||
|
||
module.exports = function() { | ||
const myAccount = new SauceLabs({ | ||
username: SAUCE_USERNAME, | ||
password: SAUCE_ACCESS_KEY | ||
}); | ||
/** | ||
* Reports to saucelabs if a job has passed or failed | ||
* @param {Object} test - the test object from codeceptjs | ||
* @param {boolean} isPassed - true if passed | ||
* @return {void} | ||
*/ | ||
const updateStatus = (test, isPassed) => { | ||
const sessionId = container.helpers('WebDriverIO').browser.requestHandler.sessionID; | ||
|
||
myAccount.updateJob(sessionId, { | ||
name: test.title, | ||
passed: isPassed | ||
}); | ||
}; | ||
|
||
event.dispatcher.on(event.test.passed, (test) => { | ||
updateStatus(test, true); | ||
}); | ||
|
||
event.dispatcher.on(event.test.failed, (test) => { | ||
updateStatus(test, false); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,6 +175,13 @@ [email protected]: | |
version "0.8.2" | ||
resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" | ||
|
||
agent-base@2: | ||
version "2.1.1" | ||
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-2.1.1.tgz#d6de10d5af6132d5bd692427d46fc538539094c7" | ||
dependencies: | ||
extend "~3.0.0" | ||
semver "~5.0.1" | ||
|
||
ajv-keywords@^2.0.0, ajv-keywords@^2.1.0: | ||
version "2.1.1" | ||
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" | ||
|
@@ -2366,6 +2373,12 @@ dateformat@^3.0.0: | |
version "3.0.2" | ||
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.2.tgz#9a4df4bff158ac2f34bc637abdb15471607e1659" | ||
|
||
debug@2, [email protected], debug@^2.2.0, debug@^2.6.8: | ||
version "2.6.9" | ||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" | ||
dependencies: | ||
ms "2.0.0" | ||
|
||
[email protected]: | ||
version "2.2.0" | ||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" | ||
|
@@ -2378,12 +2391,6 @@ [email protected]: | |
dependencies: | ||
ms "0.7.2" | ||
|
||
[email protected], debug@^2.2.0, debug@^2.6.8: | ||
version "2.6.9" | ||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" | ||
dependencies: | ||
ms "2.0.0" | ||
|
||
[email protected], debug@^3.0.0, debug@^3.0.1: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" | ||
|
@@ -3202,7 +3209,7 @@ express@^4.15.2: | |
utils-merge "1.0.1" | ||
vary "~1.1.2" | ||
|
||
extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: | ||
extend@3, extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: | ||
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" | ||
|
||
|
@@ -4050,6 +4057,14 @@ [email protected]: | |
version "0.0.1" | ||
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" | ||
|
||
https-proxy-agent@^1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz#35f7da6c48ce4ddbfa264891ac593ee5ff8671e6" | ||
dependencies: | ||
agent-base "2" | ||
debug "2" | ||
extend "3" | ||
|
||
husky@^0.14.3: | ||
version "0.14.3" | ||
resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" | ||
|
@@ -7226,6 +7241,12 @@ sass-loader@^6.0.6: | |
lodash.tail "^4.1.1" | ||
pify "^3.0.0" | ||
|
||
saucelabs@^1.4.0: | ||
version "1.4.0" | ||
resolved "https://registry.yarnpkg.com/saucelabs/-/saucelabs-1.4.0.tgz#b934a9af9da2874b3f40aae1fcde50a4466f5f38" | ||
dependencies: | ||
https-proxy-agent "^1.0.0" | ||
|
||
sax@>=0.6.0, sax@~1.2.1: | ||
version "1.2.4" | ||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" | ||
|
@@ -7264,6 +7285,10 @@ semver@~4.3.3: | |
version "4.3.6" | ||
resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" | ||
|
||
semver@~5.0.1: | ||
version "5.0.3" | ||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.0.3.tgz#77466de589cd5d3c95f138aa78bc569a3cb5d27a" | ||
|
||
semver@~5.3.0: | ||
version "5.3.0" | ||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" | ||
|