diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 614dfbb1d41..af3ee71efcc 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -3,31 +3,70 @@ on: pull_request: types: ['opened', 'edited', 'reopened', 'synchronize'] paths: - - 'kafka-ui-api/**' + - 'kafka-ui-api/**' + - 'kafka-ui-e2e-checks/**' jobs: build: runs-on: ubuntu-latest steps: - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: actions/checkout@v2 - - name: Set up JDK 1.13 - uses: actions/setup-java@v1 - with: - java-version: 1.13 - - name: Cache SonarCloud packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - uses: actions/checkout@v2 + - name: Set the values + id: step_one + run: | + cat "./kafka-ui-e2e-checks/.env.example" >> "./kafka-ui-e2e-checks/.env" + - name: pull docker + id: step_four + run: | + docker pull selenoid/vnc:chrome_86.0 + - name: compose app + id: step_five + run: | + docker-compose -f ./docker/kafka-ui.yaml up -d + - name: Set up JDK 1.13 + uses: actions/setup-java@v1 + with: + java-version: 1.13 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar + - name: Generate allure report + uses: simple-elf/allure-report-action@master + if: always() + id: allure-report + with: + allure_results: ./kafka-ui-e2e-checks/allure-results + gh_pages: allure-results + allure_report: allure-report + subfolder: allure-results + - name: Deploy allure report to Github Pages + if: always() + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: allure-history + publish_branch: gh-pages + destination_dir: . + - name: Post the link to allure report + if: always() + uses: Sibz/github-status-action@v1 + with: + authToken: ${{secrets.GITHUB_TOKEN}} + context: 'Test report' + state: 'success' + sha: ${{ github.event.pull_request.head.sha || github.sha }} + target_url: https://${{ github.repository_owner }}.github.io/kafka-ui/allure-results/${{ github.run_number }} \ No newline at end of file diff --git a/kafka-ui-e2e-checks/.env.example b/kafka-ui-e2e-checks/.env.example index de43f7b2dc0..cf6cd6d4336 100644 --- a/kafka-ui-e2e-checks/.env.example +++ b/kafka-ui-e2e-checks/.env.example @@ -1,3 +1,3 @@ -USE_LOCAL_BROWSER=true -SHOULD_START_SELENOID=false +USE_LOCAL_BROWSER=false +SHOULD_START_SELENOID=true TURN_OFF_SCREENSHOTS=true diff --git a/kafka-ui-e2e-checks/pom.xml b/kafka-ui-e2e-checks/pom.xml index a26da3e456f..fed6ee55467 100644 --- a/kafka-ui-e2e-checks/pom.xml +++ b/kafka-ui-e2e-checks/pom.xml @@ -82,6 +82,7 @@ org.junit.jupiter junit-jupiter-engine ${junit.version} + test org.slf4j diff --git a/kafka-ui-e2e-checks/selenoid/config/browsers.json b/kafka-ui-e2e-checks/selenoid/config/browsers.json index 2645f5980eb..f22de7eca11 100644 --- a/kafka-ui-e2e-checks/selenoid/config/browsers.json +++ b/kafka-ui-e2e-checks/selenoid/config/browsers.json @@ -3,6 +3,7 @@ "default": "86.0", "versions": { "86.0": { + "hosts": ["host.docker.internal:172.17.0.1"], "image": "selenoid/vnc:chrome_86.0", "port": "4444" } diff --git a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/SmokeTests.java b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/SmokeTests.java index 7f0b2bbf9cf..efd43dcd281 100644 --- a/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/SmokeTests.java +++ b/kafka-ui-e2e-checks/src/test/java/com/provectus/kafka/ui/SmokeTests.java @@ -8,8 +8,7 @@ import org.junit.jupiter.api.Test; public class SmokeTests extends BaseTest { - - @Disabled("till we get tests in ci run") + @Test @SneakyThrows @DisplayName("main page should load") @Issue("380")