Skip to content

Commit

Permalink
TASK: Use saucectl with configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
markusguenther committed Sep 17, 2024
1 parent 7528bb9 commit 686c4af
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .sauce/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
kind: testcafe
sauce:
region: us-west-1
concurrency: 2 # Controls how many suites are executed at the same time.
metadata:
tags:
- e2e
- release team
- other tag
build: Release $CI_COMMIT_SHORT_SHA
testcafe:
version: 3.6.2
# Controls what files are available in the context of a test run (unless explicitly excluded by .sauceignore).
rootDir: ./
suites:
- name: "One dimensional Tests in Firefox on Windows"
browserName: "firefox"
src:
- "../../../1Dimension/*.e2e.js"
platformName: "Windows 11"
- name: "Two dimensional Tests in Firefox on Windows"
browserName: "firefox"
src:
- "../../../2Dimension/*.e2e.js"
platformName: "Windows 11"

# Controls what artifacts to fetch when the suites have finished.
artifacts:
download:
when: always
match:
- console.log
directory: ./artifacts/

reporters:
spotlight: # Prints an overview of failed or otherwise interesting jobs.
enabled: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ test:

## Executes integration tests on saucelabs.
test-e2e-saucelabs:
bash Tests/IntegrationTests/e2e.sh "saucelabs:Firefox@latest:Windows 10"
bash Tests/IntegrationTests/e2e-saucelabs.sh

## Executes integration tests locally.
test-e2e:
Expand Down
57 changes: 57 additions & 0 deletions Tests/IntegrationTests/e2e-saucelabs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash

set -ex

# Check if saucectl is installed
if ! command -v saucectl &> /dev/null; then
echo "saucectl is not installed. Installing saucectl..."
# Install saucectl via npm (assuming npm is installed)
npm install -g saucectl
fi

# Check if SAUCE_USERNAME and SAUCE_ACCESS_KEY are set
if [[ -n "$SAUCE_USERNAME" && -n "$SAUCE_ACCESS_KEY" ]]; then
echo "SAUCE_USERNAME and SAUCE_ACCESS_KEY are set. Configuring saucectl..."
#saucectl configure
else
echo "SAUCE_USERNAME or SAUCE_ACCESS_KEY is not set. Skipping saucectl configuration."
exit 1
fi

cd ../../..

rm -rf DummyDistributionPackages || true
mv DistributionPackages DummyDistributionPackages
mkdir DistributionPackages

ln -s "../Packages/Application/Neos.Neos.Ui/Tests/IntegrationTests/SharedNodeTypesPackage" DistributionPackages/Neos.TestNodeTypes

for fixture in Packages/Application/Neos.Neos.Ui/Tests/IntegrationTests/Fixtures/*/; do
echo "$fixture"

ln -s "../${fixture}SitePackage" DistributionPackages/Neos.TestSite

# TODO: optimize this
composer reinstall neos/test-nodetypes
composer reinstall neos/test-site
# make sure neos is installed even if patching led to the removal (bug)
composer update neos/neos-development-collection
./flow flow:cache:flush --force
./flow flow:cache:warmup
./flow configuration:show --path Neos.ContentRepository.contentDimensions

if ./flow site:list | grep -q 'Node name'; then
./flow site:prune '*'
fi
./flow site:import --package-key=Neos.TestSite
./flow resource:publish

cd Packages/Application/Neos.Neos.Ui
saucectl run
cd ../../..
rm -f DistributionPackages/Neos.TestSite

done

rm -rf DistributionPackages
mv DummyDistributionPackages DistributionPackages

0 comments on commit 686c4af

Please sign in to comment.