Skip to content

Commit 3278803

Browse files
E2E: Make autotests great again (#289)
Co-authored-by: Roman Zabaluev <gpg@haarolean.dev> Co-authored-by: VladSenyuta <vlad.senyuta@gmail.com>
1 parent 4a3c424 commit 3278803

File tree

113 files changed

+1328
-2074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1328
-2074
lines changed

.github/workflows/branch-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: read
11+
statuses: write
1112

1213
jobs:
1314
build:

.github/workflows/e2e-manual.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "E2E: Suite run"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
test_suite:
6+
description: 'Select test suite to run'
7+
default: 'regression'
8+
required: true
9+
type: choice
10+
options:
11+
- regression
12+
- sanity
13+
- smoke
14+
15+
permissions:
16+
contents: read
17+
checks: write
18+
statuses: write
19+
20+
jobs:
21+
build-and-test:
22+
uses: ./.github/workflows/e2e-run.yml
23+
secrets: inherit
24+
with:
25+
suite_name: ${{ github.event.inputs.test_suite }}
26+
sha: ${{ github.sha }}

.github/workflows/e2e-pr.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "E2E: PR smoke tests"
2+
on:
3+
pull_request:
4+
types: [ "opened", "reopened", "synchronize" ]
5+
paths:
6+
- "pom.xml"
7+
- "contract/**"
8+
- "api/**"
9+
- "serde-api/**"
10+
- "frontend/**"
11+
- "e2e-tests/**"
12+
13+
permissions:
14+
contents: read
15+
checks: write
16+
statuses: write
17+
18+
jobs:
19+
build-and-test:
20+
uses: ./.github/workflows/e2e-run.yml
21+
secrets: inherit
22+
with:
23+
suite_name: "smoke"
24+
sha: ${{ github.event.pull_request.head.sha }}

.github/workflows/e2e-run.yml

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: "E2E: Run tests"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
suite_name:
7+
description: 'Test suite name to run'
8+
default: 'regression'
9+
required: true
10+
type: string
11+
sha:
12+
required: true
13+
type: string
14+
15+
permissions:
16+
contents: read
17+
checks: write
18+
statuses: write
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
token: ${{ github.token }}
28+
ref: ${{ inputs.sha }}
29+
30+
- name: Set up JDK
31+
uses: actions/setup-java@v3
32+
with:
33+
java-version: '17'
34+
distribution: 'zulu'
35+
cache: 'maven'
36+
37+
- name: Build with Maven
38+
id: build_app
39+
run: |
40+
./mvnw -B -ntp versions:set -DnewVersion=${{ inputs.sha }}
41+
./mvnw -B -V -ntp clean install -Pprod -Dmaven.test.skip=true
42+
43+
- name: Upload maven artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: artifacts
47+
path: ~/.m2/repository/io/kafbat/ui/**/*
48+
retention-days: 7
49+
50+
- name: Dump docker image
51+
run: |
52+
docker image save ghcr.io/kafbat/kafka-ui:latest > /tmp/image.tar
53+
54+
- name: Upload docker image
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: image
58+
path: /tmp/image.tar
59+
retention-days: 7
60+
61+
tests:
62+
runs-on: ubuntu-latest
63+
needs: build
64+
steps:
65+
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
with:
69+
token: ${{ github.token }}
70+
ref: ${{ inputs.sha }}
71+
72+
- name: Set up JDK
73+
uses: actions/setup-java@v3
74+
with:
75+
java-version: '17'
76+
distribution: 'zulu'
77+
cache: 'maven'
78+
79+
- name: Download maven artifacts
80+
uses: actions/download-artifact@v4
81+
with:
82+
name: artifacts
83+
path: ~/.m2/repository/io/kafbat/ui
84+
85+
- name: Download docker image
86+
uses: actions/download-artifact@v4
87+
with:
88+
name: image
89+
path: /tmp
90+
91+
- name: Load Docker image
92+
run: |
93+
docker load --input /tmp/image.tar
94+
95+
- name: Cache Docker images.
96+
uses: ScribeMD/docker-cache@0.5.0
97+
with:
98+
key: docker-${{ runner.os }}-${{ hashFiles('./e2e-tests/selenoid/selenoid-ci.yaml', './documentation/compose/e2e-tests.yaml') }}
99+
100+
- name: Compose up
101+
id: compose_app
102+
# use the following command until #819 will be fixed # TODO recheck 819
103+
run: |
104+
mkdir -p ./e2e-tests/target/selenoid-results/video
105+
mkdir -p ./e2e-tests/target/selenoid-results/logs
106+
docker-compose -f ./e2e-tests/selenoid/selenoid-ci.yaml up -d
107+
docker-compose -f ./documentation/compose/e2e-tests.yaml up -d
108+
109+
- name: Dump Docker logs on failure
110+
if: failure()
111+
uses: jwalton/gh-docker-logs@v2.2.2
112+
113+
- name: Run test suite
114+
run: |
115+
./mvnw -B -ntp versions:set -DnewVersion=${{ inputs.sha }}
116+
./mvnw -B -V -ntp -Dsurefire.suiteXmlFiles='src/test/resources/${{ inputs.suite_name }}.xml' -f 'e2e-tests' test -Pprod
117+
118+
- name: Upload allure reports artifact
119+
if: '!cancelled()'
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: reports
123+
path: ./e2e-tests/target/allure-results
124+
retention-days: 7
125+
126+
reports:
127+
runs-on: ubuntu-latest
128+
needs: tests
129+
if: ${{ !cancelled() && github.repository == 'kafbat/kafka-ui' }}
130+
steps:
131+
- name: Download allure reports artifact
132+
uses: actions/download-artifact@v4
133+
with:
134+
name: reports
135+
path: ./e2e-tests/target/allure-results
136+
137+
- name: Generate Allure report
138+
uses: simple-elf/allure-report-action@v1.9
139+
id: allure-report
140+
with:
141+
allure_results: ./e2e-tests/target/allure-results
142+
gh_pages: allure-results
143+
allure_report: allure-report
144+
subfolder: allure-results
145+
report_url: "https://reports.kafbat.dev"
146+
147+
- name: Upload allure report to R2
148+
uses: ryand56/r2-upload-action@latest
149+
with:
150+
source-dir: allure-history/allure-results
151+
destination-dir: .
152+
r2-bucket: "reports"
153+
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
154+
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
155+
r2-secret-access-key: ${{ secrets.R2_ACCESS_SECRET_KEY }}
156+
157+
- name: Add allure link status check
158+
uses: Sibz/github-status-action@v1.1.6
159+
with:
160+
authToken: ${{secrets.GITHUB_TOKEN}}
161+
context: "Click Details button to view Allure report"
162+
state: "success"
163+
sha: ${{ inputs.sha }}
164+
target_url: https://reports.kafbat.dev/${{ github.run_number }}

.github/workflows/e2e-weekly.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "E2E: Weekly suite"
2+
on:
3+
schedule:
4+
- cron: '0 1 * * 1'
5+
6+
permissions:
7+
contents: read
8+
checks: write
9+
statuses: write
10+
11+
jobs:
12+
build-and-test:
13+
uses: ./.github/workflows/e2e-run.yml
14+
secrets: inherit
15+
with:
16+
suite_name: "sanity"
17+
sha: ${{ github.sha }}

.github/workflows/welcome-first-time-contributors.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
2323
Welcome, and thank you for opening your first issue in the repo!
2424
25-
Please wait for triaging by our maintainers.
26-
25+
Please wait for triaging by our maintainers.
26+
2727
As development is carried out in our spare time, you can support us by sponsoring our activities or even funding the development of specific issues.
2828
[Sponsorship link](https://github.com/kafbat)
2929
@@ -34,6 +34,6 @@ jobs:
3434
3535
Welcome, and thank you for opening your first PR in the repo!
3636
37-
Please wait for triaging by our maintainers.
37+
Please wait for triaging by our maintainers.
3838
3939
Please take a look at our [contributing guide](https://ui.docs.kafbat.io/development/contributing).

e2e-tests/.env.ci

Lines changed: 0 additions & 3 deletions
This file was deleted.

e2e-tests/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
.env
22
build/
3-
allure-results/
4-
selenoid/video/
53
target/
6-
selenoid/logs/

e2e-tests/QASE.md

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)