diff --git a/.eslintrc b/.eslintrc index 52083e88..c11535cc 100644 --- a/.eslintrc +++ b/.eslintrc @@ -47,6 +47,7 @@ "no-angle-bracket-type-assertion": 0, "no-bitwise": 1, "no-console": 1, + "no-tabs": 1, "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0, "maxBOF": 0 }], "no-empty": [1, { "allowEmptyCatch": true }], "no-empty-interface": 0, diff --git a/controller/acceptance/healthcheck.spec.ts b/controller/acceptance/healthcheck.spec.ts index da610b86..1f5f0f28 100644 --- a/controller/acceptance/healthcheck.spec.ts +++ b/controller/acceptance/healthcheck.spec.ts @@ -5,7 +5,7 @@ import { expect } from "chai"; const fetch = _axios.get; -// Beanstalk __URL +// Beanstalk __URL const integrationUrl = "http://" + (process.env.BUILD_APP_URL || `localhost:${process.env.PORT || "8081"}`); describe("Healthcheck Integration", () => { diff --git a/controller/acceptance/pewpew.spec.ts b/controller/acceptance/pewpew.spec.ts index 04029f4b..fc9eb87e 100644 --- a/controller/acceptance/pewpew.spec.ts +++ b/controller/acceptance/pewpew.spec.ts @@ -38,7 +38,7 @@ async function fetch ( const UNIT_TEST_FOLDER = process.env.UNIT_TEST_FOLDER || "test"; const PEWPEW_ZIP_FILEPATH = process.env.PEWPEW_ZIP_FILEPATH || path.join(UNIT_TEST_FOLDER, PEWPEW_BINARY_EXECUTABLE + ".zip"); -// Beanstalk __URL +// Beanstalk __URL const integrationUrl = "http://" + (process.env.BUILD_APP_URL || `localhost:${process.env.PORT || "8081"}`); let sharedPewPewVersions: string[] | undefined; @@ -208,8 +208,7 @@ describe("PewPew API Integration", () => { }); describe("DELETE /pewpew", () => { - after(async () => { - // Put the version back + const uploadPewpew = async () => { try { const filename: string = path.basename(PEWPEW_ZIP_FILEPATH); const formData: FormDataPewPew = { @@ -252,6 +251,18 @@ describe("PewPew API Integration", () => { } catch (error) { throw error; } + }; + + beforeEach(async () => { + if (uploadedPewPewVersion) { + return; + } + await uploadPewpew(); + }); + + after(async () => { + // Put the version back + await uploadPewpew(); }); it("DELETE /pewpew should respond 200 OK", (done: Mocha.Done) => { @@ -259,10 +270,11 @@ describe("PewPew API Integration", () => { const deleteVersion = uploadedPewPewVersion; const deleteURL = `${url}?version=${deleteVersion}`; log("DELETE URL", LogLevel.DEBUG, { deleteURL }); + // Reset it since it's been deleted + uploadedPewPewVersion = undefined; fetch(deleteURL, { method: "DELETE" }).then((res: Response) => { log("DELETE /pewpew res", LogLevel.DEBUG, res); expect(res.status).to.equal(200); - uploadedPewPewVersion = undefined; const body: TestManagerError = res.data; log("body: " + res.data, LogLevel.DEBUG, body); expect(body).to.not.equal(undefined); diff --git a/controller/acceptance/queues.spec.ts b/controller/acceptance/queues.spec.ts index c8fb0e39..18b90fed 100644 --- a/controller/acceptance/queues.spec.ts +++ b/controller/acceptance/queues.spec.ts @@ -8,7 +8,7 @@ import { expect } from "chai"; const fetch = _axios.get; -// Beanstalk __URL +// Beanstalk __URL const integrationUrl = "http://" + (process.env.BUILD_APP_URL || `localhost:${process.env.PORT || "8081"}`); let sharedQueueNames: string[] | undefined; diff --git a/controller/acceptance/test.spec.ts b/controller/acceptance/test.spec.ts index 0f135330..41f64447 100644 --- a/controller/acceptance/test.spec.ts +++ b/controller/acceptance/test.spec.ts @@ -63,7 +63,7 @@ const defaultEnvironmentVariables: EnvironmentVariablesFile = { TEST2: "true" }; -// Beanstalk __URL +// Beanstalk __URL export const integrationUrl = "http://" + (process.env.BUILD_APP_URL || `localhost:${process.env.PORT || "8081"}`); let sharedPpaasTestId: PpaasTestId | undefined; diff --git a/controller/components/YamlWriterUpload/index.tsx b/controller/components/YamlWriterUpload/index.tsx index 0bcebe64..1834b9af 100644 --- a/controller/components/YamlWriterUpload/index.tsx +++ b/controller/components/YamlWriterUpload/index.tsx @@ -281,7 +281,7 @@ export const YamlWriterUpload = (props: YamlWriterUploadProps) => { if (types[mimeType] !== undefined) { types[mimeType]!.index.push({ iter: i, id }); } else { - types[mimeType] = { index: [{ iter: i, id }], selected: "partial"}; + types[mimeType] = { index: [{ iter: i, id }], selected: "partial"}; } // Adds a reference to an endpoint with given response type @@ -292,7 +292,7 @@ export const YamlWriterUpload = (props: YamlWriterUploadProps) => { } else { urls[hostUrl] = { index: [{ iter: i, id }], selected: "yes"}; } - endpoints.push({ selected: "yes", url, type: mimeType, id, method: entry.request.method, headers: [...entry.request.headers] }); + endpoints.push({ selected: "yes", url, type: mimeType, id, method: entry.request.method, headers: [...entry.request.headers] }); } const typesTemp = types; diff --git a/controller/integration/pewpew.spec.ts b/controller/integration/pewpew.spec.ts index 4b158e7b..9fb52508 100644 --- a/controller/integration/pewpew.spec.ts +++ b/controller/integration/pewpew.spec.ts @@ -281,10 +281,7 @@ describe("PewPew Util Integration", () => { }); describe("deletePewPew", () => { - beforeEach(async () => { - if (uploadedPewPewVersion) { - return; - } + const uploadPewpew = async () => { try { const parsedForm: ParsedForm = { fields: {}, @@ -317,6 +314,17 @@ describe("PewPew Util Integration", () => { log("deletePewPew beforeEach error", LogLevel.ERROR, error); throw error; } + }; + + beforeEach(async () => { + if (uploadedPewPewVersion) { + return; + } + await uploadPewpew(); + }); + + after(async () => { + await uploadPewpew(); }); it("deletePewPew should respond 200 OK", (done: Mocha.Done) => { diff --git a/guide/results-viewer-react/.eslintrc b/guide/results-viewer-react/.eslintrc index b35016bd..969ee8a8 100644 --- a/guide/results-viewer-react/.eslintrc +++ b/guide/results-viewer-react/.eslintrc @@ -34,6 +34,7 @@ "no-angle-bracket-type-assertion": 0, "no-bitwise": 1, "no-console": 1, + "no-tabs": 1, "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0, "maxBOF": 0 }], "no-empty": [1, { "allowEmptyCatch": true }], "no-empty-interface": 0, diff --git a/guide/results-viewer-react/src/components/YamlWriterUpload/index.tsx b/guide/results-viewer-react/src/components/YamlWriterUpload/index.tsx index bb3f4527..5ba48cc3 100644 --- a/guide/results-viewer-react/src/components/YamlWriterUpload/index.tsx +++ b/guide/results-viewer-react/src/components/YamlWriterUpload/index.tsx @@ -280,7 +280,7 @@ export const YamlWriterUpload = (props: YamlWriterUploadProps) => { if (types[mimeType] !== undefined) { types[mimeType]!.index.push({ iter: i, id }); } else { - types[mimeType] = { index: [{ iter: i, id }], selected: "partial"}; + types[mimeType] = { index: [{ iter: i, id }], selected: "partial"}; } // Adds a reference to an endpoint with given response type @@ -291,7 +291,7 @@ export const YamlWriterUpload = (props: YamlWriterUploadProps) => { } else { urls[hostUrl] = { index: [{ iter: i, id }], selected: "yes"}; } - endpoints.push({ selected: "yes", url, type: mimeType, id, method: entry.request.method, headers: [...entry.request.headers] }); + endpoints.push({ selected: "yes", url, type: mimeType, id, method: entry.request.method, headers: [...entry.request.headers] }); } const typesTemp = types; diff --git a/pr.sh b/pr.sh index d6fa30fd..0a473394 100755 --- a/pr.sh +++ b/pr.sh @@ -22,6 +22,8 @@ cargo clippy --all -- -D warnings cargo test --all cargo test --all --doc +cargo deny check --hide-inclusion-graph license sources advisories + CWD=$(pwd) cd "$CWD/lib/config-wasm" @@ -49,13 +51,29 @@ npm run build:common npm run build:react NODE_ENV=test npm test -# npm run testcleanup -# npm run coverage -# echo grab screenshot +read -e -p "Run Coverage Tests y/N: " choice +if [[ "$choice" == [Yy]* ]]; then + npm run testcleanup + # npm run coverage + # read -e -p "Grab screenshot then hit enter to continue." choice + npm run coverage:common + read -e -p "Grab common screenshot then hit enter to continue." choice + npm run coverage:controller + read -e -p "Grab controller screenshot then hit enter to continue." choice + npm run coverage:agent + read -e -p "Grab agent screenshot then hit enter to continue." choice + npm run testmerge + read -e -p "Grab overall screenshot then hit enter to continue." choice +fi -# npm run testcleanup -# echo Hit Ctrl-C when acceptance tests finish -# npm acceptance:all -# echo grab screenshot - -cargo deny check --hide-inclusion-graph license sources advisories +read -e -p "Run Acceptance Tests y/N: " choice +if [[ "$choice" == [Yy]* ]]; then + while [[ "$clean_result" != "0" ]]; do + (npm run testcleanup) + clean_result=$? + echo "clean_result: $clean_result" + done + echo Hit Ctrl-C when acceptance tests finish + npm run acceptance:all + read -e -p "Grab screenshot then hit enter to continue." choice +fi