Migrated test suite
This commit is contained in:
parent
7027feb8ac
commit
37613e4de1
5 changed files with 0 additions and 0 deletions
|
@ -1,4 +0,0 @@
|
|||
export default function failingTest(){
|
||||
console.log("This came from a failing test!");
|
||||
return {status:1};
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
export default function primaryTest(){
|
||||
console.log("This came from a primary test!");
|
||||
return {status:0, pipelineData:"SomeData"};
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
import axios from "axios";
|
||||
import primary from "./primary.js";
|
||||
import secondary from "./secondary.js";
|
||||
import single from "./single.js";
|
||||
import failing from "./failing.js";
|
||||
|
||||
// Constants
|
||||
const endLiveCount = 2;
|
||||
const reportingUrl = `${process.env.QUALITEER_URL}/api/dev/rabbit/TestResults`;
|
||||
// Pull args
|
||||
const args = process.argv.slice(2);
|
||||
const test = (args.find((v)=>v.includes("test=")) ?? "").replace("test=","");
|
||||
const pipelineData = (args.find((v)=>v.includes("pipelineData=")) ?? "").replace("pipelineData=","");
|
||||
const pipelineTriggers = (args.find((v)=>v.includes("pipelineTriggers=")) ?? "").replace("pipelineTriggers=","");
|
||||
const pipelineDashboardSocket = (args.find((v)=>v.includes("pipelineDashboardSocket=")) ?? "").replace("pipelineDashboardSocket=","") || undefined;
|
||||
|
||||
const logNow = () => console.log(Date.now());
|
||||
const liveIndicator = () => {
|
||||
for (var i = 0; i < endLiveCount; i++) setTimeout(logNow, i * 1000);
|
||||
}
|
||||
|
||||
const runTests = () => {
|
||||
switch (test) {
|
||||
case "primary":
|
||||
return primary();
|
||||
case "secondary":
|
||||
return secondary(pipelineData);
|
||||
case "single":
|
||||
return single();
|
||||
case "failing":
|
||||
return failing();
|
||||
default:
|
||||
return single();
|
||||
}
|
||||
}
|
||||
|
||||
// Run
|
||||
liveIndicator();
|
||||
setTimeout(()=>{
|
||||
const status = runTests();
|
||||
const testResult = {...status, name:test, pipelineTriggers: pipelineTriggers ? pipelineTriggers : undefined, pipelineDashboardSocket}
|
||||
axios.post(reportingUrl, {testResult}).catch((e)=>{console.log(e.response.status)});
|
||||
},endLiveCount * 1000);
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
export default function secondaryTest(pipelineData){
|
||||
console.log("This came from a secondary test!");
|
||||
return {status: + (pipelineData !== "SomeData")};
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
export default function singleTest(){
|
||||
console.log("This came from a single test!");
|
||||
return {status:0};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue