diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index 95cc70b511..ccd034148b 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -89,6 +89,9 @@ jobs: REPORTPORTAL_API_KEY: ${{ secrets.REPORTPORTAL_API_KEY }} REPORTPORTAL_ENDPOINT: ${{ vars.REPORTPORTAL_ENDPOINT }} REPORTPORTAL_PROJECT: ${{ vars.REPORTPORTAL_PROJECT }} + CI_BUILD_ID: ${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + PR_TITLE: ${{ github.event.pull_request.title }} call-workflow-e2e-prod: if: "!contains(github.event.head_commit.message, '[skip ci]')" diff --git a/jest.config.js b/jest.config.js index 0682ea6a31..6aec29d7c9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,42 @@ -console.log('JEST CONFIG', process.env) +const reportPortalConfig = [ + '@reportportal/agent-js-jest', + { + apiKey: process.env.REPORTPORTAL_API_KEY, + endpoint: process.env.REPORTPORTAL_ENDPOINT, + project: process.env.REPORTPORTAL_PROJECT, + launch: 'maps_app', + attributes: [ + { + key: 'dhis2_version', + value: 'master', + }, + { + key: 'app_name', + value: 'data-visualizer-app', + }, + { + key: 'test_level', + value: 'unit/integration', + }, + { + key: 'BRANCH_NAME', + value: process.env.BRANCH_NAME, + }, + { + key: 'CI_BUILD_ID', + value: process.env.CI_BUILD_ID, + }, + { + key: 'PR_TITLE', + value: process.env.PR_TITLE, + }, + ], + description: '', + debug: true, + }, +] + +const isGithubActionsRun = process.env.CI === 'true' module.exports = { transformIgnorePatterns: [ @@ -7,32 +45,5 @@ module.exports = { setupFilesAfterEnv: ['./config/testSetup.js'], testRunner: 'jest-circus/runner', - reporters: [ - 'github-actions', - [ - '@reportportal/agent-js-jest', - { - apiKey: process.env.REPORTPORTAL_API_KEY, - endpoint: process.env.REPORTPORTAL_ENDPOINT, - project: process.env.REPORTPORTAL_PROJECT, - launch: 'data_visualizer_app_master', - attributes: [ - { - key: 'version', - value: 'master', - }, - { - key: 'app_name', - value: 'data_visualizer_app', - }, - { - key: 'test_level', - value: 'unit/integration', - }, - ], - description: '', - debug: true, - }, - ], - ], + reporters: ['default', ...(isGithubActionsRun ? [reportPortalConfig] : [])], }