generated from pagopa/pagopa-functions-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Andrea De Rinaldis <andrea-deri@users.noreply.github.com>
- Loading branch information
1 parent
0e71e69
commit 1a2370b
Showing
26 changed files
with
1,636 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ target/ | |
|
||
# Log file | ||
*.log | ||
**/yarn.lock | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Integration Tests | ||
👀 Integration tests are in `integration-test/src/` folder. See there for more information. | ||
|
||
## How run in local environment | ||
|
||
To run the integration test from local environment, simply execute this commands: | ||
``` | ||
export API_CONFIG_SUBSCRIPTION_KEY=##SUBSCRIPTION_KEY## \ | ||
export GPD_SUBSCRIPTION_KEY=##SUBSCRIPTION_KEY## \ | ||
export PAYMENTS_REST_SUBSCRIPTION_KEY=##SUBSCRIPTION_KEY## \ | ||
export PAYMENTS_SOAP_SUBSCRIPTION_KEY=##SUBSCRIPTION_KEY## \ | ||
export REPORTING_SUBSCRIPTION_KEY=##SUBSCRIPTION_KEY## \ | ||
export REPORTING_BATCH_CONNECTION_STRING=##QUEUE_CONNECTION_STRING## \ | ||
yarn install && \ | ||
yarn test:${{ parameters.ENV }} | ||
``` | ||
|
||
## How run on Docker 🐳 | ||
|
||
To run the integration tests on docker, you can run from this directory the script: | ||
|
||
|
||
``` shell | ||
sh ./run_integration_test.sh <local|dev|uat|prod> <api-subscription-key> <apiconfig_subkey> <gpd_subkey> <gps_spontaneouspayments_subkey> <gps_donations_subkey> <payments_subkey> | ||
``` | ||
|
||
|
||
ℹ️ _Note_: for **PagoPa ACR** is **required** the login `az acr login -n <acr-name>` | ||
|
||
If you use dev, uat or prod **you test the images on Azure ACR** | ||
|
||
--- | ||
💻 If you want to test your local branch, | ||
``` shell | ||
sh ./run_integration_test.sh local <api-subscription-key> <apiconfig_subkey> <gpd_subkey> <gps_spontaneouspayments_subkey> <gps_donations_subkey> <payments_subkey> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# example: sh ./run_integration_test.sh <smoke|integration> <local|dev|uat|prod> | ||
environment=$1 | ||
containerName="node-container" | ||
|
||
docker stop node-container || true | ||
docker rm node-container || true | ||
|
||
# please see https://github.com/andrea-deri/prebuilt-img-yarn-base for yarn-testing-base image content | ||
docker pull ${CONTAINER_REGISTRY}/yarn-testing-base:latest | ||
docker run -dit --name ${containerName} ${CONTAINER_REGISTRY}/yarn-testing-base:latest | ||
|
||
# run integration tests with yarn | ||
docker cp -a ./src/. ${containerName}:/test | ||
docker exec -i ${containerName} /bin/bash -c " \ | ||
cd ./test | ||
export API_CONFIG_SUBSCRIPTION_KEY=${API_CONFIG_SUBSCRIPTION_KEY} \ | ||
export GPD_SUBSCRIPTION_KEY=${GPD_SUBSCRIPTION_KEY} \ | ||
export PAYMENTS_REST_SUBSCRIPTION_KEY=${PAYMENTS_REST_SUBSCRIPTION_KEY} \ | ||
export PAYMENTS_SOAP_SUBSCRIPTION_KEY=${PAYMENTS_SOAP_SUBSCRIPTION_KEY} \ | ||
export REPORTING_SUBSCRIPTION_KEY=${REPORTING_SUBSCRIPTION_KEY} \ | ||
export REPORTING_BATCH_CONNECTION_STRING=${REPORTING_BATCH_CONNECTION_STRING} | ||
yarn test:${environment}" | ||
|
||
# clean up container | ||
docker stop ${containerName} && docker rm ${containerName} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Integration Test with Cucumber | ||
|
||
## Technology Stack | ||
|
||
- [cucumber js](https://github.com/cucumber/cucumber-js) | ||
- NodeJS v14.17.6 | ||
|
||
## How to start | ||
|
||
- install dependencies: `yarn install` | ||
- run tests: `yarn test:ENV` in `src` folder | ||
|
||
### Note | ||
Before run the test, set a variable `SUBCRIPTION_KEY` in your environment. | ||
|
||
You can configure the endpoints with `./config/env.ENV` file. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Host addresses | ||
host_header=api.dev.platform.pagopa.it | ||
api_config_host=https://api.dev.platform.pagopa.it/apiconfig/auth/api/v1 | ||
gpd_host=https://api.dev.platform.pagopa.it/gpd/api/v1 | ||
reporting_analysis_host=https://api.dev.platform.pagopa.it/gpd-reporting/api/v1 | ||
payments_soap_host=https://api.dev.platform.pagopa.it/gpd-payments/api/v1 | ||
payments_rest_host=https://api.dev.platform.pagopa.it/gpd/payments-receipts-service/v1 | ||
nodo_host=https://api.dev.platform.pagopa.it/nodo | ||
|
||
# Data and setting configuration | ||
creditor_institution_id=77777777777 | ||
broker_id=15376371009 | ||
station_id=15376371009_01 | ||
psp_id=60000000001 | ||
channel_id=60000000001_01 | ||
reporting_batch_wait_execution_sec=120 | ||
include_debug_logs=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Host addresses | ||
host_header=api.dev.platform.pagopa.it | ||
api_config_host=https://api.dev.platform.pagopa.it/apiconfig/auth/api/v1 | ||
gpd_host=https://localhost:8080/gpd/api/v1 # TODO to be changed, only a placeholder | ||
reporting_analysis_host=https://localhost:8080/gpd-reporting/api/v1 # TODO to be changed, only a placeholder | ||
payments_soap_host=https://api.dev.platform.pagopa.it/gpd-payments/api/v1 | ||
payments_rest_host=https://api.dev.platform.pagopa.it/gpd-payment-receipts/api/v1 | ||
nodo_host=https://api.dev.platform.pagopa.it/nodo | ||
|
||
# Data and setting configuration | ||
creditor_institution_id=77777777777 | ||
broker_id=15376371009 | ||
station_id=15376371009_01 | ||
psp_id=60000000001 | ||
channel_id=60000000001_01 | ||
reporting_batch_wait_execution_sec=120 | ||
include_debug_logs=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Host addresses | ||
host_header=api.uat.platform.pagopa.it | ||
api_config_host=https://api.uat.platform.pagopa.it/apiconfig/auth/api/v1 | ||
gpd_host=https://api.uat.platform.pagopa.it/gpd/api/v1 | ||
reporting_analysis_host=https://api.uat.platform.pagopa.it/gpd-reporting/api/v1 | ||
payments_soap_host=https://api.uat.platform.pagopa.it/gpd-payments/api/v1 | ||
payments_rest_host=https://api.uat.platform.pagopa.it/gpd-payment-receipts/api/v1 | ||
nodo_host=https://api.uat.platform.pagopa.it/nodo | ||
|
||
# Data and setting configuration | ||
creditor_institution_id=77777777777 | ||
broker_id=15376371009 | ||
station_id=15376371009_01 | ||
psp_id=60000000001 | ||
channel_id=60000000001_01 | ||
reporting_batch_wait_execution_sec=120 | ||
include_debug_logs=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Feature: All about flow report retrieving workflow - Complete flow | ||
|
||
Background: | ||
Given GPD service running | ||
* APIConfig service running | ||
* GPD Payments service running | ||
* reporting analysis service running | ||
* a paid debt position | ||
* a report flow sent to Node | ||
|
||
Scenario: Reporting - Complete Happy path | ||
When the reporting batch analyzes the reporting flows for the organization | ||
And the client waits its execution | ||
Then the client asks the flow list for the organization | ||
* the client receives status code 200 | ||
* the client receives a non-empty list of flows | ||
And the client asks the detail for one of the report flows | ||
* the client receives status code 200 | ||
* the client receives the flow XML content | ||
And the client asks the detail for the analyzed debt positions | ||
* the client receives status code 200 | ||
* the client receives the payment options with status "REPORTED" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "pagopa-gpd-payments", | ||
"license": "MIT", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"test": "dotenv -e ./config/.env.local yarn cucumber", | ||
"test:dev": "dotenv -e ./config/.env.dev yarn cucumber", | ||
"test:uat": "dotenv -e ./config/.env.uat yarn cucumber", | ||
"cucumber": "npx cucumber-js -r step_definitions --format=summary" | ||
}, | ||
"dependencies": { | ||
"@azure/storage-queue": "^12.12.0", | ||
"@cucumber/cucumber": "^8.4.0", | ||
"axios": "^0.27.2", | ||
"dotenv": "^16.0.3", | ||
"dotenv-cli": "^3.2.0", | ||
"npx": "^10.2.2" | ||
} | ||
} |
Oops, something went wrong.