Skip to content

Commit

Permalink
Merge pull request #460 from dhis2/reportportal-line-listing
Browse files Browse the repository at this point in the history
chore: send test results to reportportal dashboard
  • Loading branch information
adeldhis2 authored Nov 27, 2023
2 parents e89fd9d + 8ef034e commit aef69c0
Show file tree
Hide file tree
Showing 5 changed files with 357 additions and 68 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ 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:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
Expand All @@ -82,6 +86,9 @@ jobs:
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
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: 'm5qvjx',
reporter: '@reportportal/agent-js-cypress',
reporterOptions: {
endpoint: process.env.REPORTPORTAL_ENDPOINT,
apiKey: process.env.REPORTPORTAL_API_KEY,
launch: 'line_listing_app',
project: process.env.REPORTPORTAL_PROJECT,
description: '',
autoMerge: true,
parallel: true,
debug: false,
restClientConfig: {
timeout: 660000,
},
attributes: [
{
key: 'dhis2_version',
value: process.env.DHIS2_VERSION,
},
{
key: 'app_name',
value: 'line_listing_app',
},
{
key: 'test_level',
value: 'e2e',
},
],
},
e2e: {
setupNodeEvents,
baseUrl: 'http://localhost:3000',
Expand Down
39 changes: 39 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
transformIgnorePatterns: [
'node_modules/(?!(lodash-es|@dhis2/d2-ui-[a-z-]+)/)',
],
setupFilesAfterEnv: ['./config/testSetup.js'],
moduleNameMapper: {
'\\.(css)$': 'identity-obj-proxy',
},
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: 'line_listing_app',
attributes: [
{
key: 'dhis2_version',
value: 'master',
},
{
key: 'app_name',
value: 'line_listing_app',
},
{
key: 'test_level',
value: 'unit/integration',
},
],
description: '',
debug: true,
},
],
],
}
13 changes: 2 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"@dhis2/cli-style": "^10.4.3",
"@dhis2/cypress-commands": "^10.0.3",
"@dhis2/cypress-plugins": "^10.0.2",
"@reportportal/agent-js-cypress": "git+https://github.com/dhis2/agent-js-cypress.git#develop",
"@reportportal/agent-js-jest": "^5.0.7",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.4",
"cypress": "^13.2.0",
Expand Down Expand Up @@ -58,17 +60,6 @@
"reselect": "^4.1.5",
"styled-jsx": "^4.0.1"
},
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!(lodash-es|@dhis2/d2-ui-[a-z-]+)/)"
],
"setupFilesAfterEnv": [
"./config/testSetup.js"
],
"moduleNameMapper": {
"\\.css$": "identity-obj-proxy"
}
},
"resolutions": {
"@dhis2/ui": "^8.3.1",
"i18next": "^20.5.0"
Expand Down
Loading

0 comments on commit aef69c0

Please sign in to comment.