Skip to content

Commit 65fb211

Browse files
authored
MPT-15326 Daily E2E cronjob (#109)
2 parents 07206bb + 0ca7518 commit 65fb211

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: daily-e2e.yml
2+
on:
3+
schedule:
4+
- cron: '0 8 * * *'
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 10
10+
steps:
11+
- name: "Checkout"
12+
uses: actions/checkout@v4
13+
with:
14+
ref: main
15+
16+
- name: "Build test containers"
17+
run: docker compose build e2e
18+
19+
- name: "Create environment file"
20+
run: env | grep -E '^MPT_' > .env
21+
env:
22+
RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }}
23+
RP_API_KEY: ${{ secrets.RP_API_KEY }}
24+
MPT_API_BASE_URL: ${{ secrets.MPT_API_BASE_URL }}
25+
MPT_API_TOKEN: ${{ secrets.MPT_API_TOKEN }}
26+
MPT_API_TOKEN_CLIENT: ${{ secrets.MPT_API_TOKEN_CLIENT }}
27+
MPT_API_TOKEN_OPERATIONS: ${{ secrets.MPT_API_TOKEN_OPERATIONS }}
28+
MPT_API_TOKEN_VENDOR: ${{ secrets.MPT_API_TOKEN_VENDOR }}
29+
30+
- name: "Run E2E test"
31+
run: docker compose run --service-ports e2e bash -c "pytest -v -p no:randomly --no-cov --reportportal --rp-launch=$RP_LAUNCH --rp-api-key=$RP_API_KEY --rp-endpoint=$RP_ENDPOINT --junitxml=e2e-report.xml tests/e2e"
32+
env:
33+
RP_LAUNCH: github-e2e-cron-main
34+
RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }}
35+
RP_API_KEY: ${{ secrets.RP_API_KEY }}
36+
37+
- name: "Stop containers"
38+
if: always()
39+
run: docker compose down

.github/workflows/pr-build-merge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
fetch-depth: 0
2525

2626
- name: "Build test containers"
27-
run: docker compose build app_test
27+
run: docker compose build app_test e2e
2828

2929
- name: "Create environment file"
3030
run: env | grep -E '^MPT_' > .env
@@ -41,7 +41,7 @@ jobs:
4141
run: docker compose run --service-ports app_test
4242

4343
- name: "Run E2E test"
44-
run: docker compose run --service-ports app_test bash -c "pytest -v -p no:randomly --no-cov --reportportal --rp-launch=$RP_LAUNCH --rp-api-key=$RP_API_KEY --rp-endpoint=$RP_ENDPOINT --junitxml=e2e-report.xml tests/e2e"
44+
run: docker compose run --service-ports e2e bash -c "pytest -v -p no:randomly --no-cov --reportportal --rp-launch=$RP_LAUNCH --rp-api-key=$RP_API_KEY --rp-endpoint=$RP_ENDPOINT --junitxml=e2e-report.xml tests/e2e"
4545
env:
4646
RP_LAUNCH: github-e2e-test
4747
RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }}

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,27 @@ jobs:
2020
with:
2121
fetch-depth: 0
2222

23+
- name: "Build test containers"
24+
run: docker compose build e2e
25+
26+
- name: "Create environment file"
27+
run: env | grep -E '^MPT_' > .env
28+
env:
29+
RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }}
30+
RP_API_KEY: ${{ secrets.RP_API_KEY }}
31+
MPT_API_BASE_URL: ${{ secrets.MPT_API_BASE_URL }}
32+
MPT_API_TOKEN: ${{ secrets.MPT_API_TOKEN }}
33+
MPT_API_TOKEN_CLIENT: ${{ secrets.MPT_API_TOKEN_CLIENT }}
34+
MPT_API_TOKEN_OPERATIONS: ${{ secrets.MPT_API_TOKEN_OPERATIONS }}
35+
MPT_API_TOKEN_VENDOR: ${{ secrets.MPT_API_TOKEN_VENDOR }}
36+
37+
- name: "Run E2E test"
38+
run: docker compose run --service-ports e2e bash -c "pytest -v -p no:randomly --no-cov --reportportal --rp-launch=$RP_LAUNCH --rp-api-key=$RP_API_KEY --rp-endpoint=$RP_ENDPOINT --junitxml=e2e-report.xml tests/e2e"
39+
env:
40+
RP_LAUNCH: github-e2e-cron-main
41+
RP_ENDPOINT: ${{ secrets.RP_ENDPOINT }}
42+
RP_API_KEY: ${{ secrets.RP_API_KEY }}
43+
2344
- name: "Set up Python"
2445
uses: actions/setup-python@v5
2546
with:

0 commit comments

Comments
 (0)