Skip to content

Commit

Permalink
Merge pull request #419 from dhis2/remove-reportportal-
Browse files Browse the repository at this point in the history
chore: remove reportportal integration + jira
  • Loading branch information
adeldhis2 authored Nov 29, 2024
2 parents c49b090 + f5c5492 commit f1a4c16
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 73 deletions.
128 changes: 56 additions & 72 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,76 @@
## Technology stack
* [Cypress] (https://www.cypress.io/)
* [Allure] (https://docs.qameta.io/): reporting framework
## Technology stack

- [Cypress] (https://www.cypress.io/)
- [Allure] (https://docs.qameta.io/): reporting framework

## Local execution

1. Check out the relevant branch:
E.g. if you are testing a 2.32.x version of DHIS2
```sh
$ git checkout v32
```
or, if you are testing a 2.38.x version of DHIS2
```sh
$ git checkout v38
```
E.g. if you are testing a 2.32.x version of DHIS2

```sh
$ git checkout v32
```

or, if you are testing a 2.38.x version of DHIS2

```sh
$ git checkout v38
```

2. Install dependencies:
```sh
$ yarn install
```

```sh
$ yarn install
```

3. Set the environment
```sh
export CYPRESS_LOGIN_USERNAME=<dhis2_superuser>
export CYPRESS_LOGIN_PASSWORD=<dhis2_superuser_password>
export CYPRESS_BASE_URL=<instance_URL> # e.g. https://prep.dhis2.org/2.38dev/
...
see [Environment variables section](#environment-variables) for more configuration options
```

```sh
export CYPRESS_LOGIN_USERNAME=<dhis2_superuser>
export CYPRESS_LOGIN_PASSWORD=<dhis2_superuser_password>
export CYPRESS_BASE_URL=<instance_URL> # e.g. https://prep.dhis2.org/2.38dev/
...

see [Environment variables section](#environment-variables) for more configuration options
```
4. Adapt the tests to your environment:
Some of the test feature files include references from the Sierra Leone demo DB. These should be replaced to suit your target DB
Check the following feature files and update the parameters in double-quotes (`"`) accordingly:
```sh
./cypress/e2e/capture.cy.js
```
Some of the test feature files include references from the Sierra Leone demo DB. These should be replaced to suit your target DB
Check the following feature files and update the parameters in double-quotes (`"`) accordingly:
```sh
./cypress/e2e/capture.cy.js
```
5. Run the tests:
```sh
$ yarn run cy:test
```
or in parallel (using 3 threads):
```sh
$ yarn run cy:parallel
```
or only smoke tests:
```sh
$ export TAGS=smoke
$ yarn run cy:test (or any other command)
```
## Environment variables
```sh
$ yarn run cy:test
```
| Environment variable | Description | Required | Default value |
|---|---|---|---|
| CYPRESS_BASE_URL | URL of instance under test | true | smoke.dhis2.org/dev_smoke |
| CYPRESS_LOGIN_USERNAME | username of user used in tests | true | admin |
| CYPRESS_LOGIN_PASSWORD | password of user used in tests | true | district |
| RP_TOKEN | token of the report portal user. Only used if running cy:parallel-report | false | N/A |
| CI_BUILD_ID | used as an attribute in RP launches to be able to merge the launches after all tests | false | |
| JIRA_ENABLED | boolean parameter used to control integration with jira reporter | false | N/A |
| JIRA_USERNAME | username of the jira user | if JIRA_ENABLED | N/A |
| JIRA_PASSWORD | password of the jira user | if JIRA_ENABLED | N/A |
| JIRA_RELEASE_VERSION_NAME| version of the release cycle in zephyr | if JIRA_ENABLED | N/A |
| TAGS | filter tests matching specified tags | false | |
or in parallel (using 3 threads):
```sh
$ yarn run cy:parallel
```
## Reporting
### Allure
[Allure](https://docs.qameta.io/allure/) is the framework used to generate a test report. To generate and serve the report, run `yarn run allure:serve`. The report should open in a browser window.
or only smoke tests:
### Report portal
```sh
$ export TAGS=smoke
$ yarn run cy:test (or any other command)
```
To enable syncing with report portal, the following environment variables are required:
## Environment variables
| Environment variable | Description |
|--|--|
| RP_TOKEN | Token of report portal user. Can be found in [user profile of report portal](https://test.tools.dhis2.org/reportportal/ui/#user-profile) |
| CI_BUILD_ID | An attribute to add to every launch started by report portal used to merge the launches after test run. |
| Environment variable | Description | Required | Default value |
| ---------------------- | ------------------------------------ | -------- | ------------------------- |
| CYPRESS_BASE_URL | URL of instance under test | true | smoke.dhis2.org/dev_smoke |
| CYPRESS_LOGIN_USERNAME | username of user used in tests | true | admin |
| CYPRESS_LOGIN_PASSWORD | password of user used in tests | true | district |
| TAGS | filter tests matching specified tags | false | |
### JIRA
The following environment variables are required to sync with jira:
## Reporting
### Allure
| Environment variable | Description |
|--|--|
| JIRA_ENABLED | boolean parameter used to control integration with jira reporter |
| JIRA_USERNAME | username of the jira user |
| JIRA_PASSWORD | password of the jira user |
| JIRA_RELEASE_VERSION_NAME| version of the release cycle in zephyr |
[Allure](https://docs.qameta.io/allure/) is the framework used to generate a test report. To generate and serve the report, run `yarn run allure:serve`. The report should open in a browser window.
1 change: 0 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "./commands/wait.js";
import "./commands/logs.js";
//require('@reportportal/agent-js-cypress/lib/commands/reportPortalCommands');

// Cypress throws an exception in dashboard tests when scrolling/using the viewport.
// This disables that exception.
Expand Down

0 comments on commit f1a4c16

Please sign in to comment.