Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bdd/step-definitions/e2e/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ When("I deploy sequence {string}", async function (
) {
const seqPath = `../packages/${sequenceName}`;
const res = this.cliResources;

res.stdio = await getStreamsFromSpawn("/usr/bin/env", [
...si,
"seq",
Expand All @@ -528,8 +529,10 @@ Then("I should see error message: {string}", async function (
errorMessage: string
) {
const res = this.cliResources;

if (res.stdio) {
const errorMessageRegex = new RegExp(errorMessage);

assert.match(res.stdio[1], errorMessageRegex);
} else {
assert.fail("cliResources or stdio is undefined");
Expand All @@ -541,9 +544,11 @@ Then("I should see exitCode: {string}", async function (
exitCode: string
) {
const res = this.cliResources;

if (res && res.stdio) {
const exitCodeRegex = new RegExp(exitCode);
const receivedExitCode: string = res.stdio[2].toString();

assert.match(
receivedExitCode,
exitCodeRegex,
Expand All @@ -558,13 +563,15 @@ Then(
"Instance info should contain provided parameters in {string}",
async function (this: CustomWorld, file: string) {
const res = this.cliResources;

if (res.stdio) {
try {
const expected = await fs.promises
.readFile(`../bdd/data/${file}`, "utf8")
.then(JSON.parse);

const received = res.stdio[0] ? JSON.parse(res.stdio[0]) : null;

if (process.env.SCRAMJET_TEST_LOG) {
logger.debug("received.appConfig:", received.appConfig);
logger.debug("expected.appConfig:", expected.appConfig);
Expand Down
2 changes: 1 addition & 1 deletion packages/runner/src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class Runner<X extends AppConfig> implements IComponent {
});

this.outputDataStream = new DataStream({ highWaterMark: 0 }).catch((e: any) => {
this.logger.error("Error during input data stream", e);
this.logger.error("Error during output data stream", e);

throw e;
});
Expand Down