-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TASK: Use saucectl with configuration #3851
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
686c4af
TASK: Use saucectl with configuration
markusguenther 7500a0b
TASK: Adds missing API version
markusguenther 0567adf
TASK: Adjust test suite pathes
markusguenther 22bb4af
TASK: Test test config per dimensions
markusguenther e99ddcd
TASK: Adds Sauce Connect Proxy 5 to CircleCI
markusguenther 0f743fd
BUGIX: Adds missing region
markusguenther 5e3a427
BUGFIX: Move tunnel config
markusguenther 4a89fe2
TASK: Add .sauceignore file and move tunnel start
markusguenther 8a3b267
BUGFIX: Add missing npm dependencies
markusguenther 0d9ff89
TASK: Adjust .sauceignore and remove node module
markusguenther fa168a0
BUGFIX: Allow localhost proxy
markusguenther 5a18396
TASK: Show console.logs
markusguenther dbf89a2
TASK: Tests 1 dimensional tests on Mac and Windows 10
markusguenther ed2fdde
TASK: Limit how many suites are executed at the same time.
markusguenther 6a29783
TASK: Add screenResolution as tests on mac could not resize
markusguenther b9cb524
TASK: Change MacOS screen size
markusguenther af71bd0
TASK: Enable smart retries when a test failed
markusguenther 948429b
TASK: Change reporting config and fix dimension path
markusguenther d5b9dba
TASK: Remove feature to comment PR
markusguenther a48f01c
TASK: Add more files to artifact download
markusguenther 5000f74
TASK: Fetch target branch and use it as saucelabs tag
markusguenther 8905c2e
TASK: Install newer version of GitHub CLI
markusguenther 863412f
TASK: Passthru the target branch
markusguenther File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: 2.0 | ||
version: 2.1 | ||
|
||
aliases: | ||
- &workspace_root ~/neos-ui-workspace | ||
|
@@ -40,6 +40,9 @@ aliases: | |
paths: | ||
- . | ||
|
||
orbs: | ||
gh: circleci/[email protected] | ||
|
||
jobs: | ||
checkout: | ||
docker: | ||
|
@@ -89,9 +92,20 @@ jobs: | |
MYSQL_ROOT_PASSWORD: not_a_real_password | ||
working_directory: *workspace_root | ||
steps: | ||
- checkout | ||
- attach_workspace: *attach_workspace | ||
- restore_cache: *restore_app_cache | ||
|
||
- gh/install | ||
- run: | ||
name: Login to GitHub | ||
command: | | ||
echo $AUTH_TOKEN_GITHUB | gh auth login --with-token | ||
- run: | ||
name: Install Sauce Connect | ||
command: | | ||
curl -L -o sauce-connect.deb https://saucelabs.com/downloads/sauce-connect/5.1.3/sauce-connect_5.1.3.linux_amd64.deb | ||
sudo dpkg -i sauce-connect.deb | ||
- run: rm -rf /home/circleci/app/Packages/Application/Neos.Neos.Ui | ||
- run: cd /home/circleci/app/Packages/Application && mv ~/neos-ui-workspace Neos.Neos.Ui | ||
- run: | | ||
|
@@ -108,46 +122,37 @@ jobs: | |
- run: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash | ||
- run: chmod +x ~/.nvm/nvm.sh | ||
- run: | ||
name: Start Sauce Connect | ||
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: Define target branch | ||
command: | | ||
TARGET_BRANCH=$(gh pr view $CIRCLE_PULL_REQUEST --json baseRefName --jq '.baseRefName') | ||
echo "Target Branch: $TARGET_BRANCH" | ||
# Save the variable to BASH_ENV to be able to access it in the next steps | ||
echo "export TARGET_BRANCH=$TARGET_BRANCH" >> $BASH_ENV | ||
- run: | ||
name: Use target branch | ||
command: | | ||
echo "Using target branch: $TARGET_BRANCH" | ||
- run: | ||
name: Prepare and run e2e tests | ||
no_output_timeout: 30m | ||
command: | | ||
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 > /home/circleci/app/Data/Logs/AcceptanceTesting.log | ||
make test-e2e-saucelabs | ||
- store_artifacts: | ||
path: /home/circleci/app/Data/Logs | ||
- persist_to_workspace: | ||
root: /home/circleci/app/Data/Logs | ||
paths: | ||
- . | ||
|
||
post-acceptance-tests-recordings: | ||
environment: | ||
FLOW_CONTEXT: Production | ||
docker: | ||
- image: cimg/php:8.2-node | ||
|
||
steps: | ||
- attach_workspace: | ||
at: /home/circleci/app | ||
- run: | ||
name: Install GitHub CLI and jq | ||
command: | | ||
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) | ||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ | ||
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ | ||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | ||
&& sudo apt update \ | ||
&& sudo apt install gh -y | ||
- run: | ||
name: Run Script | ||
command: | | ||
JOB_IDS=$(cat /home/circleci/app/AcceptanceTesting.log | grep -o 'https://app.saucelabs.com/tests/[a-zA-Z0-9]\+' | sed 's/.*\///') | ||
echo "Job IDs: $JOB_IDS" | ||
/home/circleci/app/Build/comment-acceptance-tests.sh "$JOB_IDS" "$(basename "$CIRCLE_PULL_REQUEST")" | ||
|
||
php-unittests: | ||
environment: | ||
FLOW_CONTEXT: Production | ||
|
@@ -186,9 +191,6 @@ workflows: | |
- e2e: | ||
requires: | ||
- build_flow_app | ||
- post-acceptance-tests-recordings: | ||
requires: | ||
- e2e | ||
- php-unittests: | ||
requires: | ||
- build_flow_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
apiVersion: v1alpha | ||
kind: testcafe | ||
showConsoleLog: true | ||
sauce: | ||
region: us-west-1 | ||
concurrency: 1 # Controls how many suites are executed at the same time. | ||
retries: 3 | ||
metadata: | ||
tags: | ||
- e2e | ||
- $TARGET_BRANCH | ||
build: $TARGET_BRANCH | ||
tunnel: | ||
name: "circleci-tunnel" | ||
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: | ||
- "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" | ||
platformName: "Windows 10" | ||
screenResolution: "1280x1024" | ||
smartRetry: | ||
failedOnly: true | ||
- name: "One dimensional Tests in Firefox on MacOS" | ||
browserName: "firefox" | ||
src: | ||
- "Tests/IntegrationTests/Fixtures/1Dimension/*.e2e.js" | ||
platformName: "macOS 13" | ||
screenResolution: "1440x900" | ||
smartRetry: | ||
failedOnly: true | ||
npm: | ||
dependencies: | ||
- testcafe-react-selectors | ||
|
||
# Controls what artifacts to fetch when the suites have finished. | ||
artifacts: | ||
download: | ||
match: | ||
- neosui-two-dimensional-test-report.json | ||
- console.log | ||
- sauce-test-report.json | ||
when: always | ||
allAttempts: true | ||
directory: ../../Data/Logs/saucelabs-artifacts/ | ||
|
||
reporters: | ||
json: | ||
enabled: true | ||
filename: neosui-one-dimensional-test-report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: v1alpha | ||
kind: testcafe | ||
sauce: | ||
region: us-west-1 | ||
concurrency: 1 # Controls how many suites are executed at the same time. | ||
retries: 3 | ||
metadata: | ||
tags: | ||
- e2e | ||
- $TARGET_BRANCH | ||
build: $TARGET_BRANCH | ||
tunnel: | ||
name: "circleci-tunnel" | ||
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: "Two dimensional Tests in Firefox on Windows" | ||
browserName: "firefox" | ||
src: | ||
- "Tests/IntegrationTests/Fixtures/2Dimension/*.e2e.js" | ||
platformName: "Windows 10" | ||
screenResolution: "1280x1024" | ||
smartRetry: | ||
failedOnly: true | ||
- name: "Two dimensional Tests in Firefox on MacOS" | ||
browserName: "firefox" | ||
src: | ||
- "Tests/IntegrationTests/Fixtures/2Dimension/*.e2e.js" | ||
platformName: "macOS 13" | ||
screenResolution: "1440x900" | ||
smartRetry: | ||
failedOnly: true | ||
npm: | ||
dependencies: | ||
- testcafe-react-selectors | ||
|
||
# Controls what artifacts to fetch when the suites have finished. | ||
artifacts: | ||
download: | ||
match: | ||
- neosui-two-dimensional-test-report.json | ||
- console.log | ||
- sauce-test-report.json | ||
when: always | ||
allAttempts: true | ||
directory: ../../Data/Logs/saucelabs-artifacts/ | ||
|
||
reporters: | ||
json: | ||
enabled: true | ||
filename: neosui-two-dimensional-test-report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file instructs saucectl to not package any files mentioned here. | ||
.git/ | ||
.github/ | ||
.DS_Store | ||
.hg/ | ||
.vscode/ | ||
.idea/ | ||
.gitignore | ||
.hgignore | ||
.gitlab-ci.yml | ||
.npmrc | ||
*.gif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/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" | ||
dimension=$(basename "$fixture") | ||
echo "$dimension" | ||
|
||
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 --config .sauce/config${dimension}.yml | ||
cd ../../.. | ||
rm -f DistributionPackages/Neos.TestSite | ||
|
||
done | ||
|
||
rm -rf DistributionPackages | ||
mv DummyDistributionPackages DistributionPackages |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need another script that is almost
e2e.sh
? that will it make hard to maintain, especially since in neos 9 the script is partly rewritten. So we def need adjustments for Neos 9 ... and it probably better to have a shared script for local and sauce e2e tests?