Upgrades people!
This commit is contained in:
parent
f84234150f
commit
8ad56e8d38
40 changed files with 483 additions and 379 deletions
|
@ -1,7 +1,12 @@
|
|||
import axios from "axios";
|
||||
import primary from "./primary.js";
|
||||
import secondary from "./secondary.js";
|
||||
import tertiary from "./tertiary.js";
|
||||
import secondary1 from "./secondary1.js";
|
||||
import secondary2 from "./secondary2.js";
|
||||
|
||||
import tertiary1 from "./tertiary1.js";
|
||||
import tertiary2 from "./tertiary2.js";
|
||||
import tertiary3 from "./tertiary3.js";
|
||||
|
||||
import single from "./single.js";
|
||||
import failing from "./failing.js";
|
||||
|
||||
|
@ -12,31 +17,33 @@ 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;
|
||||
var pipeline = (args.find((v) => v.includes("pipeline=")) ?? "").replace(
|
||||
"pipeline=",
|
||||
""
|
||||
);
|
||||
if (pipeline)
|
||||
pipeline = JSON.parse(Buffer.from(pipeline, "base64").toString("utf8"));
|
||||
|
||||
const logNow = () => console.log(Date.now());
|
||||
const liveIndicator = () => {
|
||||
for (var i = 0; i < endLiveCount; i++) setTimeout(logNow, i * liveUpdateDelay);
|
||||
for (var i = 0; i < endLiveCount; i++)
|
||||
setTimeout(logNow, i * liveUpdateDelay);
|
||||
};
|
||||
|
||||
const runTests = () => {
|
||||
switch (test) {
|
||||
case "primary":
|
||||
return primary();
|
||||
case "secondary":
|
||||
return secondary(pipelineData);
|
||||
case "tertiary":
|
||||
return tertiary(pipelineData);
|
||||
case "secondary1":
|
||||
return secondary1(pipeline.testData);
|
||||
case "secondary2":
|
||||
return secondary2(pipeline.testData);
|
||||
case "tertiary1":
|
||||
return tertiary1(pipeline.testData);
|
||||
case "tertiary2":
|
||||
return tertiary2(pipeline.testData);
|
||||
case "tertiary3":
|
||||
return tertiary3(pipeline.testData);
|
||||
case "single":
|
||||
return single();
|
||||
case "failing":
|
||||
|
@ -50,15 +57,18 @@ const runTests = () => {
|
|||
liveIndicator();
|
||||
setTimeout(() => {
|
||||
const status = runTests();
|
||||
pipeline.testData = status.pipelineData;
|
||||
const testResult = {
|
||||
...status,
|
||||
name: test,
|
||||
pipelineTriggers: pipelineTriggers ? pipelineTriggers : undefined,
|
||||
pipelineDashboardSocket,
|
||||
pipeline,
|
||||
};
|
||||
axios.post(reportingUrl, { testResult }).catch((e) => {
|
||||
console.log(e.response.status);
|
||||
}).then(()=>{
|
||||
if(status.status === 1) process.exit(1);
|
||||
});
|
||||
axios
|
||||
.post(reportingUrl, { testResult })
|
||||
.catch((e) => {
|
||||
console.log(e.response.status);
|
||||
})
|
||||
.then(() => {
|
||||
if (status.status === 1) process.exit(1);
|
||||
});
|
||||
}, endLiveCount * liveUpdateDelay);
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
export default function secondaryTest(pipelineData) {
|
||||
console.log("This came from a secondary test!");
|
||||
return { status: +(pipelineData !== "SomeData"), pipelineData: "SomeOtherData" };
|
||||
}
|
7
tests/assets/suite/secondary1.js
Normal file
7
tests/assets/suite/secondary1.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default function secondaryTest(pipelineData) {
|
||||
console.log("This came from a secondary1 test!");
|
||||
return {
|
||||
status: +(pipelineData !== "SomeData"),
|
||||
pipelineData: "SomeOtherData",
|
||||
};
|
||||
}
|
7
tests/assets/suite/secondary2.js
Normal file
7
tests/assets/suite/secondary2.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default function secondaryTest(pipelineData) {
|
||||
console.log("This came from a secondary2 test!");
|
||||
return {
|
||||
status: +(pipelineData !== "SomeData"),
|
||||
pipelineData: "SomeOtherOtherData",
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
export default function secondaryTest(pipelineData) {
|
||||
console.log("This came from a tertiary!");
|
||||
console.log("This came from a tertiary1!");
|
||||
return { status: +(pipelineData !== "SomeOtherData") };
|
||||
}
|
4
tests/assets/suite/tertiary2.js
Normal file
4
tests/assets/suite/tertiary2.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
export default function secondaryTest(pipelineData) {
|
||||
console.log("This came from a tertiary2!");
|
||||
return { status: +(pipelineData !== "SomeOtherData") };
|
||||
}
|
4
tests/assets/suite/tertiary3.js
Normal file
4
tests/assets/suite/tertiary3.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
export default function secondaryTest(pipelineData) {
|
||||
console.log("This came from a tertiary3!");
|
||||
return { status: +(pipelineData !== "SomeOtherData") };
|
||||
}
|
|
@ -14,7 +14,16 @@ const primary = new Initiator(url);
|
|||
const job = {
|
||||
type: "compound",
|
||||
testName: "primary",
|
||||
pipelineTriggers: "secondary",
|
||||
pipeline: {
|
||||
triggers: {
|
||||
secondary1: {
|
||||
tertiary1: {},
|
||||
tertiary2: { __testDelay: 5000 },
|
||||
__testDelay: 1000,
|
||||
},
|
||||
secondary2: { tertiary3: { __testDelay: 3000 }, __testDelay: 15000 },
|
||||
},
|
||||
},
|
||||
name: "testing",
|
||||
image: "node",
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue