generated from pagopa/template-java-spring-microservice
-
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.
- Loading branch information
Showing
19 changed files
with
621 additions
and
159 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM python:3.11 as build | ||
#-slim as build | ||
|
||
ARG SHELL="/bin/sh" | ||
ARG ALLURE_RELEASE=2.21.0 | ||
ARG ALLURE_REPO=https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
||
ENV ROOT=/app | ||
|
||
COPY ./ $ROOT | ||
|
||
WORKDIR $ROOT | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y install libpq-dev gcc default-jdk\ | ||
&& pip install -r requirements.txt | ||
|
||
RUN curl ${ALLURE_REPO}/${ALLURE_RELEASE}/allure-commandline-${ALLURE_RELEASE}.zip -L -o /tmp/allure-commandline.zip && \ | ||
unzip -q /tmp/allure-commandline.zip -d / | ||
|
||
RUN groupadd --gid ${GID} allure \ | ||
&& useradd --uid ${UID} --gid allure --shell /bin/bash --create-home allure | ||
|
||
ENV ALLURE_HOME=/allure-$ALLURE_RELEASE | ||
ENV ALLURE_HOME_SL=/allure | ||
ENV PATH=$PATH:$ALLURE_HOME/bin | ||
ENV ALLURE_RESOURCES=$ROOT/resources | ||
|
||
FROM build as execution | ||
|
||
ENV PSP_SUBSCRIPTION_KEY "AT_RUNTIME" | ||
ENV ORG_SUBSCRIPTION_KEY "AT_RUNTIME" | ||
ENV TAGS "runnable" | ||
ENV ENV "dev" | ||
|
||
CMD ["sh", "run_test.sh"] |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
[behave] | ||
paths=features | ||
;show_timings = false | ||
;show_skipped = false | ||
;stop = false | ||
log_capture = true | ||
logging_event = INFO | ||
|
||
[behave.formatters] | ||
;html = behave_html_formatter:HTMLFormatter |
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 @@ | ||
{ | ||
"_comment": "this file should be generated by test caller in order to configure systems and variables environment", | ||
"services": { | ||
"node-psp": { | ||
"url": "https://api.dev.platform.pagopa.it/nodo/node-for-psp/v1", | ||
"healthcheck": "/info", | ||
"subscription_key": "" | ||
}, | ||
"fdr-org": { | ||
"url": "https://api.dev.platform.pagopa.it/fdr-org/service/v1", | ||
"healthcheck": "/info", | ||
"subscription_key": "ORG_SUBSCRIPTION_KEY" | ||
} | ||
}, | ||
"global_configuration": { | ||
"psp": "60000000001", | ||
"channel": "15376371009_04", | ||
"channel_password": "PLACEHOLDER", | ||
"organization": "15376371009", | ||
"broker_org": "15376371009", | ||
"broker_psp": "60000000001", | ||
"station": "15376371009_03", | ||
"station_password": "PLACEHOLDER" | ||
} | ||
} |
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 @@ | ||
import json | ||
import os | ||
import logging | ||
|
||
import urllib3 | ||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) | ||
|
||
|
||
def before_all(context): | ||
# initialize precondition cache to avoid check systems up for each scenario | ||
context.precondition_cache = set() | ||
|
||
context.config.setup_logging() | ||
|
||
logging.debug('Global settings: loading configuration') | ||
|
||
more_userdata = json.load(open(os.path.join(context.config.base_dir + "/config/config.json"))) | ||
for key, cfg in more_userdata.get("services").items(): | ||
if cfg.get("subscription_key") is not None: | ||
cfg["subscription_key"] = os.getenv(cfg["subscription_key"]) | ||
|
||
context.config.update_userdata(more_userdata) | ||
|
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,11 @@ | ||
Feature: Verify ko of payments | ||
# Execute a verifyPaymentNotice to not-responding station | ||
|
||
Background: | ||
Given systems up | ||
|
||
@runnable | ||
Scenario: Send verifyPaymentNotice | ||
Given an unique FdR name named flow_name | ||
When PSP sends create request to fdr-microservice with payload | ||
Then PSP receives the HTTP status code 201 to create request |
Binary file not shown.
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,40 @@ | ||
#!/bin/sh | ||
|
||
if [ -z $ENV ] | ||
then | ||
echo "DEV environment..." | ||
else | ||
echo "Setting $ENV environment..." | ||
cp config/config.json config/config.json.orig | ||
dest="api.${ENV}." | ||
sed "s/api.dev./$dest/g" config/config.json > config/config.json.bkp | ||
sleep 1 | ||
mv config/config.json.bkp config/config.json | ||
sleep 1 | ||
fi | ||
|
||
if [ -z $TAGS ] | ||
then | ||
TAGS="runnable" | ||
fi | ||
|
||
if [ -z $JUNIT ] | ||
then | ||
junit="" | ||
else | ||
junit="--junit-directory=junit --junit" | ||
fi | ||
|
||
echo "Run test ..." | ||
rm -rf results junit | ||
|
||
behave --format allure_behave.formatter:AllureFormatter -o results $junit --tags=$TAGS --summary --show-timings -v | ||
|
||
rm -rf results/history && cp -R reports/history results/history 2>/dev/null | ||
|
||
allure generate results -o reports --clean | ||
|
||
if ! [ -z $ENV ] | ||
then | ||
mv config/config.json.orig config/config.json | ||
fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.