Skip to content

Commit

Permalink
test: send test results to report portal dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
adeldhis2 committed Sep 5, 2023
1 parent 41d8557 commit 813ad49
Show file tree
Hide file tree
Showing 6 changed files with 329 additions and 186 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,22 @@ jobs:

- name: Test
run: yarn d2-app-scripts test
env:
REPORTPORTAL_API_KEY: ${{ secrets.REPORTPORTAL_API_KEY }}
REPORTPORTAL_ENDPOINT: ${{ vars.REPORTPORTAL_ENDPOINT }}
REPORTPORTAL_PROJECT: ${{ vars.REPORTPORTAL_PROJECT }}

call-workflow-e2e-prod:
needs: [build, lint, test]
uses: dhis2/line-listing-app/.github/workflows/e2e-prod.yml@master
uses: dhis2/workflows/.github/workflows/analytics-e2e-tests.yml@master
secrets:
baseurl: ${{ secrets.CYPRESS_DHIS2_BASE_URL_DEV }}
username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }}
recordkey: ${{ secrets.CYPRESS_RECORD_KEY }}
reportportal_api_key: ${{ secrets.REPORTPORTAL_API_KEY }}
reportportal_endpoint: ${{ vars.REPORTPORTAL_ENDPOINT }}
reportportal_project: ${{ vars.REPORTPORTAL_PROJECT }}

release:
runs-on: ubuntu-latest
Expand Down
119 changes: 0 additions & 119 deletions .github/workflows/e2e-prod.yml

This file was deleted.

28 changes: 28 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,34 @@ async function setupNodeEvents(on, config) {

module.exports = defineConfig({
projectId: 'sojh88',
reporter: '@reportportal/agent-js-cypress',
reporterOptions: {
endpoint: process.env.REPORTPORTAL_ENDPOINT,
apiKey: process.env.REPORTPORTAL_API_KEY,
launch: 'data_visualizer_app_master',
project: process.env.REPORTPORTAL_PROJECT,
description: '',
autoMerge: true,
parallel: true,
debug: false,
restClientConfig: {
timeout: 360000,
},
attributes: [
{
key: 'version',
value: 'master',
},
{
key: 'app_name',
value: 'data_visualizer_app',
},
{
key: 'test_level',
value: 'e2e',
},
],
},
e2e: {
setupNodeEvents,
baseUrl: 'http://localhost:3000',
Expand Down
37 changes: 37 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
transformIgnorePatterns: [
'node_modules/(?!(lodash-es|@dhis2/d2-ui-[a-z-]+)/)',
],
setupFilesAfterEnv: ['./config/testSetup.js'],

testRunner: 'jest-circus/runner',
testRegex: ['/src/modules/__tests__/.*.spec.js?$'],
reporters: [
'default',
[
'@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,
},
],
],
}
10 changes: 2 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"@dhis2/cli-style": "^10.5.1",
"@dhis2/cypress-commands": "^10.0.3",
"@dhis2/cypress-plugins": "^10.0.2",
"@reportportal/agent-js-cypress": "^5.1.3",
"@reportportal/agent-js-jest": "^5.0.6",
"cypress": "^12.16.0",
"cypress-tags": "^1.1.2",
"enzyme": "^3.11.0",
Expand Down Expand Up @@ -64,13 +66,5 @@
"reselect": "^4.1.7",
"styled-jsx": "^4",
"whatwg-fetch": "^3.6.2"
},
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!(lodash-es|@dhis2/d2-ui-[a-z-]+)/)"
],
"setupFilesAfterEnv": [
"./config/testSetup.js"
]
}
}
Loading

0 comments on commit 813ad49

Please sign in to comment.