Skip to content

Commit ba99c20

Browse files
authored
[e2e] Update Qase integration, impl additional e2e workflows (#3372)
1 parent f2ec4d7 commit ba99c20

File tree

32 files changed

+305
-406
lines changed

32 files changed

+305
-406
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: E2E Automation suite
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+
- manual
12+
- qase
13+
- regression
14+
- sanity
15+
- smoke
16+
qase_token:
17+
description: 'Set Qase token to enable integration'
18+
required: false
19+
type: string
20+
21+
jobs:
22+
build-and-test:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v3
26+
with:
27+
ref: ${{ github.sha }}
28+
- name: Set up environment
29+
id: set_env_values
30+
run: |
31+
cat "./kafka-ui-e2e-checks/.env.ci" >> "./kafka-ui-e2e-checks/.env"
32+
- name: Pull with Docker
33+
id: pull_chrome
34+
run: |
35+
docker pull selenium/standalone-chrome:103.0
36+
- name: Set up JDK
37+
uses: actions/setup-java@v3
38+
with:
39+
java-version: '17'
40+
distribution: 'zulu'
41+
cache: 'maven'
42+
- name: Build with Maven
43+
id: build_app
44+
run: |
45+
./mvnw -B -ntp versions:set -DnewVersion=${{ github.sha }}
46+
./mvnw -B -V -ntp clean install -Pprod -Dmaven.test.skip=true ${{ github.event.inputs.extraMavenOptions }}
47+
- name: Compose with Docker
48+
id: compose_app
49+
# use the following command until #819 will be fixed
50+
run: |
51+
docker-compose -f ./documentation/compose/e2e-tests.yaml up -d
52+
- name: Run test suite
53+
run: |
54+
./mvnw -B -ntp versions:set -DnewVersion=${{ github.sha }}
55+
./mvnw -B -V -ntp -DQASEIO_API_TOKEN=${{ github.event.inputs.qase_token }} -Dsurefire.suiteXmlFiles='src/test/resources/${{ github.event.inputs.test_suite }}.xml' -Dsuite=${{ github.event.inputs.test_suite }} -f 'kafka-ui-e2e-checks' test -Pprod
56+
- name: Generate Allure report
57+
uses: simple-elf/allure-report-action@master
58+
if: always()
59+
id: allure-report
60+
with:
61+
allure_results: ./kafka-ui-e2e-checks/allure-results
62+
gh_pages: allure-results
63+
allure_report: allure-report
64+
subfolder: allure-results
65+
report_url: "http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com"
66+
- uses: jakejarvis/s3-sync-action@master
67+
if: always()
68+
env:
69+
AWS_S3_BUCKET: 'kafkaui-allure-reports'
70+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
71+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
72+
AWS_REGION: 'eu-central-1'
73+
SOURCE_DIR: 'allure-history/allure-results'
74+
- name: Deploy report to Amazon S3
75+
if: always()
76+
uses: Sibz/[email protected]
77+
with:
78+
authToken: ${{secrets.GITHUB_TOKEN}}
79+
context: "Test report"
80+
state: "success"
81+
sha: ${{ github.sha }}
82+
target_url: http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com/${{ github.run_number }}
83+
- name: Dump Docker logs on failure
84+
if: failure()
85+
uses: jwalton/[email protected]

.github/workflows/e2e-checks.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
name: E2E tests
1+
name: E2E PR health check
22
on:
33
pull_request_target:
4-
types: ["opened", "edited", "reopened", "synchronize"]
4+
types: [ "opened", "edited", "reopened", "synchronize" ]
55
paths:
66
- "kafka-ui-api/**"
77
- "kafka-ui-contract/**"
@@ -42,7 +42,7 @@ jobs:
4242
- name: e2e run
4343
run: |
4444
./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }}
45-
./mvnw -B -V -ntp -DQASEIO_API_TOKEN=${{ secrets.QASEIO_API_TOKEN }} -Dsurefire.suiteXmlFiles='src/test/resources/smoke.xml' -Dsuite=smoke -f 'kafka-ui-e2e-checks' test -Pprod
45+
./mvnw -B -V -ntp -Dsurefire.suiteXmlFiles='src/test/resources/smoke.xml' -f 'kafka-ui-e2e-checks' test -Pprod
4646
- name: Generate allure report
4747
uses: simple-elf/allure-report-action@master
4848
if: always()
@@ -66,7 +66,7 @@ jobs:
6666
uses: Sibz/[email protected]
6767
with:
6868
authToken: ${{secrets.GITHUB_TOKEN}}
69-
context: "Test report"
69+
context: "Click Details button to open Allure report"
7070
state: "success"
7171
sha: ${{ github.event.pull_request.head.sha || github.sha }}
7272
target_url: http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com/${{ github.run_number }}

.github/workflows/e2e-weekly.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: E2E Weekly suite
2+
on:
3+
schedule:
4+
- cron: '0 1 * * 1'
5+
6+
jobs:
7+
build-and-test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
with:
12+
ref: ${{ github.sha }}
13+
- name: Set up environment
14+
id: set_env_values
15+
run: |
16+
cat "./kafka-ui-e2e-checks/.env.ci" >> "./kafka-ui-e2e-checks/.env"
17+
- name: Pull with Docker
18+
id: pull_chrome
19+
run: |
20+
docker pull selenium/standalone-chrome:103.0
21+
- name: Set up JDK
22+
uses: actions/setup-java@v3
23+
with:
24+
java-version: '17'
25+
distribution: 'zulu'
26+
cache: 'maven'
27+
- name: Build with Maven
28+
id: build_app
29+
run: |
30+
./mvnw -B -ntp versions:set -DnewVersion=${{ github.sha }}
31+
./mvnw -B -V -ntp clean install -Pprod -Dmaven.test.skip=true ${{ github.event.inputs.extraMavenOptions }}
32+
- name: Compose with Docker
33+
id: compose_app
34+
# use the following command until #819 will be fixed
35+
run: |
36+
docker-compose -f ./documentation/compose/e2e-tests.yaml up -d
37+
- name: Run test suite
38+
run: |
39+
./mvnw -B -ntp versions:set -DnewVersion=${{ github.sha }}
40+
./mvnw -B -V -ntp -DQASEIO_API_TOKEN=${{ secrets.QASEIO_API_TOKEN }} -Dsurefire.suiteXmlFiles='src/test/resources/sanity.xml' -Dsuite=weekly -f 'kafka-ui-e2e-checks' test -Pprod
41+
- name: Generate Allure report
42+
uses: simple-elf/allure-report-action@master
43+
if: always()
44+
id: allure-report
45+
with:
46+
allure_results: ./kafka-ui-e2e-checks/allure-results
47+
gh_pages: allure-results
48+
allure_report: allure-report
49+
subfolder: allure-results
50+
report_url: "http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com"
51+
- uses: jakejarvis/s3-sync-action@master
52+
if: always()
53+
env:
54+
AWS_S3_BUCKET: 'kafkaui-allure-reports'
55+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
56+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
57+
AWS_REGION: 'eu-central-1'
58+
SOURCE_DIR: 'allure-history/allure-results'
59+
- name: Deploy report to Amazon S3
60+
if: always()
61+
uses: Sibz/[email protected]
62+
with:
63+
authToken: ${{secrets.GITHUB_TOKEN}}
64+
context: "Test report"
65+
state: "success"
66+
sha: ${{ github.sha }}
67+
target_url: http://kafkaui-allure-reports.s3-website.eu-central-1.amazonaws.com/${{ github.run_number }}
68+
- name: Dump Docker logs on failure
69+
if: failure()
70+
uses: jwalton/[email protected]

kafka-ui-e2e-checks/README.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,13 @@ cd kafka-ui
3838
docker-compose -f documentation/compose/e2e-tests.yaml up -d
3939
```
4040

41-
2. Run Smoke test suite using your QaseIO API token as environment variable (put instead %s into command below)
41+
2. To run test suite select its name (options: regression, sanity, smoke) and put it instead %s into command below
4242

4343
```
44-
./mvnw -DQASEIO_API_TOKEN='%s' -Dsurefire.suiteXmlFiles='src/test/resources/smoke.xml' -Dsuite=smoke -f 'kafka-ui-e2e-checks' test -Pprod
44+
./mvnw -Dsurefire.suiteXmlFiles='src/test/resources/%s.xml' -f 'kafka-ui-e2e-checks' test -Pprod
4545
```
4646

47-
3. Run Sanity test suite using your QaseIO API token as environment variable (put instead %s into command below)
48-
49-
```
50-
./mvnw -DQASEIO_API_TOKEN='%s' -Dsurefire.suiteXmlFiles='src/test/resources/sanity.xml' -Dsuite=sanity -f 'kafka-ui-e2e-checks' test -Pprod
51-
```
52-
53-
4. Run Regression test suite using your QaseIO API token as environment variable (put instead %s into command below)
54-
55-
```
56-
./mvnw -DQASEIO_API_TOKEN='%s' -Dsurefire.suiteXmlFiles='src/test/resources/regression.xml' -Dsuite=regression -f 'kafka-ui-e2e-checks' test -Pprod
57-
```
58-
59-
5. To run tests on your local Chrome browser just add next VM option to the Run Configuration
47+
3. To run tests on your local Chrome browser just add next VM option to the Run Configuration
6048

6149
```
6250
-Dbrowser=local

kafka-ui-e2e-checks/pom.xml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@
1515
<maven.surefire-plugin.version>3.0.0-M8</maven.surefire-plugin.version>
1616
<kafka-ui-contract>${project.version}</kafka-ui-contract>
1717
<testcontainers.version>1.17.6</testcontainers.version>
18-
<junit.platform.version>1.9.2</junit.platform.version>
1918
<selenide.version>6.6.3</selenide.version>
2019
<testng.version>7.6.1</testng.version>
2120
<allure.version>2.20.1</allure.version>
21+
<qase.io.version>3.0.2</qase.io.version>
2222
<aspectj.version>1.9.9.1</aspectj.version>
2323
<assertj.version>3.23.1</assertj.version>
2424
<hamcrest.version>2.2</hamcrest.version>
2525
<slf4j.version>1.7.36</slf4j.version>
2626
<dotenv.version>2.3.1</dotenv.version>
2727
<kafka.version>3.3.1</kafka.version>
28-
<qase.io.version>2.1.3</qase.io.version>
2928
</properties>
3029

3130
<dependencies>
@@ -121,16 +120,6 @@
121120
<artifactId>selenium</artifactId>
122121
<version>${testcontainers.version}</version>
123122
</dependency>
124-
<dependency>
125-
<groupId>org.junit.platform</groupId>
126-
<artifactId>junit-platform-launcher</artifactId>
127-
<version>${junit.platform.version}</version>
128-
</dependency>
129-
<dependency>
130-
<groupId>org.junit.platform</groupId>
131-
<artifactId>junit-platform-engine</artifactId>
132-
<version>${junit.platform.version}</version>
133-
</dependency>
134123
<dependency>
135124
<groupId>com.codeborne</groupId>
136125
<artifactId>selenide</artifactId>
@@ -151,6 +140,16 @@
151140
<artifactId>allure-testng</artifactId>
152141
<version>${allure.version}</version>
153142
</dependency>
143+
<dependency>
144+
<groupId>io.qase</groupId>
145+
<artifactId>qase-testng</artifactId>
146+
<version>${qase.io.version}</version>
147+
</dependency>
148+
<dependency>
149+
<groupId>io.qase</groupId>
150+
<artifactId>qase-api</artifactId>
151+
<version>${qase.io.version}</version>
152+
</dependency>
154153
<dependency>
155154
<groupId>org.hamcrest</groupId>
156155
<artifactId>hamcrest</artifactId>
@@ -186,11 +185,6 @@
186185
<artifactId>kafka-ui-contract</artifactId>
187186
<version>${kafka-ui-contract}</version>
188187
</dependency>
189-
<dependency>
190-
<groupId>io.qase</groupId>
191-
<artifactId>qase-api</artifactId>
192-
<version>${qase.io.version}</version>
193-
</dependency>
194188
</dependencies>
195189

196190
<profiles>

kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/settings/BaseSource.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55

66
public abstract class BaseSource {
77

8-
private static Config config;
9-
public static final String BASE_CONTAINER_URL = "http://host.testcontainers.internal:8080";
10-
public static final String BASE_LOCAL_URL = "http://localhost:8080";
11-
public static final String CLUSTER_NAME = "local";
12-
public static final String BROWSER = config().browser();
8+
public static final String BASE_CONTAINER_URL = "http://host.testcontainers.internal:8080";
9+
public static final String BASE_LOCAL_URL = "http://localhost:8080";
10+
public static final String CLUSTER_NAME = "local";
11+
private static Config config;
12+
public static final String BROWSER = config().browser();
13+
public static final String SUITE_NAME = config().suite();
1314

14-
private static Config config() {
15-
if (config == null) {
16-
config = ConfigFactory.create(Config.class, System.getProperties());
15+
private static Config config() {
16+
if (config == null) {
17+
config = ConfigFactory.create(Config.class, System.getProperties());
18+
}
19+
return config;
1720
}
18-
return config;
19-
}
2021
}

kafka-ui-e2e-checks/src/main/java/com/provectus/kafka/ui/settings/configs/Profiles.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
import org.aeonbits.owner.Config;
44

5-
public interface Profiles extends Config {
5+
import static com.provectus.kafka.ui.variables.Browser.CONTAINER;
6+
import static com.provectus.kafka.ui.variables.Suite.CUSTOM;
67

7-
String CONTAINER = "container";
8-
String LOCAL = "local";
8+
public interface Profiles extends Config {
99

1010
@Key("browser")
1111
@DefaultValue(CONTAINER)
1212
String browser();
1313

1414
@Key("suite")
15-
@DefaultValue("custom")
15+
@DefaultValue(CUSTOM)
1616
String suite();
1717
}

0 commit comments

Comments
 (0)