Skip to content

Commit

Permalink
Merge pull request #40 from pagopa/NOD-576-fdr-test-di-performance
Browse files Browse the repository at this point in the history
[NOD-576] feat: add performance test pipeline
  • Loading branch information
andrea-deri authored May 15, 2024
2 parents 6032f3c + 47a08cb commit 705e6f6
Show file tree
Hide file tree
Showing 30 changed files with 849 additions and 104 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/07_performance_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Performance Test

on:
# schedule:
# - cron: '35 16 * * *'

workflow_dispatch:
inputs:
environment:
required: true
type: choice
description: Select the Environment
options:
- dev
- uat
test-type:
required: true
type: choice
description: Select the Test Type
options:
- ramping
- constant
- load
- smoke
- soak
- spike
- stress
script-name:
required: true
type: choice
description: Select the Script Name
options:
- happy_case_scenario
- only_nodoInviaFlussoRendicontazione_scenario
flow-size:
required: true
type: number
description: Select the number of payments sent in flow
default: 5

permissions:
id-token: write
contents: read
deployments: write

jobs:
run_performance_test:
name: Performance test on ${{(github.event.inputs == null && 'dev') || inputs.environment }}
runs-on: ubuntu-latest
environment: ${{(github.event.inputs == null && 'dev') || inputs.environment }}

steps:
- name: Checkout repository
uses: actions/checkout@1f9a0c22da41e6ebfa534300ef656657ea2c6707

- name: Run k6 script
run: |
cd ./performance-test
sub_key="${{ secrets.INTEGRATION_TEST_SUBSCRIPTION_KEY }}" env="${{ inputs.environment }}" type="${{ inputs.test-type }}" script="${{ inputs.script-name }}" db_name=fdr1_k6 docker compose -f docker-compose.yaml up
# sh ./performance-test/run_performance_test.sh ${{ env.ENVIRONMENT }} ${{ env.TEST_TYPE }} ${{ env.SCRIPT }} ${{ secrets.API_SUBSCRIPTION_KEY }}
#${{ secrets.COSMOS_SUBSCRIPTION_KEY }}
153 changes: 61 additions & 92 deletions fdr/src/main/resources/openapi_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "API-Config Cacher",
"description": "Generate cache for regarding Nodo dei Pagamenti configuration",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.8.3"
"version": "0.9.11"
},
"servers": [
{
Expand Down Expand Up @@ -38,58 +38,34 @@
"tags": [
"Cache"
],
"summary": "Get selected key of cache v1 config",
"summary": "Get selected key of {stakeholder} cache v1 config",
"operationId": "cache",
"parameters": [
{
"name": "refresh",
"in": "query",
"description": "to force the refresh of the cache",
"required": false,
"deprecated": true,
"schema": {
"type": "boolean"
}
},
{
"name": "keys",
"in": "query",
"required": false,
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"creditorInstitutions",
"creditorInstitutionBrokers",
"stations",
"creditorInstitutionStations",
"encodings",
"creditorInstitutionEncodings",
"ibans",
"creditorInstitutionInformations",
"psps",
"pspBrokers",
"paymentTypes",
"pspChannelPaymentTypes",
"plugins",
"pspInformationTemplates",
"pspInformations",
"channels",
"cdsServices",
"cdsSubjects",
"cdsSubjectServices",
"cdsCategories",
"configurations",
"ftpServers",
"languages",
"gdeConfigurations",
"metadataDict"
]
}
}
}
],
"responses": {
"500": {
"description": "Service unavailable",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
Expand All @@ -115,19 +91,6 @@
},
"429": {
"description": "Too many requests"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Service unavailable",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
}
},
"security": [
Expand All @@ -142,17 +105,11 @@
"tags": [
"Cache"
],
"summary": "Get last v1 cache version",
"summary": "Get last v1 {stakeholder} cache version",
"operationId": "idV1",
"responses": {
"404": {
"description": "Not Found"
},
"403": {
"description": "Forbidden"
},
"400": {
"description": "Bad Request",
"500": {
"description": "Service unavailable",
"content": {
"application/json": {
"schema": {
Expand All @@ -161,8 +118,14 @@
}
}
},
"429": {
"description": "Too many requests"
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
},
"200": {
"description": "OK",
Expand All @@ -174,18 +137,18 @@
}
}
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Service unavailable",
"400": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemJson"
}
}
}
},
"429": {
"description": "Too many requests"
}
},
"security": [
Expand All @@ -198,6 +161,28 @@
},
"components": {
"schemas": {
"ProblemJson": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable"
},
"status": {
"maximum": 600,
"minimum": 100,
"type": "integer",
"description": "The HTTP status code generated by the origin server for this occurrence of the problem.",
"format": "int32",
"example": 200
},
"detail": {
"type": "string",
"description": "A human readable explanation specific to this occurrence of the problem.",
"example": "There was an error processing the request"
}
}
},
"BrokerCreditorInstitution": {
"required": [
"broker_code",
Expand Down Expand Up @@ -423,6 +408,9 @@
},
"flag_travaso": {
"type": "boolean"
},
"flag_standin": {
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -1137,6 +1125,9 @@
"primitive_version": {
"type": "integer",
"format": "int32"
},
"flag_standin": {
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -1206,28 +1197,6 @@
}
}
},
"ProblemJson": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable"
},
"status": {
"maximum": 600,
"minimum": 100,
"type": "integer",
"description": "The HTTP status code generated by the origin server for this occurrence of the problem.",
"format": "int32",
"example": 200
},
"detail": {
"type": "string",
"description": "A human readable explanation specific to this occurrence of the problem.",
"example": "There was an error processing the request"
}
}
},
"CacheVersion": {
"required": [
"version"
Expand All @@ -1249,4 +1218,4 @@
}
}
}
}
}
6 changes: 4 additions & 2 deletions fdr/src/main/scala/eu/sia/pagopa/TestDData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ object TestDData {
true,
true,
2,
false
false,
Some(false)
)
val basePA = CreditorInstitution(TestItems.PA, true, Some("pa DEV ragsoc"), Some("pa DEV descr"), None, true, false, false)
val basePSP = PaymentServiceProvider(TestItems.PSP, true, Some("CFpspTest"), Some("Test-PSP"), Some("ABIAA"), Some("bic"), Some("Test"), true, false, Some("tax"), Some("vat"))
Expand All @@ -50,7 +51,8 @@ object TestDData {
10,
Timeouts(10,10,10),
true,
1
1,
Some(false)
)

val ddataMap: ConfigData = {
Expand Down
6 changes: 4 additions & 2 deletions fdr/src/test/scala/eu/sia/pagopa/testutil/TestDData.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ object TestDData {
true,
true,
2,
false
false,
Some(false)
)
val basePA = CreditorInstitution(TestItems.PA, true, Some("pa DEV ragsoc"), Some("pa DEV descr"), None, true, false, false)
val basePSP = PaymentServiceProvider(TestItems.PSP, true, Some("CFpspTest"), Some("Test-PSP"), Some("ABIAA"), Some("bic"), Some("Test"), true, false, Some("tax"), Some("vat"))
Expand All @@ -50,7 +51,8 @@ object TestDData {
10,
Timeouts(10,10,10),
true,
1
1,
Some(false)
)

val ddataMap: ConfigData = {
Expand Down
4 changes: 2 additions & 2 deletions helm/fdr-cron/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: fdr-cron-chart
description: Flussi di rendicontazione cron job
type: application
version: 2.1.8
appVersion: 2.1.8
version: 2.1.8-NOD-576-fdr-test-di-performance
appVersion: 2.1.8-NOD-576-fdr-test-di-performance
dependencies:
- name: cron-chart
version: 2.3.0
Expand Down
4 changes: 2 additions & 2 deletions helm/fdr/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: fdr-chart
description: Flussi di rendicontazione
type: application
version: 2.1.8
appVersion: 2.1.8
version: 2.1.8-NOD-576-fdr-test-di-performance
appVersion: 2.1.8-NOD-576-fdr-test-di-performance
dependencies:
- name: microservice-chart
version: 3.0.0
Expand Down
1 change: 0 additions & 1 deletion integration-test/config/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"channel": "88888888888_01",
"password": "PLACEHOLDER",
"creditor_institution_code": "15376371009",
"creditor_institution_code_ftp": "15376371009_FTP",
"broker_ci": "15376371009",
"id_station": "15376371009_03"
}
Expand Down
1 change: 0 additions & 1 deletion integration-test/config/uat.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"channel": "88888888888_01",
"password": "PLACEHOLDER",
"creditor_institution_code": "15376371009",
"creditor_institution_code_ftp": "15376371009_FTP",
"broker_ci": "15376371009",
"id_station": "15376371009_03"
}
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "FDR - Flussi di rendicontazione FASE 1",
"description": "FDR - Flussi di rendicontazione FASE 1",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "2.1.8"
"version": "2.1.8-NOD-576-fdr-test-di-performance"
},
"servers": [
{
Expand Down
Loading

0 comments on commit 705e6f6

Please sign in to comment.