-
Notifications
You must be signed in to change notification settings - Fork 0
155 lines (149 loc) · 5.18 KB
/
run_behave_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Run Behave Tests
on:
schedule:
- cron: '0 1 * * *' # Scheduled every day at 01:00 UTC
workflow_dispatch: # Allows manual run
inputs:
environment:
description: "Select the target environment"
required: true
default: uat
type: choice
options:
- dev
- uat
WISP:
type: boolean
description: Run WISP dismantling tests
required: false
default: true
FdR:
type: boolean
description: Run Flussi di Rendicontazione tests
required: false
default: true
jobs:
WISP_integration_tests:
runs-on: ubuntu-latest
name: Run WISP dismantling Integration Tests
if: github.event.inputs.WISP == 'true' || !github.event.inputs.WISP
env:
TARGET_ENVIRONMENT: ${{ github.event.inputs.environment || 'uat' }}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0
with:
python-version: 3.x
- name: Set up JDK
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
with:
distribution: zulu
java-version: 17
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
sudo apt-get install -y jq
- name: 'Load secrets'
run: echo "$SECRETS" >> ./config/.secrets.yaml
env:
SECRETS: ${{ secrets.INTEGRATION_TESTS_SECRETS }}
id: load_secrets
- name: 'Run tests with Behave'
run: |
echo "Running tests in $TARGET_ENV environment"
behave src/bdd/wisp --tags=@runnable --format allure_behave.formatter:AllureFormatter -o allure-results --junit-directory=junit --junit --summary --show-timings -v
env:
TARGET_ENV: ${{ env.TARGET_ENVIRONMENT }}
- name: Load test report history
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Build test report
uses: simple-elf/allure-report-action@91e6ff976a8b2303f2551ca36c39ba5256952c08
if: always()
continue-on-error: true
with:
gh_pages: gh-pages
allure_results: allure-results
allure_report: allure-report
allure_history: allure-history
subfolder: wisp-tests
keep_reports: 30
- name: Publish test report
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
ExtractFailRateWisp:
needs: WISP_integration_tests
if: always()
uses: ./.github/workflows/extract_allure_fail_rate.yml
with:
THRESHOLD: 80
ALLURE_FOLDER: wisp-tests
secrets: inherit
FdR_integration_tests:
runs-on: ubuntu-latest
name: Run Flussi di Rendicontazione Integration Tests
if: github.event.inputs.FdR == 'true' || !github.event.inputs.FdR
env:
TARGET_ENVIRONMENT: ${{ github.event.inputs.environment || 'uat' }}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0
with:
python-version: 3.x
- name: Set up JDK
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
with:
distribution: zulu
java-version: 17
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
sudo apt-get install -y jq
- name: 'Run tests with Behave'
run: |
behave src/bdd/fdr --tags=@runnable --format allure_behave.formatter:AllureFormatter -o allure-results --junit-directory=junit --junit --summary --show-timings -v
- name: Load test report history
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Build test report
uses: simple-elf/allure-report-action@91e6ff976a8b2303f2551ca36c39ba5256952c08
if: always()
continue-on-error: true
with:
gh_pages: gh-pages
allure_results: allure-results
allure_report: allure-report
allure_history: allure-history
subfolder: fdr-tests
keep_reports: 30
- name: Publish test report
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
# ExtractFailRateFdr:
# needs: FdR_integration_tests
# if: always()
# uses: ./.github/workflows/extract_allure_fail_rate.yml
# with:
# THRESHOLD: 80
# ALLURE_FOLDER: fdr-tests
# secrets: inherit