Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes 2023-10-26 #168

Merged
merged 6 commits into from
Oct 26, 2023
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
5 changes: 4 additions & 1 deletion controller/acceptance/errorFile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ describe("ErrorFile API Integration", function () {
} else {
expect(res.status, "status").to.equal(200);
expect(res.data, "body").to.not.equal(undefined);
expect(typeof res.data, "typeof res.data").to.equal("string");
// If it's only a single line (that is json) this will be an object like
// {"type":"end","msg":"Test killed early by Ctrl-c"}
// expect(typeof res.data, "typeof res.data").to.equal("string");
expect(["string", "object"].includes(typeof res.data), `["string", "object"].includes("${typeof res.data}")`).to.equal(true);
done();
}
} else {
Expand Down
5 changes: 3 additions & 2 deletions controller/acceptance/test.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1585,8 +1585,9 @@ describe("Test API Integration", () => {
expect(Array.isArray(allTests.requestedTests), "requestedTests").to.equal(true);
// Running should have at least one now
expect(allTests.runningTests.length, "tests.runningTests.length: " + allTests.runningTests.length).to.be.greaterThan(0);
expect(allTests.recentTests.length, "tests.recentTests.length: " + allTests.recentTests.length).to.equal(0);
expect(allTests.requestedTests.length, "tests.requestedTests.length: " + allTests.requestedTests.length).to.be.greaterThanOrEqual(0);
// recent should be zero. But if the agent acceptance are run before this it will be 1
// expect(allTests.recentTests.length, "tests.recentTests.length: " + allTests.recentTests.length).to.equal(0);
// expect(allTests.requestedTests.length, "tests.requestedTests.length: " + allTests.requestedTests.length).to.be.greaterThanOrEqual(0);
});

it("GET /test?testId=validInS3 should respond 200 OK", (done: Mocha.Done) => {
Expand Down
2 changes: 1 addition & 1 deletion controller/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { logout as authLogout } from "../../pages/api/util/authclient";
import getConfig from "next/config";

// Have to check for null on this since the tsc test compile it will be, but nextjs will have a publicRuntimeConfig
const publicRuntimeConfig: any = getConfig() && getConfig().publicRuntimeConfig ? getConfig().publicRuntimeConfig : {};
const publicRuntimeConfig: any = getConfig() && getConfig().publicRuntimeConfig ? getConfig().publicRuntimeConfig : process.env;
const HIDE_ENVIRONMENT: unknown = publicRuntimeConfig.HIDE_ENVIRONMENT;

export type OtherControllers = Record<string, {
Expand Down
27 changes: 9 additions & 18 deletions controller/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,35 +121,26 @@ const nextConfig = {
HIDE_ENVIRONMENT: process.env.HIDE_ENVIRONMENT,
},
// https://github.com/vercel/next.js/discussions/11493#discussioncomment-14606
env: { // These are sent to the client and the server and are set at build time
// @ts-ignore
LoggingLevel: process.env.LoggingLevel,
env: { // These are sent to the client and the server and are set at build time for static pages
LoggingLevel: process.env.LoggingLevel || "", // Only checks if debug
// @ts-ignore
APPLICATION_NAME: process.env.APPLICATION_NAME,
// @ts-ignore
SYSTEM_NAME: process.env.SYSTEM_NAME,
// @ts-ignore
FS_SITE: process.env.FS_SITE,
FS_SITE: process.env.FS_SITE, // Used by auth client/Layout
// @ts-ignore
BASE_PATH: process.env.BASE_PATH,
BASE_PATH: process.env.BASE_PATH, // client utils/Layout
// @ts-ignore
ASSET_PREFIX: process.env.ASSET_PREFIX,
ASSET_PREFIX: process.env.ASSET_PREFIX, // client utils/Layout
// @ts-ignore
TEST_STATUS_REFRESH_DELAY: process.env.TEST_STATUS_REFRESH_DELAY,
HIDE_ENVIRONMENT: process.env.HIDE_ENVIRONMENT, // Used by Layout
// @ts-ignore
TEST_ERRORS_MAX_DISPLAYED: process.env.TEST_ERRORS_MAX_DISPLAYED,
AUTH_MODE: process.env.AUTH_MODE, // Used by auth client/Layout
// @ts-ignore
TEST_ERRORS_MAX_LINE_LENGTH: process.env.TEST_ERRORS_MAX_LINE_LENGTH,
AUTH_COOKIE_NAME: process.env.AUTH_COOKIE_NAME, // Used by auth client/Layout
// @ts-ignore
REDIRECT_TO_S3: process.env.REDIRECT_TO_S3,
// @ts-ignore
UNZIP_S3_FILES: process.env.UNZIP_S3_FILES,
// @ts-ignore
AUTH_MODE: process.env.AUTH_MODE,
// @ts-ignore
AUTH_COOKIE_NAME: process.env.AUTH_COOKIE_NAME,
// @ts-ignore
AUTH_HEADER_NAME: process.env.AUTH_HEADER_NAME,
AUTH_HEADER_NAME: process.env.AUTH_HEADER_NAME, // Used by auth client/Layout
}
};

Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"./controller"
],
"scripts": {
"start": "npm-run-all --parallel startagent startcontroller",
"startcontroller": "cd controller && npm run start",
"startagent": "cd agent && npm run start",
"start": "npm-run-all --parallel start:agent start:controller",
"start:controller": "cd controller && npm run start",
"start:agent": "cd agent && npm run start",
"dev": "cd controller && npm run dev",
"build": "npm run lint && npm run build:common && npm run build:agent && npm run build:controller",
"storybook": "cd controller && npm run storybook",
Expand All @@ -35,9 +35,11 @@
"test:common": "cd common && npm run test",
"test:agent": "cd agent && npm run test",
"test:controller": "cd controller && npm run test",
"acceptance": "npm run acceptance:agent && npm run acceptance:controller",
"acceptance:all": "npm-run-all --parallel start acceptance:sleep",
"acceptance:sleep": "sleep 30 && npm run acceptance",
"acceptance": "npm-run-all --serial acceptance:agent acceptance:controller",
"acceptance:agent": "cd agent && npm run acceptance",
"acceptance:controller": "cd agent && npm run acceptance",
"acceptance:controller": "cd controller && npm run acceptance",
"integration": "npm-run-all --serial lint integration:common integration:agent integration:controller testmerge",
"integration:common": "cd common && npm run integration",
"integration:agent": "cd agent && npm run integration",
Expand Down
16 changes: 7 additions & 9 deletions pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ npm run linterror
npm run build:react
NODE_ENV=test npm test

# terminal 1
# npm run testcleanup
# npm run coverage
# grab screenshot
# cd controller/ && npm run testcleanup

# terminal 2
# cd controller/ && npm start
# terminal 3
# cd controller/ && npm run acceptance
# grab screenshot
# echo grab screenshot

# 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
Loading