Skip to content

Commit

Permalink
fix: integration test results not exported
Browse files Browse the repository at this point in the history
  • Loading branch information
crystall-bitquill committed Nov 30, 2024
1 parent 71ed378 commit 0e2eedc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
1 change: 1 addition & 0 deletions jest.integration.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"moduleNameMapper": {
"^uuid$": "uuid"
},
"globalSetup": "<rootDir>/tests/integration/container/tests/setup.ts",
"setupFilesAfterEnv": ["<rootDir>/tests/integration/container/tests/config.ts"],
"testEnvironment": "node",
"extensionsToTreatAsEsm": [".ts"],
Expand Down
5 changes: 0 additions & 5 deletions tests/integration/container/tests/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,3 @@ const testInfo = JSON.parse(infoJson);
const request = testInfo.request;
export const features = request.features;
export const instanceCount = request.numOfInstances;

const reportSetting: string = `${request.deployment}-${request.engine}_instance-${request.instanceCount}`;
process.env["JEST_HTML_REPORTER_OUTPUT_PATH"] = `./tests/integration/container/reports/${reportSetting}.html`;
process.env["JEST_HTML_REPORTER_INCLUDE_FAILURE_MSG"] = "true";
process.env["JEST_HTML_REPORTER_INCLUDE_CONSOLE_LOG"] = "true";
31 changes: 31 additions & 0 deletions tests/integration/container/tests/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

const infoJson = process.env.TEST_ENV_INFO_JSON;
if (infoJson === undefined) {
throw new Error("env var required");
}

const testInfo = JSON.parse(infoJson);
const request = testInfo.request;

const reportSetting: string = `${request.deployment}-${request.engine}_instance-${request.numOfInstances}`;
process.env["JEST_HTML_REPORTER_OUTPUT_PATH"] = `./tests/integration/container/reports/${reportSetting}.html`;
process.env["JEST_HTML_REPORTER_INCLUDE_FAILURE_MSG"] = "true";
process.env["JEST_HTML_REPORTER_INCLUDE_CONSOLE_LOG"] = "true";

// Required to use globalSetup:
module.exports = async () => {};

0 comments on commit 0e2eedc

Please sign in to comment.