Skip to content

Commit

Permalink
Merge pull request #73 from paritytech/frank/feat-multiple-events-of-…
Browse files Browse the repository at this point in the history
…type

Support multiple events of same type
  • Loading branch information
NachoPal authored Dec 26, 2022
2 parents 69a3609 + db56a62 commit 47ed5db
Show file tree
Hide file tree
Showing 10 changed files with 562 additions and 266 deletions.
299 changes: 176 additions & 123 deletions src/checker.ts

Large diffs are not rendered by default.

34 changes: 15 additions & 19 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,22 @@ const spawnChecker = (options) => {
let runnerExtension = 'js';
runnerExtension = options.env === 'dev' ? 'ts' : runnerExtension;

p['checker'] = spawn(
'ts-node',
[`${__dirname}/checker.${runnerExtension}`],
{
stdio: 'inherit',
detached: false,
env: {
...process.env,
TESTS_PATH: options.tests,
ENV: options.env,
},
}
)
p['checker'] = spawn('ts-node', [`${__dirname}/checker.${runnerExtension}`], {
stdio: 'inherit',
detached: false,
env: {
...process.env,
TESTS_PATH: options.tests,
ENV: options.env,
},
});

p['checker'].on('exit', (exitCode: string) => {
if (parseInt(exitCode) === 0) {
emitter.emit('checker-done');
}
})
}
});
};

program
.name('parachains-integrations-tests')
Expand All @@ -139,7 +135,7 @@ program
'zombienet-test',
'polkadot-launch',
'polkadot-launch-test',
'checker'
'checker',
])
.makeOptionMandatory()
)
Expand Down Expand Up @@ -192,7 +188,7 @@ if (options.mode === 'zombienet-test') {
emitter.on('checker-done', () => {
spawnZombienet(options);
spawnTests(options);
})
});
} else if (options.mode === 'zombienet') {
program.addOption(
new Option(
Expand All @@ -218,7 +214,7 @@ if (options.mode === 'zombienet-test') {
emitter.on('checker-done', () => {
spawnPolkadotLaunch(options);
spawnTests(options);
})
});
} else if (options.mode === 'polkadot-launch') {
program.addOption(
new Option(
Expand All @@ -236,7 +232,7 @@ if (options.mode === 'zombienet-test') {
spawnChecker(options);
emitter.on('checker-done', () => {
spawnTests(options);
})
});
} else if (options.mode === 'checker') {
program.addOption(
new Option('-t, --tests <path>', 'path to tests').makeOptionMandatory()
Expand Down
Loading

0 comments on commit 47ed5db

Please sign in to comment.