From ea6a0bd613b1884cffa68aff958263d7855fecdf Mon Sep 17 00:00:00 2001 From: Karol Tylenda Date: Mon, 29 Jan 2024 09:52:09 +0100 Subject: [PATCH 1/4] add broken seq --- bdd/data/sequences/hello-bad.tar.gz | Bin 0 -> 2056 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 bdd/data/sequences/hello-bad.tar.gz diff --git a/bdd/data/sequences/hello-bad.tar.gz b/bdd/data/sequences/hello-bad.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..1dc04f8e3966258ceb8fb0fc48badf4d7a4dec3b GIT binary patch literal 2056 zcmV+j2>16NiwFP!000001MM08Q`^X{Kl`uHGt4BJ!*-m{K6<%%Erctb5_(Cwn;RaF zI`$@Bu-C444dhDx_ov-;5<~g8dz9hc6m@89NvoB#E3LHNPW)4nO=v`3JQ~#N^-iY+ z`0IAt_42QRmg~X`x7BELyX|hf(RxvL+x2D#>5r$<3UV&I3{~;OEFvuM{#QBL7FhoN z4Zv-++s$s>ZPi=&+;ki2wR44MXSlxyUX)TsHX~0EE{y)*R~YqwIp`0z`orU2`@_-h z{-Af(uwNR+@L&L5dJ0|;fMw-rfJ1<#G5C2F!O3UC*xLW_JJ?`rUP+?xFYaevd_sid zM-;57rf~|Ke1_EXPjP^iKuDq}v2i)<=^uq4WUzS%PR=tYN_;PJ#*{f4tEKp1oCJ{n zaB&+`fADem`-lDA!ACd*^F}5Uj*KT-qo;;2xA2k8o9skW{v+-5@H=6C|_N+Jw?_+kKfQ^JIL0$@o%ibsIR8riV3m9$fnYE=*E=bCkZ-9YcuyH>w zkaJ`8eW^hK6eA*kd_iRasp! zw^kZ5Up~(PZrA)nK8`5nKCOFcTE~H5&LCmY3@C%xLo+fMXCCvzg5^9UtfZ!wQ$ zG^4nm{=MFqR|*Hn3}x1AkW@a1TP(qh;D-sATM_XXWmDTW3%oBezwu)AG&fo`iev#WNCcfw-xKI;4t&Ohcd-eJ zRXjgGw@>s*Wz)pL1#}jP%TXKH;Z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!0>tPJeK`jJh8n)a#n2fDQo zXu{DeP=3|E7$l2HvFFZNV7@X6e-Wv?W-2%~VJSs>@YVPqivfrjIxj+}YSbDG!-r{;qY+rioU7HYP14J zUpZkRQ+r@TZcss4Ufh_M{IDbGD|RUv`YUrKvwW*-FL7Gh?KvlaCLEwAzJVL0@#R=c m72@u%_yv{AtKl+14Sk}t_zchR4A1Zk2>%7qCxf8?C;$LiO$zS- literal 0 HcmV?d00001 From fdd7e165f44d21f29671eb28e9cb7dcb68081773 Mon Sep 17 00:00:00 2001 From: Karol Tylenda Date: Mon, 29 Jan 2024 13:10:33 +0100 Subject: [PATCH 2/4] add seq upload error handling test --- bdd/features/e2e/E2E-016-errors.feature | 8 ++++++++ bdd/step-definitions/e2e/cli.ts | 27 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 bdd/features/e2e/E2E-016-errors.feature diff --git a/bdd/features/e2e/E2E-016-errors.feature b/bdd/features/e2e/E2E-016-errors.feature new file mode 100644 index 000000000..00bba7e6b --- /dev/null +++ b/bdd/features/e2e/E2E-016-errors.feature @@ -0,0 +1,8 @@ +Feature: Test error handling while sequence is uploaded + + @ci-unified + Scenario: E2E-016 TC-001 Run errored sequence + Given I set config for local Hub + When I deploy sequence "data/sequences" "hello-bad.tar.gz" + Then I should see error message: "Sequence entrypoint path app.js is invalid. Check `main` field in Sequence package.json" + Then I should see exitCode: "1" \ No newline at end of file diff --git a/bdd/step-definitions/e2e/cli.ts b/bdd/step-definitions/e2e/cli.ts index a62843b23..43f092771 100644 --- a/bdd/step-definitions/e2e/cli.ts +++ b/bdd/step-definitions/e2e/cli.ts @@ -379,3 +379,30 @@ Then(/^I confirm template (.*) is created$/, async function (templateType: strin assert.equal(await isTemplateCreated(templateType, workingDirectory), true); }); + +When("I deploy sequence {string} {string}", async function (this: CustomWorld, workingDirectory: string, sequenceName: string) { + const seqPath = `${workingDirectory}/${sequenceName}` + const res = this.cliResources; + res.stdio = await getStreamsFromSpawn("/usr/bin/env", [...si, "seq", "deploy", seqPath]); +}); + +Then("I should see error message: {string}", async function (this: CustomWorld, 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"); + } +}); + +Then("I should see exitCode: {string}", async function (this: CustomWorld, 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, `\nReceived exit code(${receivedExitCode}) did not match to expected(${exitCode})\n`); + } else { + assert.fail("cliResources or stdio is undefined"); + } +}); \ No newline at end of file From 1f58081fb2b91da21ff05007bf3b4c52661be942 Mon Sep 17 00:00:00 2001 From: Karol Tylenda Date: Wed, 31 Jan 2024 09:26:36 +0100 Subject: [PATCH 3/4] move bad_seq to refapps --- bdd/data/sequences/hello-bad.tar.gz | Bin 2056 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 bdd/data/sequences/hello-bad.tar.gz diff --git a/bdd/data/sequences/hello-bad.tar.gz b/bdd/data/sequences/hello-bad.tar.gz deleted file mode 100644 index 1dc04f8e3966258ceb8fb0fc48badf4d7a4dec3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2056 zcmV+j2>16NiwFP!000001MM08Q`^X{Kl`uHGt4BJ!*-m{K6<%%Erctb5_(Cwn;RaF zI`$@Bu-C444dhDx_ov-;5<~g8dz9hc6m@89NvoB#E3LHNPW)4nO=v`3JQ~#N^-iY+ z`0IAt_42QRmg~X`x7BELyX|hf(RxvL+x2D#>5r$<3UV&I3{~;OEFvuM{#QBL7FhoN z4Zv-++s$s>ZPi=&+;ki2wR44MXSlxyUX)TsHX~0EE{y)*R~YqwIp`0z`orU2`@_-h z{-Af(uwNR+@L&L5dJ0|;fMw-rfJ1<#G5C2F!O3UC*xLW_JJ?`rUP+?xFYaevd_sid z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;gGauFt(#EuFL;m0H;%;HI&`DCfL zon+IW^pJ@9gmGoo&mZ1fO}nn~vg+hiB-so}I)j*EmMX?66-5#<^DL5>#RUXX!hCF_ zCC*|loXT0|DN9o2aM^rnl{vQ69Az9T_uAq@m`8uVwp4!rdE7bfj{k<+Z7u6Rw~J>L zp8syA`5gZbg+JB*{X>5T3&FZD3_6kD$kx|Pu&}jr;m8mnVaDQ4??B(<*s@83ALBd{ z*!VHTW%lVyj-`PYr&uCjlw2-bu%Bc|kP9lnH73+Bv?O&CUv!0&EQ#TsKwEryh~qvB z(geH4-nwfToPu?xez1<2(5br0ijpaIngJQ-QF=N`6~Q^ZebhNVzp z(C)TTJoVPA>f@%xm6E9A`bvvU*TvPw&Xqc6t`kudaC!0>tPJeK`jJh8n)a#n2fDQo zXu{DeP=3|E7$l2HvFFZNV7@X6e-Wv?W-2%~VJSs>@YVPqivfrjIxj+}YSbDG!-r{;qY+rioU7HYP14J zUpZkRQ+r@TZcss4Ufh_M{IDbGD|RUv`YUrKvwW*-FL7Gh?KvlaCLEwAzJVL0@#R=c m72@u%_yv{AtKl+14Sk}t_zchR4A1Zk2>%7qCxf8?C;$LiO$zS- From bdb9aa5b27ace56d8b82cb04c121e2cb3d9931b6 Mon Sep 17 00:00:00 2001 From: Karol Tylenda Date: Wed, 31 Jan 2024 09:27:58 +0100 Subject: [PATCH 4/4] update function with new seq location --- bdd/features/e2e/E2E-016-errors.feature | 4 ++-- bdd/step-definitions/e2e/cli.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bdd/features/e2e/E2E-016-errors.feature b/bdd/features/e2e/E2E-016-errors.feature index 00bba7e6b..7c4d5d98b 100644 --- a/bdd/features/e2e/E2E-016-errors.feature +++ b/bdd/features/e2e/E2E-016-errors.feature @@ -1,8 +1,8 @@ Feature: Test error handling while sequence is uploaded - @ci-unified + @ci-instance-node Scenario: E2E-016 TC-001 Run errored sequence Given I set config for local Hub - When I deploy sequence "data/sequences" "hello-bad.tar.gz" + When I deploy sequence "bad-sequence.tar.gz" Then I should see error message: "Sequence entrypoint path app.js is invalid. Check `main` field in Sequence package.json" Then I should see exitCode: "1" \ No newline at end of file diff --git a/bdd/step-definitions/e2e/cli.ts b/bdd/step-definitions/e2e/cli.ts index 43f092771..bd7e0b8da 100644 --- a/bdd/step-definitions/e2e/cli.ts +++ b/bdd/step-definitions/e2e/cli.ts @@ -380,8 +380,8 @@ Then(/^I confirm template (.*) is created$/, async function (templateType: strin assert.equal(await isTemplateCreated(templateType, workingDirectory), true); }); -When("I deploy sequence {string} {string}", async function (this: CustomWorld, workingDirectory: string, sequenceName: string) { - const seqPath = `${workingDirectory}/${sequenceName}` +When("I deploy sequence {string}", async function (this: CustomWorld, sequenceName: string) { + const seqPath = `../packages/${sequenceName}` const res = this.cliResources; res.stdio = await getStreamsFromSpawn("/usr/bin/env", [...si, "seq", "deploy", seqPath]); });