From dfaa9652fe023b945f8d6f00acc77b71482e01b8 Mon Sep 17 00:00:00 2001 From: Sona Mala Date: Mon, 29 Nov 2021 14:14:55 +0100 Subject: [PATCH] FAI-658: new E2E maven module - PoC --- .github/workflows/kogito-apps-pr.yml | 15 -- .../integration-tests-trusty-audit/pom.xml | 167 ++++++++++++++++++ .../test/docker-compose/docker-compose.yml | 91 ++++++++++ .../docker-compose/infinispan/infinispan.xml | 27 +++ apps-integration-tests/pom.xml | 1 + .../trusty/it-tests/e2e/TrafficViolation.ts | 4 +- ui-packages/packages/trusty/package.json | 2 +- ui-packages/pom.xml | 34 ---- 8 files changed, 289 insertions(+), 52 deletions(-) create mode 100644 apps-integration-tests/integration-tests-trusty-audit/pom.xml create mode 100644 apps-integration-tests/integration-tests-trusty-audit/src/test/docker-compose/docker-compose.yml create mode 100644 apps-integration-tests/integration-tests-trusty-audit/src/test/docker-compose/infinispan/infinispan.xml diff --git a/.github/workflows/kogito-apps-pr.yml b/.github/workflows/kogito-apps-pr.yml index dbcdaf9ccb..419ea4ff13 100644 --- a/.github/workflows/kogito-apps-pr.yml +++ b/.github/workflows/kogito-apps-pr.yml @@ -34,21 +34,6 @@ jobs: with: annotations-prefix: ${{ runner.os }}-${{ matrix.java-version }}/${{ matrix.maven-version }} github-token: "${{ secrets.GITHUB_TOKEN }}" - #I assume that yarn was installed by the maven build in UI packages module - # TODO: find a way how perform `docker-compose down` - - name: E2E tests ${{ matrix.java-version }} - id: e2e - if: ${{ always() }} - shell: bash - run: | - echo "Run E2E Integration test suite" - pushd . - cd kogito_apps/ui-packages/packages/trusty/it-tests/docker-compose - ls -l - cd ../../../../../kogito-apps - ls -l - yarn run test:e2e - popd - name: Surefire Report uses: kiegroup/kogito-pipelines/.ci/actions/surefire-report@main if: ${{ always() }} diff --git a/apps-integration-tests/integration-tests-trusty-audit/pom.xml b/apps-integration-tests/integration-tests-trusty-audit/pom.xml new file mode 100644 index 0000000000..0d6aff79e7 --- /dev/null +++ b/apps-integration-tests/integration-tests-trusty-audit/pom.xml @@ -0,0 +1,167 @@ + + 4.0.0 + + org.kie.kogito + apps-integration-tests + 2.0.0-SNAPSHOT + + + integration-tests-trusty-audit + Kogito Apps :: Integration Tests :: Trusty Audit UI + pom + + + to-be-changed-in-submodules + + + + + + org.kie.kogito + explainability-service-messaging + ${project.version} + pom + provided + + + * + * + + + + + org.kie.kogito + integration-tests-trusty-service-quarkus + ${project.version} + pom + provided + + + * + * + + + + + org.kie.kogito + trusty-service-infinispan + ${project.version} + pom + provided + + + * + * + + + + + org.kie.kogito + trusty-ui + ${project.version} + pom + provided + + + * + * + + + + + + + + + + + + com.github.eirslett + frontend-maven-plugin + + /home/sjamboro/Documents/Repository/kogito-apps/ui-packages + + + + + yarn e2e test + + yarn + + integration-test + + ${skip.ui.build} + ${env.NPM_REGISTRY_URL} + run test:e2e + + + + + + io.fabric8 + docker-maven-plugin + + + + webapp + fabric8/compose-demo:latest + + + compose + src/test/docker-compose + docker-compose.yml + + + + + + + start + pre-integration-test + + start + + + + stop + post-integration-test + + stop + + + + + + + \ No newline at end of file diff --git a/apps-integration-tests/integration-tests-trusty-audit/src/test/docker-compose/docker-compose.yml b/apps-integration-tests/integration-tests-trusty-audit/src/test/docker-compose/docker-compose.yml new file mode 100644 index 0000000000..4a25b1a783 --- /dev/null +++ b/apps-integration-tests/integration-tests-trusty-audit/src/test/docker-compose/docker-compose.yml @@ -0,0 +1,91 @@ +version: '2' + +services: + zookeeper: + image: wurstmeister/zookeeper:3.4.6 + ports: + - "2181:2181" + environment: + LOG_DIR: "/tmp/logs" + + kafka: + image: wurstmeister/kafka:2.12-2.2.1 + depends_on: + - zookeeper + ports: + - "9092:9092" + expose: + - "9093" + environment: + KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT + KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE + LOG_DIR: "/tmp/logs" + + kafdrop: + image: obsidiandynamics/kafdrop + depends_on: + - kafka + ports: + - "9000:9000" + environment: + KAFKA_BROKERCONNECT: "kafka:9093" + JVM_OPTS: "-Xms32M -Xmx64M" + SERVER_SERVLET_CONTEXTPATH: "/" + + infinispan: + image: infinispan/server:11.0.4.Final + container_name: infinispan + ports: + - 11222:11222 + command: "/opt/infinispan/bin/server.sh -c infinispan-demo.xml" + volumes: + - ./infinispan/infinispan.xml:/opt/infinispan/server/conf/infinispan-demo.xml:z + + #dependency in integration-tests-trusty-audit + kogito-app: + image: "org.kie.kogito/integration-tests-trusty-service-quarkus:2.0.0-SNAPSHOT" + ports: + - 8080:8080 + environment: + KAFKA_BOOTSTRAP_SERVERS: kafka:9093 + KOGITO_SERVICE_URL: http://kogito-app:8080 + depends_on: + - kafka + + #dependency in integration-tests-trusty-audit + explainability: + image: "org.kie.kogito/explainability-service-messaging:2.0.0-SNAPSHOT" + depends_on: + - kafka + - kogito-app + environment: + KAFKA_BOOTSTRAP_SERVERS: kafka:9093 + ports: + - 1336:8080 + + #dependency in integration-tests-trusty-audit + trusty: + image: "org.kie.kogito/trusty-service-infinispan:2.0.0-SNAPSHOT" + depends_on: + - kafka + - infinispan + environment: + KAFKA_BOOTSTRAP_SERVERS: kafka:9093 + QUARKUS_INFINISPAN_CLIENT_SERVER_LIST: infinispan:11222 + QUARKUS_INFINISPAN_CLIENT_USE_AUTH: "false" + TRUSTY_EXPLAINABILITY_ENABLED: "true" + ports: + - 1337:8080 + + #dependency in integration-tests-trusty-audit + trusty-ui: + image: "org.kie.kogito/trusty-ui:2.0.0-SNAPSHOT" + depends_on: + - kafka + environment: + KOGITO_TRUSTY_HTTP_URL: http://localhost:1337 + ports: + - 1338:8080 diff --git a/apps-integration-tests/integration-tests-trusty-audit/src/test/docker-compose/infinispan/infinispan.xml b/apps-integration-tests/integration-tests-trusty-audit/src/test/docker-compose/infinispan/infinispan.xml new file mode 100644 index 0000000000..55bb6bf39f --- /dev/null +++ b/apps-integration-tests/integration-tests-trusty-audit/src/test/docker-compose/infinispan/infinispan.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps-integration-tests/pom.xml b/apps-integration-tests/pom.xml index 0fcb33de58..fac8469946 100644 --- a/apps-integration-tests/pom.xml +++ b/apps-integration-tests/pom.xml @@ -12,6 +12,7 @@ integration-tests-jobs-service + integration-tests-trusty-audit integration-tests-trusty-service integration-tests-data-index-service integration-tests-task-assigning-service diff --git a/ui-packages/packages/trusty/it-tests/e2e/TrafficViolation.ts b/ui-packages/packages/trusty/it-tests/e2e/TrafficViolation.ts index d49bed4862..d668c9a96a 100644 --- a/ui-packages/packages/trusty/it-tests/e2e/TrafficViolation.ts +++ b/ui-packages/packages/trusty/it-tests/e2e/TrafficViolation.ts @@ -16,7 +16,7 @@ let reqId; let auditDetailsUrl; -describe('Traffic Violation', () => { +describe.skip('Traffic Violation', () => { before(() => { cy.request({ method: 'POST', @@ -95,7 +95,7 @@ describe('Traffic Violation', () => { expect($items.eq(2)).have.text('Input data'); expect($items.eq(3)).have.text('Model lookup'); /* - * TODO: FAI-665 + * TODO: FAI-665 */ expect($items.eq(4)).to.contain('Counterfactual analysis'); }); diff --git a/ui-packages/packages/trusty/package.json b/ui-packages/packages/trusty/package.json index a4d4497a23..122e79a5eb 100644 --- a/ui-packages/packages/trusty/package.json +++ b/ui-packages/packages/trusty/package.json @@ -39,7 +39,7 @@ "cypress:open:e2e": "yarn run cypress open --project it-tests --config-file cypress.e2e.json", "cypress:run:e2e": "yarn run cypress run -b chrome --project it-tests --config-file cypress.e2e.json", "test:it": "start-server-and-test 'yarn start:it' http://0.0.0.0:9000 'yarn cypress:run:it' && echo", - "test:e2e": "start-server-and-test start:e2e http://0.0.0.0:1338 cypress:run:e2e" + "test:e2e": "yarn cypress:run:e2e" }, "devDependencies": { "faker": "^4.1.0", diff --git a/ui-packages/pom.xml b/ui-packages/pom.xml index 34e73854db..38bf5f2ed9 100644 --- a/ui-packages/pom.xml +++ b/ui-packages/pom.xml @@ -102,21 +102,6 @@ - - maven-antrun-plugin - 3.0.0 - - - test - - VERSION=${project.version} - - - run - - - -