Skip to content

Commit

Permalink
Automatic processing of settlement finalization report (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
partiallyordered authored Dec 9, 2021
1 parent 7afe48e commit 202eaa0
Show file tree
Hide file tree
Showing 101 changed files with 18,638 additions and 11,813 deletions.
4 changes: 3 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"syntax-async-functions",
"@babel/plugin-transform-runtime"
],
"browsers": "> 0.25%, not dead"
"targets": {
"browsers": "> 0.25%, not dead"
}
}
11 changes: 10 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,16 @@ module.exports = {
'react/jsx-wrap-multilines': 'off',
'react/destructuring-assignment': 'off',
'react/require-default-props': 'off',
'max-len': [1, 120],
'max-len': ['warn', {
code: 120,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
ignoreComments: true,
}],
'no-console': ['warn', { allow: ['error'] }],
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
},
overrides: [
{
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Integration test

on:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
push:
branches:
- '**'
Expand Down Expand Up @@ -81,21 +87,28 @@ jobs:
run: kubectl port-forward --address 0.0.0.0 voodoo-doll 3030 &

- name: Install test dependencies
working-directory: integration_test/tests
working-directory: integration_test/e2e-ui-tests
run: |-
npm ci
- name: Run tests
working-directory: integration_test/tests
working-directory: integration_test/e2e-ui-tests
run: |-
FINANCE_PORTAL_ENDPOINT="http://localhost:3000" npm run test:headless
INGRESS_PORT="3000" FINANCE_PORTAL_ENDPOINT="http://localhost:3000" npm run test:headless
- name: Archive test report
- name: Archive screenshots
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-report
path: integration_test/tests/report.html
name: failure-screenshots
path: 'integration_test/e2e-ui-tests/screenshots/'

- name: Archive settlement finalization reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: finalization-reports
path: '**/settlement-finalization-report*.xlsx'

- name: Print docker containers to check any issues with the cluster
if: ${{ failure() }}
Expand All @@ -119,6 +132,6 @@ jobs:
kubectl get secrets -o json | jq -r '.items[] | { name: .metadata.name, data: .data | map_values(@base64d) }'
- name: Setup tmate session
if: ${{ failure() }}
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 10
13 changes: 13 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Unit test

on: [push]

jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn install
- name: Run tests
run: yarn run test:unit
2 changes: 1 addition & 1 deletion .github/workflows/validate-chart.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Validate chart

on: [pull_request]
on: [push]

jobs:
manifest_validation:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:10.13-alpine
FROM node:16.13-alpine
# First part, build the app
WORKDIR /app
COPY package.json /app/
Expand All @@ -18,4 +18,4 @@ RUN yarn run build

EXPOSE 8080

ENTRYPOINT [ "yarn", "serve:prod" ]
ENTRYPOINT [ "yarn", "serve:prod" ]
4 changes: 2 additions & 2 deletions helm/finance-portal-v2-ui/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "v2.5.1"
appVersion: "v3.0.0"
description: Mojaloop Finance Portal UI v2
name: finance-portal-v2-ui
version: 2.5.1
version: 3.0.0
2 changes: 1 addition & 1 deletion helm/finance-portal-v2-ui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ replicaCount: 1

image:
repository: ghcr.io/mojaloop/finance-portal-v2-ui
tag: v2.5.1
tag: v3.0.0
pullPolicy: IfNotPresent

imagePullCredentials:
Expand Down
12 changes: 9 additions & 3 deletions integration_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,29 @@ yarn start
```

#### Install integration test npm dependencies
In the `integration_test/tests` directory:
In the `integration_test/e2e-ui-tests` directory:
```sh
npm ci
```

### Run tests
In the `integration_test/tests` directory:
In the `integration_test/e2e-ui-tests` directory:
```sh
npm run test
```

#### View results
In the `integration_test/tests` directory:
In the `integration_test/e2e-ui-tests` directory:
```sh
$BROWSER results.html
```

#### Debug tests
Add a call to `await t.debug()` in your test. This will trigger a breakpoint in the browser while
the tests are executing, at which point you can step through the test and/or interact with the UI.
See: https://testcafe.io/documentation/402835/guides/basic-guides/debug#client-side-debugging
#### Run a single test
```sh
npm run test -- -t 'name of test'
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
FINANCE_PORTAL_ENDPOINT=http://localhost:3000
INGRESS_PORT=8000
File renamed without changes.
2 changes: 2 additions & 0 deletions integration_test/e2e-ui-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# The test suite creates xlsx files in this directory, we don't want to commit them
**/*.xlsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"reporter": {
"name": "html",
"output": "report.html"
},
"src": "src/tests/*.test.ts",
"screenshots": {
"takeOnFails": true
},
"compilerOptions": {
"typescript": {
"customCompilerModulePath": "../ts4",
Expand Down
Loading

0 comments on commit 202eaa0

Please sign in to comment.