Skip to content

Commit

Permalink
[#IOPID-1738] tentative: edit pipeline for it tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arcogabbo committed Apr 30, 2024
1 parent cfc505d commit e5d465c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
28 changes: 28 additions & 0 deletions .devops/code-review-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,33 @@ stages:
cd e2e
yarn install --frozen-lockfile
yarn build
- task: DockerCompose@0
inputs:
dockerComposeFile: e2e/scenarios/basic/docker-compose.yml
action: "Build services"
dockerComposeFileArgs: e2e/scenarios/basic/env.scenario
- task: DockerCompose@0
inputs:
dockerComposeFile: e2e/scenarios/with-aws-s3/docker-compose.yml
action: "Build services"
dockerComposeFileArgs: e2e/scenarios/basic/env.scenario
- task: DockerCompose@0
inputs:
dockerComposeFile: e2e/scenarios/with-redis-cluster/docker-compose.yml
action: "Build services"
dockerComposeFileArgs: e2e/scenarios/basic/env.scenario
- task: DockerCompose@0
inputs:
dockerComposeFile: e2e/scenarios/basic/docker-compose.yml
action: "Run services"
- task: DockerCompose@0
inputs:
dockerComposeFile: e2e/scenarios/with-aws-s3/docker-compose.yml
action: "Run services"
- task: DockerCompose@0
inputs:
dockerComposeFile: e2e/scenarios/with-redis-cluster/docker-compose.yml
action: "Run services"
- script: |
yarn start
displayName: 'Run e2e tests'
12 changes: 6 additions & 6 deletions e2e/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const runProcess = (sh: string): ChildProcess => {
const promisifyProcess = (cp: ChildProcess): Promise<ProcessResult> =>
new Promise(async (resolve, reject) =>
cp
.on("exit", (code) => {
.on("exit", code => {
resolve(code === 0 ? "ok" : "ko");
})
.on("error", reject)
Expand All @@ -51,9 +51,9 @@ const promisifyProcess = (cp: ChildProcess): Promise<ProcessResult> =>
*/
const composeScenarioTest = async (name: string): Promise<ProcessResult> => {
try {
await promisifyProcess(runProcess(setupCmdForScenario(name)));
// await promisifyProcess(runProcess(setupCmdForScenario(name)));

await new Promise((ok) => setTimeout(ok, 5000));
// await new Promise((ok) => setTimeout(ok, 5000));

const result = await promisifyProcess(runProcess(testCmdForScenario(name)));

Expand All @@ -77,7 +77,7 @@ const composeScenarioTest = async (name: string): Promise<ProcessResult> => {

// scenario may be filtered if are provided in input
const selectedScenarios = inputScenarios.length
? scenarios.filter((e) => inputScenarios.includes(e))
? scenarios.filter(e => inputScenarios.includes(e))
: scenarios;

// create child process for each scenario
Expand All @@ -103,11 +103,11 @@ const composeScenarioTest = async (name: string): Promise<ProcessResult> => {
if (computedResult === "ok") return;
else throw new Error("at least one test scenario failed");
})(process.argv.slice(2))
.then((_) => {
.then(_ => {
console.log("All test scenarios succeeded");
process.exit(0);
})
.catch((e) => {
.catch(e => {
console.error(e);
process.exit(1);
});

0 comments on commit e5d465c

Please sign in to comment.