From 0171cc3dcb5d257e8d7039ebfa18cd31d2b6c9ea Mon Sep 17 00:00:00 2001 From: Daniel De Vera Date: Tue, 18 Jun 2024 08:52:29 -0300 Subject: [PATCH] PR feedback --- .signadot/ict/e2e-tests-job.yaml | 37 ------------------- .../{ict => testing}/cypress-runner.yaml | 0 .signadot/testing/demo-tests-job.yaml | 21 +++++++++++ .signadot/testing/e2e-tests-job.yaml | 26 +++++++++++++ cypress/e2e/hotrod.cy.js | 4 ++ 5 files changed, 51 insertions(+), 37 deletions(-) delete mode 100644 .signadot/ict/e2e-tests-job.yaml rename .signadot/{ict => testing}/cypress-runner.yaml (100%) create mode 100644 .signadot/testing/demo-tests-job.yaml create mode 100644 .signadot/testing/e2e-tests-job.yaml diff --git a/.signadot/ict/e2e-tests-job.yaml b/.signadot/ict/e2e-tests-job.yaml deleted file mode 100644 index e9ad25f..0000000 --- a/.signadot/ict/e2e-tests-job.yaml +++ /dev/null @@ -1,37 +0,0 @@ -spec: - namePrefix: hotrod-cypress-e2e - runnerGroup: cypress - script: | - #!/bin/bash - set -e - - # Clone the git repo - echo "Cloning signadot repo" - git clone --single-branch -b $TARGET_BRANCH \ - https://github.com/signadot/hotrod.git - - # Run the cypress e2e tests - cd hotrod - export CYPRESS_HOTROD_NAMESPACE=$HOTROD_NAMESPACE - export CYPRESS_FRONTEND_SANDBOX_NAME=$FRONTEND_SANDBOX_NAME - export CYPRESS_LOCATION_SANDBOX_NAME=$LOCATION_SANDBOX_NAME - export CYPRESS_ROUTE_SANDBOX_NAME=$ROUTE_SANDBOX_NAME - export CYPRESS_DRIVER_SANDBOX_NAME=$DRIVER_SANDBOX_NAME - npx cypress run - env: - - name: TARGET_BRANCH - value: "@{branch}" - - name: HOTROD_NAMESPACE - value: "@{namespace}" - - name: FRONTEND_SANDBOX_NAME - value: "@{frontend_sandbox_name}" - - name: LOCATION_SANDBOX_NAME - value: "@{location_sandbox_name}" - - name: ROUTE_SANDBOX_NAME - value: "@{route_sandbox_name}" - - name: DRIVER_SANDBOX_NAME - value: "@{driver_sandbox_name}" - routingContext: - sandbox: "@{sandbox}" - uploadArtifact: - - path: hotrod/cypress/videos/hotrod.cy.js.mp4 \ No newline at end of file diff --git a/.signadot/ict/cypress-runner.yaml b/.signadot/testing/cypress-runner.yaml similarity index 100% rename from .signadot/ict/cypress-runner.yaml rename to .signadot/testing/cypress-runner.yaml diff --git a/.signadot/testing/demo-tests-job.yaml b/.signadot/testing/demo-tests-job.yaml new file mode 100644 index 0000000..877df49 --- /dev/null +++ b/.signadot/testing/demo-tests-job.yaml @@ -0,0 +1,21 @@ +spec: + namePrefix: hotrod-cypress-demo + runnerGroup: cypress + script: | + #!/bin/bash + set -e + + # Clone the git repo + echo "Cloning signadot repo" + git clone --single-branch -b "@{branch}" \ + https://github.com/signadot/hotrod.git + + # Run the cypress e2e tests + cd hotrod + export CYPRESS_HOTROD_NAMESPACE="@{namespace}" + npx cypress run + + routingContext: + sandbox: "@{sandbox}" + uploadArtifact: + - path: hotrod/cypress/videos/hotrod.cy.js.mp4 \ No newline at end of file diff --git a/.signadot/testing/e2e-tests-job.yaml b/.signadot/testing/e2e-tests-job.yaml new file mode 100644 index 0000000..50d2143 --- /dev/null +++ b/.signadot/testing/e2e-tests-job.yaml @@ -0,0 +1,26 @@ +spec: + namePrefix: hotrod-cypress-e2e + runnerGroup: cypress + script: | + #!/bin/bash + set -e + + # Clone the git repo + echo "Cloning signadot repo" + git clone --single-branch -b "@{branch}" \ + https://github.com/signadot/hotrod.git + + # Run the cypress e2e tests + cd hotrod + export CYPRESS_HOTROD_E2E="1" + export CYPRESS_HOTROD_NAMESPACE="@{namespace}" + export CYPRESS_FRONTEND_SANDBOX_NAME="@{frontend_sandbox_name}" + export CYPRESS_LOCATION_SANDBOX_NAME="@{location_sandbox_name}" + export CYPRESS_ROUTE_SANDBOX_NAME="@{route_sandbox_name}" + export CYPRESS_DRIVER_SANDBOX_NAME="@{driver_sandbox_name}" + npx cypress run + + routingContext: + sandbox: "@{sandbox}" + uploadArtifact: + - path: hotrod/cypress/videos/hotrod.cy.js.mp4 \ No newline at end of file diff --git a/cypress/e2e/hotrod.cy.js b/cypress/e2e/hotrod.cy.js index fae9bd7..afe0e9f 100644 --- a/cypress/e2e/hotrod.cy.js +++ b/cypress/e2e/hotrod.cy.js @@ -15,6 +15,10 @@ describe('hotrod spec', () => { // check if the driver has been delivered cy.get(':nth-child(6) > .css-bjcoli').contains(/Driver (.*) arriving in (.*)./); + if (Cypress.env('HOTROD_E2E') != "1"){ + return + } + // check routing context var frontendSandboxName = Cypress.env('FRONTEND_SANDBOX_NAME'); cy.get('.css-8g8ihq :nth-child(2) > :nth-child(2)').should('have.text', 'frontend');