Browse Source

Fix e2e run (#3326)

* Fix e2e run

* add suite profiles

Co-authored-by: VladSenyuta <vlad.senyuta@gmail.com>
Roman Zabaluev 2 năm trước cách đây
mục cha
commit
6ffcd845fa

+ 2 - 2
.github/workflows/e2e-checks.yaml

@@ -33,7 +33,7 @@ jobs:
         id: build_app
         id: build_app
         run: |
         run: |
           ./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }}
           ./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }}
-          ./mvnw -B -V -ntp clean package -Pprod -Dmaven.test.skip=true ${{ github.event.inputs.extraMavenOptions }}
+          ./mvnw -B -V -ntp clean install -Pprod -Dmaven.test.skip=true ${{ github.event.inputs.extraMavenOptions }}
       - name: compose app
       - name: compose app
         id: compose_app
         id: compose_app
         # use the following command until #819 will be fixed
         # use the following command until #819 will be fixed
@@ -42,7 +42,7 @@ jobs:
       - name: e2e run
       - name: e2e run
         run: |
         run: |
           ./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }}
           ./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }}
-          ./mvnw -B -V -ntp -DQASEIO_API_TOKEN=${{ secrets.QASEIO_API_TOKEN }} -pl 'kafka-ui-e2e-checks' test -Dsurefire.suiteXmlFiles='src/test/resources/smoke.xml' -Pprod
+          ./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
       - name: Generate allure report
       - name: Generate allure report
         uses: simple-elf/allure-report-action@master
         uses: simple-elf/allure-report-action@master
         if: always()
         if: always()

+ 10 - 4
kafka-ui-e2e-checks/README.md

@@ -41,16 +41,22 @@ docker-compose -f documentation/compose/e2e-tests.yaml up -d
 2. Run Smoke test suite using your QaseIO API token as environment variable (put instead %s into command below)
 2. Run Smoke test suite using your QaseIO API token as environment variable (put instead %s into command below)
 
 
 ```
 ```
-./mvnw -DQASEIO_API_TOKEN='%s' -pl 'kafka-ui-e2e-checks' test -Dsurefire.suiteXmlFiles='src/test/resources/smoke.xml' -Pprod
+./mvnw -DQASEIO_API_TOKEN='%s' -Dsurefire.suiteXmlFiles='src/test/resources/smoke.xml' -Dsuite=smoke -f 'kafka-ui-e2e-checks' test -Pprod
 ```
 ```
 
 
-3. Run Regression test suite using your QaseIO API token as environment variable (put instead %s into command below)
+3. Run Sanity test suite using your QaseIO API token as environment variable (put instead %s into command below)
 
 
 ```
 ```
-./mvnw -DQASEIO_API_TOKEN='%s' -pl 'kafka-ui-e2e-checks' test -Dsurefire.suiteXmlFiles='src/test/resources/regression.xml' -Pprod
+./mvnw -DQASEIO_API_TOKEN='%s' -Dsurefire.suiteXmlFiles='src/test/resources/sanity.xml' -Dsuite=sanity -f 'kafka-ui-e2e-checks' test -Pprod
 ```
 ```
 
 
-4. To run tests on your local Chrome browser just add next VM option to the Run Configuration
+4. Run Regression test suite using your QaseIO API token as environment variable (put instead %s into command below)
+
+```
+./mvnw -DQASEIO_API_TOKEN='%s' -Dsurefire.suiteXmlFiles='src/test/resources/regression.xml' -Dsuite=regression -f 'kafka-ui-e2e-checks' test -Pprod
+```
+
+5. To run tests on your local Chrome browser just add next VM option to the Run Configuration
 
 
 ```
 ```
 -Dbrowser=local
 -Dbrowser=local

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

@@ -4,10 +4,14 @@ import org.aeonbits.owner.Config;
 
 
 public interface Profiles extends Config {
 public interface Profiles extends Config {
 
 
-  String CONTAINER = "container";
-  String LOCAL = "local";
+    String CONTAINER = "container";
+    String LOCAL = "local";
 
 
-  @Key("browser")
-  @DefaultValue(CONTAINER)
-  String browser();
+    @Key("browser")
+    @DefaultValue(CONTAINER)
+    String browser();
+
+    @Key("suite")
+    @DefaultValue("custom")
+    String suite();
 }
 }

+ 4 - 0
kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/testSuite/TestClass.java

@@ -0,0 +1,4 @@
+package com.provectus.kafka.ui.testSuite;
+
+public class TestClass {
+}

+ 2 - 1
kafka-ui-e2e-checks/src/test/resources/regression.xml

@@ -2,7 +2,8 @@
 <suite name="RegressionSuite">
 <suite name="RegressionSuite">
     <test name="Regression" enabled="true" parallel="classes" thread-count="1">
     <test name="Regression" enabled="true" parallel="classes" thread-count="1">
         <packages>
         <packages>
-            <package name="com.provectus.kafka.ui.regressionSuite.*"/>
+            <package name="com.provectus.kafka.ui.smokeSuite.*"/>
+            <package name="com.provectus.kafka.ui.sanitySuite.*"/>
         </packages>
         </packages>
     </test>
     </test>
 </suite>
 </suite>

+ 8 - 0
kafka-ui-e2e-checks/src/test/resources/sanity.xml

@@ -0,0 +1,8 @@
+<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
+<suite name="SanitySuite">
+    <test name="Sanity" enabled="true" parallel="classes" thread-count="1">
+        <packages>
+            <package name="com.provectus.kafka.ui.sanitySuite.*"/>
+        </packages>
+    </test>
+</suite>