Skip to content

Commit

Permalink
chore: remove commented code and unneeded devDep and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Aug 1, 2024
1 parent 2f32080 commit b21333b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 114 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,77 +101,6 @@ jobs:
reportportal_endpoint: ${{ vars.REPORTPORTAL_ENDPOINT }}
reportportal_project: ${{ vars.REPORTPORTAL_PROJECT }}

# e2e-prod:
# runs-on: ubuntu-latest
# needs: [test, setup-matrix]
# if: "!contains(github.event.head_commit.message, '[skip ci]')"

# strategy:
# fail-fast: false
# matrix:
# spec-group: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}

# env:
# SHOULD_RECORD: ${{ contains(github.event.head_commit.message, '[e2e record]') || contains(join(github.event.pull_request.labels.*.name), 'e2e record') }}

# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 18.x

# - uses: actions/cache@v2
# id: yarn-cache
# with:
# path: '**/node_modules'
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('patches/*.patch') }}

# - name: Set Cypress Record Environment Variables
# if: env.SHOULD_RECORD == 'true'
# run: |
# echo "CYPRESS_GROUP=e2e-${{ matrix.spec-group.id }}" >> $GITHUB_ENV
# echo "CYPRESS_TAG=${{ github.event_name }}" >> $GITHUB_ENV
# echo "CYPRESS_CI_BUILD_ID=${{ github.run_id }}" >> $GITHUB_ENV

# - name: Debug Environment Variables
# run: |
# echo "SHOULD_RECORD=${{ env.SHOULD_RECORD }}"
# echo "CI Build ID=${{ github.run_id }}"
# echo "Computed Group=${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_GROUP || '' }}"
# echo "Computed Tag=${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_TAG || '' }}"
# echo "Computed CI Build ID=${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_CI_BUILD_ID || '' }}"
# echo "Spec=${{ join(matrix.spec-group.tests, ',') }}"

# - name: End-to-End tests
# uses: cypress-io/github-action@v5
# with:
# start: ${{ env.SERVER_START_CMD }}
# wait-on: ${{ env.SERVER_URL }}
# wait-on-timeout: 300
# cache-key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('patches/*.patch') }}
# record: ${{ env.SHOULD_RECORD }}
# parallel: ${{ env.SHOULD_RECORD }}
# group: ${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_GROUP || '' }}
# tag: ${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_TAG || '' }}
# ci-build-id: ${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_CI_BUILD_ID || '' }}
# spec: ${{ join(matrix.spec-group.tests, ',') }}
# env:
# CI: true
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
# SERVER_START_CMD: 'yarn cy:start'
# SERVER_URL: 'http://localhost:3000'
# cypress_dhis2_api_stub_mode: 'DISABLED'
# REACT_APP_DHIS2_BASE_URL: ${{ secrets.CYPRESS_DHIS2_BASE_URL_41 }}
# cypress_dhis2_base_url: ${{ secrets.CYPRESS_DHIS2_BASE_URL_41}}
# cypress_dhis2BaseUrl: ${{ secrets.CYPRESS_DHIS2_BASE_URL_41}}
# CYPRESS_dhis2Username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
# CYPRESS_dhis2Password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }}
# CYPRESS_dhis2InstanceVersion: '2.41'
# cypress_dhis2_username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
# cypress_dhis2_password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
runs-on: ubuntu-latest
needs: call-workflow-e2e-prod
Expand Down
32 changes: 12 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,9 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

#### Configuration

Two environment variables need to be set for running dashboards-app in development mode. It is recommended to set these environment variables in a `.env` or `.env.local` file.

##### api base url: REACT_APP_DHIS2_BASE_URL

The api base url points to a running DHIS2 instance. This can be for example `http://localhost:8080`.

```
REACT_APP_DHIS2_BASE_URL=http://localhost:8080
```

##### api authentication: REACT_APP_DHIS2_AUTHORIZATION

In order for event reports and event charts to display in development mode, you also need to provide the authenticaion credentials for the api. The following example is the base64 encoded value for the username/password combination of `admin:district`:
In order for event reports and event charts to display in development mode, you need to set up the REACT_APP_DHIS2_AUTHORIZATION environment variable. The following example is the base64 encoded value for the username/password combination of `admin:district`:

```
REACT_APP_DHIS2_AUTHORIZATION=Basic YWRtaW46ZGlzdHJpY3Q=
Expand All @@ -31,23 +21,25 @@ REACT_APP_DHIS2_AUTHORIZATION=Basic YWRtaW46ZGlzdHJpY3Q=

#### Configuration

Additional environment variables are needed in order to run the Cypress e2e tests. It is recommended to define these in the same place as the REACT_APP_DHIS2_BASE_URL env var (for example. `.env`). REACT_APP_DHIS2_BASE_URL and CYPRESS_DHIS2_BASE_URL must match.
Additional environment variables are needed in order to run the Cypress e2e tests. You can configure these in a local file `cypress.env.json`

```
REACT_APP_DHIS2_BASE_URL=http://localhost:8080
CYPRESS_DHIS2_BASE_URL=http://localhost:8080
CYPRESS_DHIS2_USERNAME=admin
CYPRESS_DHIS2_PASSWORD=district
{
"dhis2BaseUrl": "https://test.e2e.dhis2.org/analytics-2.41",
"dhis2InstanceVersion": "2.41",
"dhis2Username": "admin",
"dhis2Password": "district"
}
```

#### Run the e2e tests

The following commands can be used to run the tests:

| Comman | Backend | Environment | Tests |
| -------------- | :--------: | ----------: | ----: |
| `yarn cy:open` | API server | Cypress UI | All |
| `yarn cy:run` | API server | Headless | All |
| Comman | Environment | Tests |
| -------------- | ----------: | ----: |
| `yarn cy:open` | Cypress UI | All |
| `yarn cy:run` | Headless | All |

### `yarn test`

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"@cypress/webpack-preprocessor": "^6.0.2",
"@dhis2/cli-app-scripts": "^10.3.10",
"@dhis2/cli-style": "^10.5.1",
"@dhis2/cli-utils-cypress": "^10.0.6",
"@dhis2/cypress-commands": "^10.0.6",
"@dhis2/cypress-plugins": "^10.0.6",
"@testing-library/jest-dom": "^6.1.2",
Expand Down
22 changes: 0 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2434,21 +2434,6 @@
workbox-build "^6.1.5"
workbox-webpack-plugin "^6.5.4"

"@dhis2/cli-helpers-engine@^2.3.0":
version "2.4.0"
resolved "https://registry.yarnpkg.com/@dhis2/cli-helpers-engine/-/cli-helpers-engine-2.4.0.tgz#1609d358088f0616fb400aa9f90fc8bb57d4b196"
integrity sha512-SRcN3s/sQTkd5VUbWAs2+UeYtJ0zLdj4F/RkrL8x2/RX/79vIxvryqBom4FFw/meY0c2GDpXgrpKNQcST/OHBQ==
dependencies:
chalk "^3.0.0"
cross-spawn "^7.0.3"
find-up "^5.0.0"
fs-extra "^8.0.1"
inquirer "^7.3.3"
request "^2.88.0"
tar "^4.4.8"
update-notifier "^3.0.0"
yargs "^13.1.0"

"@dhis2/cli-helpers-engine@^3.0.0", "@dhis2/cli-helpers-engine@^3.2.0":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@dhis2/cli-helpers-engine/-/cli-helpers-engine-3.2.1.tgz#80d3f5b50ae223e5ed3f91550c81c30c3d7741a7"
Expand Down Expand Up @@ -2488,13 +2473,6 @@
semver "^7.3.5"
yargs "^16.2.0"

"@dhis2/cli-utils-cypress@^10.0.6":
version "10.0.6"
resolved "https://registry.yarnpkg.com/@dhis2/cli-utils-cypress/-/cli-utils-cypress-10.0.6.tgz#916d92d32098f24679bf0f4b6b8bd98c51159a97"
integrity sha512-cOey0v4QE1ZagVgnG0C7yj1bL8p5AVtdb498HbNBbL0Us78pbDBQFYfxoQk88o3E1LvIK48ueJtaADNXfOr80A==
dependencies:
"@dhis2/cli-helpers-engine" "^2.3.0"

"@dhis2/cypress-commands@^10.0.6":
version "10.0.6"
resolved "https://registry.yarnpkg.com/@dhis2/cypress-commands/-/cypress-commands-10.0.6.tgz#2ef6a5bc0a737703993f63b9465d00727a1d0ff6"
Expand Down

0 comments on commit b21333b

Please sign in to comment.