1010 - integration
1111 paths :
1212 - frontend/**
13+ - backend/**
14+ - playwright/e2e/**
15+ - integration/**
1316 - .github/workflows/regression.yml
1417 pull_request :
1518 branches :
1619 - develop
1720 - integration
1821 paths :
1922 - frontend/**
20- - .github/workflows/frontend.yml
23+ - backend/**
24+ - playwright/e2e/**
25+ - integration/**
26+ - .github/workflows/regression.yml
2127
2228defaults :
2329 run :
2430 working-directory : ./playwright
2531
2632jobs :
27- test_staging :
33+ test_staging_frontend :
2834 runs-on : ubuntu-latest
2935 environment : staging
3036 timeout-minutes : 60
31- if : github.event_name == 'push' && github.ref == 'refs/heads/develop'
37+ if : ( github.event_name == 'push' && github.ref == 'refs/heads/develop') || (github.event_name == 'pull_request' && github.base_ref == 'develop' && !startsWith(github.actor, 'dependabot'))
3238 env :
3339 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
3440 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -37,12 +43,20 @@ jobs:
3743 AWS_SECURITY_GROUP : ${{ secrets.AWS_SECURITY_GROUP }}
3844 AUTOMATED_TEST_REPORTS_BUCKET_NAME : cisa-crossfeed-staging-cd-automated-test-reports
3945 PW_XFD_URL : https://staging-cd.crossfeed.cyber.dhs.gov
40- PW_XFD_USERNAME : ${{ secrets.PW_XFD_USERNAME }}
41- PW_XFD_PASSWORD : ${{ secrets.PW_XFD_PASSWORD }}
42- PW_XFD_2FA_SECRET : ${{ secrets.PW_XFD_2FA_SECRET }}
43- PW_XFD_LOGIN : ${{ secrets.PW_XFD_USERNAME }}
44- PW_HEADLESS : true
45- PW_CI : true
46+ PW_GLOBAL_ADMIN_USERNAME : ${{ secrets.PW_GLOBAL_ADMIN_USERNAME }}
47+ PW_GLOBAL_ADMIN_PASSWORD : ${{ secrets.PW_GLOBAL_ADMIN_PASSWORD }}
48+ PW_GLOBAL_ADMIN_2FA_SECRET : ${{ secrets.PW_GLOBAL_ADMIN_2FA_SECRET }}
49+ PW_REGIONAL_ADMIN_USERNAME : ${{ secrets.PW_REGIONAL_ADMIN_USERNAME }}
50+ PW_REGIONAL_ADMIN_PASSWORD : ${{ secrets.PW_REGIONAL_ADMIN_PASSWORD }}
51+ PW_REGIONAL_ADMIN_2FA_SECRET : ${{ secrets.PW_REGIONAL_ADMIN_2FA_SECRET }}
52+ PW_GLOBAL_VIEW_USERNAME : ${{ secrets.PW_GLOBAL_VIEW_USERNAME }}
53+ PW_GLOBAL_VIEW_PASSWORD : ${{ secrets.PW_GLOBAL_VIEW_PASSWORD }}
54+ PW_GLOBAL_VIEW_2FA_SECRET : ${{ secrets.PW_GLOBAL_VIEW_2FA_SECRET }}
55+ PW_STANDARD_USER_USERNAME : ${{ secrets.PW_STANDARD_USER_USERNAME }}
56+ PW_STANDARD_USER_PASSWORD : ${{ secrets.PW_STANDARD_USER_PASSWORD }}
57+ PW_STANDARD_USER_2FA_SECRET : ${{ secrets.PW_STANDARD_USER_2FA_SECRET }}
58+ PW_XFD_2FA_ISSUER : ${{ secrets.PW_XFD_2FA_ISSUER }}
59+ CI : true
4660 ENVIRONMENT : staging
4761 GIT_BRANCH : develop
4862 steps :
@@ -52,12 +66,12 @@ jobs:
5266 run : echo "ENVIRONMENT=staging" >> $GITHUB_ENV
5367
5468 - name : Run Playwright tests
69+ id : run_tests
5570 run : |
5671 chmod +x run_playwright_tests.sh
5772 CLUSTER_NAME=crossfeed-playwright-staging-cd-ecs-cluster \
5873 TASK_DEFINITION=crossfeed-staging-cd-playwright-worker \
5974 ./run_playwright_tests.sh
60-
6175 continue-on-error : true
6276
6377 - name : Download test report from S3
7589 - name : Upload Playwright HTML report
7690 uses : actions/upload-artifact@v4
7791 with :
78- name : playwright-html-report
92+ name : playwright-html-report-staging
7993 path : playwright/playwright-report/html/
8094
8195 - name : Upload Playwright results JSON
@@ -84,12 +98,70 @@ jobs:
8498 name : playwright-results-json
8599 path : playwright/playwright-report/results.json
86100
101+ - name : Fail job if tests failed
102+ if : steps.run_tests.outcome != 'success'
103+ run : exit 1
104+
105+
106+ test_staging_api :
107+ runs-on : ubuntu-latest
108+ environment : staging
109+ timeout-minutes : 20
110+ if : false # TODO: Temporarily skip while issues with API testing are resolved.
111+ defaults :
112+ run :
113+ working-directory : ./integration
114+ env :
115+ BACKEND_DOMAIN : https://api.staging-cd.crossfeed.cyber.dhs.gov
116+ X_API_KEY : ${{ secrets.X_API_KEY }}
117+ steps :
118+ - uses : actions/checkout@v3
119+
120+ - name : Set up Python
121+ uses : actions/setup-python@v5
122+ with :
123+ python-version : ' 3.11'
124+
125+ - name : Install dependencies
126+ run : |
127+ python -m pip install --upgrade pip
128+ pip install -r requirements.txt
129+
130+ - name : Run Pytest with HTML and JSON reports
131+ id : run_tests
132+ run : |
133+ mkdir -p test-reports
134+ pytest -m integration \
135+ --tb=short \
136+ --maxfail=5 \
137+ --capture=tee-sys \
138+ --html=test-reports/report.html \
139+ --self-contained-html \
140+ --json-report \
141+ --json-report-file=test-reports/report.json
142+ continue-on-error : true
143+
144+ - name : Upload Pytest HTML Report
145+ uses : actions/upload-artifact@v4
146+ with :
147+ name : pytest-html-report
148+ path : integration/test-reports/report.html
149+
150+ - name : Upload Pytest JSON Report
151+ uses : actions/upload-artifact@v4
152+ with :
153+ name : pytest-json-report
154+ path : integration/test-reports/report.json
155+
156+ - name : Fail job if tests failed
157+ if : steps.run_tests.outcome != 'success'
158+ run : exit 1
87159
88160 test_integration :
89161 runs-on : ubuntu-latest
90162 environment : integration
91163 timeout-minutes : 60
92- if : github.event_name == 'push' && github.ref == 'refs/heads/integration'
164+ if : ( github.event_name == 'push' && github.ref == 'refs/heads/integration') || (github.event_name == 'pull_request' && github.base_ref == 'integration' && !startsWith(github.actor, 'dependabot'))
93165 env :
94166 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
95167 AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -98,11 +170,20 @@ jobs:
98170 AWS_SECURITY_GROUP : ${{ secrets.AWS_SECURITY_GROUP }}
99171 AUTOMATED_TEST_REPORTS_BUCKET_NAME : cisa-crossfeed-integration-automated-test-reports
100172 PW_XFD_URL : https://integration.crossfeed.cyber.dhs.gov
101- PW_XFD_USERNAME : ${{ secrets.PW_XFD_USERNAME }}
102- PW_XFD_PASSWORD : ${{ secrets.PW_XFD_PASSWORD }}
103- PW_XFD_2FA_SECRET : ${{ secrets.PW_XFD_2FA_SECRET }}
104- PW_XFD_LOGIN : ${{ secrets.PW_XFD_USERNAME }} # or hardcode if needed
105- PW_HEADLESS : true
173+ PW_GLOBAL_ADMIN_USERNAME : ${{ secrets.PW_GLOBAL_ADMIN_USERNAME }}
174+ PW_GLOBAL_ADMIN_PASSWORD : ${{ secrets.PW_GLOBAL_ADMIN_PASSWORD }}
175+ PW_GLOBAL_ADMIN_2FA_SECRET : ${{ secrets.PW_GLOBAL_ADMIN_2FA_SECRET }}
176+ PW_REGIONAL_ADMIN_USERNAME : ${{ secrets.PW_REGIONAL_ADMIN_USERNAME }}
177+ PW_REGIONAL_ADMIN_PASSWORD : ${{ secrets.PW_REGIONAL_ADMIN_PASSWORD }}
178+ PW_REGIONAL_ADMIN_2FA_SECRET : ${{ secrets.PW_REGIONAL_ADMIN_2FA_SECRET }}
179+ PW_GLOBAL_VIEW_USERNAME : ${{ secrets.PW_GLOBAL_VIEW_USERNAME }}
180+ PW_GLOBAL_VIEW_PASSWORD : ${{ secrets.PW_GLOBAL_VIEW_PASSWORD }}
181+ PW_GLOBAL_VIEW_2FA_SECRET : ${{ secrets.PW_GLOBAL_VIEW_2FA_SECRET }}
182+ PW_STANDARD_USER_USERNAME : ${{ secrets.PW_STANDARD_USER_USERNAME }}
183+ PW_STANDARD_USER_PASSWORD : ${{ secrets.PW_STANDARD_USER_PASSWORD }}
184+ PW_STANDARD_USER_2FA_SECRET : ${{ secrets.PW_STANDARD_USER_2FA_SECRET }}
185+ PW_XFD_2FA_ISSUER : ${{ secrets.PW_XFD_2FA_ISSUER }}
186+ CI : true
106187 ENVIRONMENT : integration
107188 GIT_BRANCH : integration
108189 steps :
@@ -113,12 +194,12 @@ jobs:
113194
114195 - name : Run Playwright tests
115196 working-directory : ./playwright
197+ id : run_tests
116198 run : |
117199 chmod +x run_playwright_tests.sh
118200 CLUSTER_NAME=crossfeed-playwright-integration-ecs-cluster \
119201 TASK_DEFINITION=crossfeed-integration-playwright-worker \
120202 ./run_playwright_tests.sh
121-
122203 continue-on-error : true
123204
124205 - name : Download test report from S3
@@ -136,11 +217,69 @@ jobs:
136217 - name : Upload Playwright HTML report
137218 uses : actions/upload-artifact@v4
138219 with :
139- name : playwright-html-report
220+ name : playwright-html-report-integration
140221 path : playwright/playwright-report/html/
141222
142223 - name : Upload Playwright results JSON
143224 uses : actions/upload-artifact@v4
144225 with :
145226 name : playwright-results-json
146227 path : playwright/playwright-report/results.json
228+
229+ - name : Fail job if tests failed
230+ if : steps.run_tests.outcome != 'success'
231+ run : exit 1
232+
233+ test_integration_api :
234+ runs-on : ubuntu-latest
235+ environment : integration
236+ timeout-minutes : 20
237+ if : false # TODO: Temporarily skip while issues with API testing are resolved.
238+ defaults :
239+ run :
240+ working-directory : ./integration
241+ env :
242+ BACKEND_DOMAIN : https://api.integration.crossfeed.cyber.dhs.gov
243+ X_API_KEY : ${{ secrets.X_API_KEY }}
244+ steps :
245+ - uses : actions/checkout@v3
246+
247+ - name : Set up Python
248+ uses : actions/setup-python@v5
249+ with :
250+ python-version : ' 3.11'
251+
252+ - name : Install dependencies
253+ run : |
254+ python -m pip install --upgrade pip
255+ pip install -r requirements.txt
256+
257+ - name : Run Pytest with HTML and JSON reports
258+ id : run_tests
259+ run : |
260+ mkdir -p test-reports
261+ pytest -m integration \
262+ --tb=short \
263+ --maxfail=5 \
264+ --capture=tee-sys \
265+ --html=test-reports/report.html \
266+ --self-contained-html \
267+ --json-report \
268+ --json-report-file=test-reports/report.json
269+ continue-on-error : true
270+
271+ - name : Upload Pytest HTML Report
272+ uses : actions/upload-artifact@v4
273+ with :
274+ name : pytest-html-report
275+ path : integration/test-reports/report.html
276+
277+ - name : Upload Pytest JSON Report
278+ uses : actions/upload-artifact@v4
279+ with :
280+ name : pytest-json-report
281+ path : integration/test-reports/report.json
282+
283+ - name : Fail job if tests failed
284+ if : steps.run_tests.outcome != 'success'
285+ run : exit 1
0 commit comments