Skip to content

Commit

Permalink
fix: update REPORTER_CONSTANTS.ts
Browse files Browse the repository at this point in the history
Signed-off-by: mdolhalo <[email protected]>
  • Loading branch information
mdolhalo committed Oct 25, 2023
1 parent 57ca75b commit f86a542
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
3 changes: 2 additions & 1 deletion tests/e2e/configs/mocharc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ module.exports = {
: MOCHA_CONSTANTS.MOCHA_USERSTORY
? [`dist/specs/**/${MOCHA_CONSTANTS.MOCHA_USERSTORY}.spec.js`, `dist/specs/${MOCHA_CONSTANTS.MOCHA_USERSTORY}.spec.js`]
: ['dist/specs/**/**.spec.js', 'dist/specs/**.spec.js'],
retries: MOCHA_CONSTANTS.MOCHA_RETRIES
retries: MOCHA_CONSTANTS.MOCHA_RETRIES,
grep: MOCHA_CONSTANTS.MOCHA_GREP
};
9 changes: 9 additions & 0 deletions tests/e2e/configs/reporters.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ module.exports = {
value: `${BASE_TEST_CONSTANTS.TESTING_APPLICATION_VERSION}`
},
{
key: 'ocp version',
value: `${BASE_TEST_CONSTANTS.OCP_VERSION}`
},
{
key: 'ocp infra',
value: `${BASE_TEST_CONSTANTS.OCP_INFRA}`
},
{
key: 'application',
value: BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME()
},
{
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/configs/sh-scripts/runFunctionalTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ validateParameters(){
launchAPITests() {
export MOCHA_SUITE="APITest"
echo "MOCHA_SUITE = ${MOCHA_SUITE}"
export RP_LAUNCH_NAME="API tests suite"
export RP_LAUNCH_NAME="API tests suite $TEST_ENVIRONMENT"
echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE"
npm run driver-less-test
}

launchDynamicallyGeneratingAPITests() {
export MOCHA_SUITE="DynamicallyGeneratingAPITest"
export RP_LAUNCH_NAME="Application inbuilt DevWorkspaces API tests suite"
export RP_LAUNCH_NAME="Application inbuilt DevWorkspaces API tests suite $TEST_ENVIRONMENT"
echo "MOCHA_SUITE = ${MOCHA_SUITE}"
echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE"
npm run delayed-test
}

launchUITests() {
export MOCHA_SUITE="UITest"
export RP_LAUNCH_NAME="UI tests suite"
export RP_LAUNCH_NAME="UI tests suite $TEST_ENVIRONMENT"
echo "MOCHA_SUITE = ${MOCHA_SUITE}"
echo "suites/$MOCHA_DIRECTORY/$MOCHA_SUITE"
npm run test
Expand Down
5 changes: 4 additions & 1 deletion tests/e2e/constants/MOCHA_CONSTANTS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const MOCHA_CONSTANTS: {
MOCHA_USERSTORY: undefined | string;
MOCHA_RETRIES: string | number;
MOCHA_BAIL: boolean;
MOCHA_GREP: string | undefined;
} = {
MOCHA_DIRECTORY: process.env.MOCHA_DIRECTORY || undefined,

Expand All @@ -30,5 +31,7 @@ export const MOCHA_CONSTANTS: {

MOCHA_RETRIES: process.env.MOCHA_RETRIES || BASE_TEST_CONSTANTS.TEST_ENVIRONMENT === '' ? 0 : 2,

MOCHA_SUITE: process.env.MOCHA_SUITE || undefined
MOCHA_SUITE: process.env.MOCHA_SUITE || undefined,

MOCHA_GREP: process.env.MOCHA_GREP || undefined
};
12 changes: 6 additions & 6 deletions tests/e2e/constants/REPORTER_CONSTANTS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
import { BASE_TEST_CONSTANTS } from './BASE_TEST_CONSTANTS';
import { MOCHA_CONSTANTS } from './MOCHA_CONSTANTS';

export const REPORTER_CONSTANTS: {
DELETE_SCREENCAST_IF_TEST_PASS: boolean;
Expand Down Expand Up @@ -97,12 +98,12 @@ export const REPORTER_CONSTANTS: {
/**
* user name on ReportPortal
*/
RP_USER: process.env.RP_USER || process.env.USER || 'superadmin',
RP_USER: process.env.RP_USER || process.env.USER || process.env.BUILD_USER_ID || '',

/**
* launch name to save report
*/
RP_LAUNCH_NAME: process.env.RP_LAUNCH_NAME || 'Test run',
RP_LAUNCH_NAME: process.env.RP_LAUNCH_NAME || `Test run ${MOCHA_CONSTANTS.MOCHA_USERSTORY}`,

/**
* launch name to save report
Expand Down Expand Up @@ -137,10 +138,9 @@ export const REPORTER_CONSTANTS: {
* project name to save launch
*/
RP_PROJECT: (): string => {
const project: string =
BASE_TEST_CONSTANTS.TEST_ENVIRONMENT !== '' || REPORTER_CONSTANTS.RP_USE_PERSONAL
? `${REPORTER_CONSTANTS.RP_USER}_personal`
: BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME();
const project: string = REPORTER_CONSTANTS.RP_USE_PERSONAL
? `${REPORTER_CONSTANTS.RP_USER}_personal`
: BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME();
return process.env.RP_PROJECT || project;
}
};
2 changes: 1 addition & 1 deletion tests/e2e/specs/SmokeTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
import { expect } from 'chai';
import { BASE_TEST_CONSTANTS } from '../constants/BASE_TEST_CONSTANTS';

suite('The SmokeTest userstory', function (): void {
suite(`The SmokeTest userstory ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void {
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
Expand Down

0 comments on commit f86a542

Please sign in to comment.