From e05b62c75fcec96ee1b4c725313d37a622a4f0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gu=CC=88nther?= Date: Thu, 19 Sep 2024 19:12:28 +0200 Subject: [PATCH] TASK: Passthru the target branch --- .circleci/config.yml | 10 ++++------ .sauce/config1Dimension.yml | 2 ++ Makefile | 2 +- Tests/IntegrationTests/e2e-saucelabs.sh | 5 ++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3ab04abb03..a6154e78e4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,11 +101,6 @@ jobs: name: Login to GitHub command: | echo $AUTH_TOKEN_GITHUB | gh auth login --with-token - - run: - name: Define target branch - command: | - TARGET_BRANCH=$(gh pr view $CIRCLE_PULL_REQUEST --json baseRefName --jq '.baseRefName') - echo "Target Branch: $TARGET_BRANCH" - run: name: Install Sauce Connect command: | @@ -131,14 +126,17 @@ jobs: background: true command: sc run --username ${SAUCE_USERNAME} --access-key ${SAUCE_ACCESS_KEY} --tunnel-name "circleci-tunnel" --region "us-west-1" --proxy-localhost allow - run: + name: Prepare and run e2e tests no_output_timeout: 30m command: | + TARGET_BRANCH=$(gh pr view $CIRCLE_PULL_REQUEST --json baseRefName --jq '.baseRefName') + echo "Using target branch: $TARGET_BRANCH" export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" cd /home/circleci/app/Packages/Application/Neos.Neos.Ui nvm install nvm use - make test-e2e-saucelabs + make test-e2e-saucelabs "$TARGET_BRANCH" - store_artifacts: path: /home/circleci/app/Data/Logs - persist_to_workspace: diff --git a/.sauce/config1Dimension.yml b/.sauce/config1Dimension.yml index 519bb7c8eb..8fc206fc5f 100644 --- a/.sauce/config1Dimension.yml +++ b/.sauce/config1Dimension.yml @@ -12,6 +12,8 @@ sauce: build: Release $CI_COMMIT_SHORT_SHA tunnel: name: "circleci-tunnel" +env: + branch: $TARGET_BRANCH testcafe: version: 3.6.2 # Controls what files are available in the context of a test run (unless explicitly excluded by .sauceignore). diff --git a/Makefile b/Makefile index 8c943de2f8..a9289022c7 100644 --- a/Makefile +++ b/Makefile @@ -108,7 +108,7 @@ test: ## Executes integration tests on saucelabs. test-e2e-saucelabs: - bash Tests/IntegrationTests/e2e-saucelabs.sh + bash Tests/IntegrationTests/e2e-saucelabs.sh $(TARGET_BRANCH) ## Executes integration tests locally. test-e2e: diff --git a/Tests/IntegrationTests/e2e-saucelabs.sh b/Tests/IntegrationTests/e2e-saucelabs.sh index 5f70a9af10..37d459641a 100755 --- a/Tests/IntegrationTests/e2e-saucelabs.sh +++ b/Tests/IntegrationTests/e2e-saucelabs.sh @@ -25,6 +25,8 @@ mv DistributionPackages DummyDistributionPackages mkdir DistributionPackages ln -s "../Packages/Application/Neos.Neos.Ui/Tests/IntegrationTests/SharedNodeTypesPackage" DistributionPackages/Neos.TestNodeTypes +export TARGET_BRANCH=$1 +echo "Using target branch: $TARGET_BRANCH" for fixture in Packages/Application/Neos.Neos.Ui/Tests/IntegrationTests/Fixtures/*/; do echo "$fixture" @@ -49,7 +51,8 @@ for fixture in Packages/Application/Neos.Neos.Ui/Tests/IntegrationTests/Fixtures ./flow resource:publish cd Packages/Application/Neos.Neos.Ui - saucectl run --config .sauce/config${dimension}.yml + echo "Running saucectl with config .sauce/config${dimension}.yml for $TARGET_BRANCH" + saucectl run --config .sauce/config${dimension}.yml --env TARGET_BRANCH=$1 cd ../../.. rm -f DistributionPackages/Neos.TestSite