From 597aeb74f494ecba32df0a0eb2a17557b982182c Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Sun, 9 Jun 2024 19:29:23 +0100 Subject: [PATCH] add e2e to test release --- .github/workflows/test-release.yaml | 108 +++++++++++++++++++- Tests/Scripts/change-release-to-test-tag.sh | 5 + 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 Tests/Scripts/change-release-to-test-tag.sh diff --git a/.github/workflows/test-release.yaml b/.github/workflows/test-release.yaml index 2f98ed0328..caf8384598 100644 --- a/.github/workflows/test-release.yaml +++ b/.github/workflows/test-release.yaml @@ -889,6 +889,112 @@ jobs: node-version: 18.3.0 - run: cd HelmChart && cd Tests && bash index.sh + test-e2e-release-saas: + runs-on: ubuntu-latest + needs: [test-helm-chart] + env: + CI_PIPELINE_ID: ${{github.run_number}} + steps: + # Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18.3.0 + - run: npm run prerun && bash ./Tests/Scripts/change-release-to-test-tag.sh + - name: Start Server with release tag + run: npm run start + - name: Wait for server to start + run: bash ./Tests/Scripts/status-check.sh http://localhost + - name: Run E2E Tests. Run docker container e2e in docker compose file + run: export $(grep -v '^#' config.env | xargs) && docker-compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker-compose -f docker-compose.dev.yml logs e2e && exit 1) + - name: Upload test results + uses: actions/upload-artifact@v4 + # Run this on failure + if: failure() + with: + # Name of the artifact to upload. + # Optional. Default is 'artifact' + name: test-results + + # A file, directory or wildcard pattern that describes what to upload + # Required. + path: | + ./E2E/playwright-report + ./E2E/test-results + + + # Duration after which artifact will expire in days. 0 means using default retention. + # Minimum 1 day. + # Maximum 90 days unless changed from the repository settings page. + # Optional. Defaults to repository settings. + retention-days: 7 + + + test-e2e-release-self-hosted: + runs-on: ubuntu-latest + # After all the jobs runs + needs: [test-helm-chart] + env: + CI_PIPELINE_ID: ${{github.run_number}} + steps: + # Docker compose needs a lot of space to build images, so we need to free up some space first in the GitHub Actions runner + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: true + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18.3.0 + - run: npm run prerun && bash ./Tests/Scripts/change-release-to-test-tag.sh + - name: Start Server with release tag + run: npm run start + - name: Wait for server to start + run: bash ./Tests/Scripts/status-check.sh http://localhost + - name: Run E2E Tests. Run docker container e2e in docker compose file + run: export $(grep -v '^#' config.env | xargs) && docker-compose -f docker-compose.dev.yml up --exit-code-from e2e --abort-on-container-exit e2e || (docker-compose -f docker-compose.dev.yml logs e2e && exit 1) + - name: Upload test results + uses: actions/upload-artifact@v4 + # Run this on failure + if: failure() + with: + # Name of the artifact to upload. + # Optional. Default is 'artifact' + name: test-results + + # A file, directory or wildcard pattern that describes what to upload + # Required. + path: | + ./E2E/playwright-report + ./E2E/test-results + + + # Duration after which artifact will expire in days. 0 means using default retention. + # Minimum 1 day. + # Maximum 90 days unless changed from the repository settings page. + # Optional. Defaults to repository settings. + retention-days: 7 - \ No newline at end of file + + \ No newline at end of file diff --git a/Tests/Scripts/change-release-to-test-tag.sh b/Tests/Scripts/change-release-to-test-tag.sh new file mode 100644 index 0000000000..d845f0edc5 --- /dev/null +++ b/Tests/Scripts/change-release-to-test-tag.sh @@ -0,0 +1,5 @@ +# This script replcaes APP_TAG in config.env to test +# This is used to change the release tag to test tag for the tests + +# Replace APP_TAG in config.env to test +sed -i 's/APP_TAG=latest/APP_TAG=test/g' config.env \ No newline at end of file