-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CM-89 Add Integration test triggers (#90)
* Add Integration test triggers * Fix github token in travis config * Remove travis token for login * Split bash if statement * Fix syntax for if statement * Fix script syntax in travis config * Change travis script to block operator Co-authored-by: Ed Bruck <ed.bruck1@gmail.com>
- Loading branch information
Showing
2 changed files
with
72 additions
and
6 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,50 @@ | ||
var travisArgs = process.argv.slice(2); | ||
const { exec } = require("child_process"); | ||
|
||
function runTravisCommand(comm, cb){ | ||
exec(comm, (error, stdout, stderr) => { | ||
if (error) { | ||
console.log(`error: ${error.message}`); | ||
return -1; | ||
} | ||
if (stderr) { | ||
console.log(`stderr: ${stderr}`); | ||
return -1; | ||
} | ||
|
||
resp = `${stdout}` | ||
|
||
if(resp.includes("passed")){ | ||
cb("passed") | ||
} | ||
else if (resp.includes("failed")){ | ||
cb("failed") | ||
} | ||
else{ | ||
cb("pending") | ||
} | ||
}); | ||
} | ||
|
||
function runIntegrationTest(){ | ||
runTravisCommand("travis-status --pro --token " + travisArgs[0] + " --repo bluzelle/curium-test --branch devel" | ||
, function (result) { | ||
if(result == "passed"){ | ||
console.log("INTEGRATION TESTS PASSED") | ||
process.exit(0) | ||
} | ||
else if(result == "failed"){ | ||
console.log("INTEGRATION TESTS FAILED") | ||
process.exit(1) | ||
} | ||
else{ | ||
setTimeout(function(resp){ | ||
console.log("status: " + resp) | ||
console.log("INTEGRATION TESTS STILL RUNNING...") | ||
runIntegrationTest() | ||
}, 10000, result) | ||
} | ||
} ); | ||
} | ||
|
||
runIntegrationTest() |