Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/8.4' into 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Sep 27, 2024
2 parents 1ba2db4 + 1835451 commit ca41c4e
Show file tree
Hide file tree
Showing 32 changed files with 293 additions and 163 deletions.
67 changes: 37 additions & 30 deletions .circleci/config.yml
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
Expand Down Expand Up @@ -40,6 +40,9 @@ aliases:
paths:
- .

orbs:
gh: circleci/[email protected]

jobs:
checkout:
docker:
Expand Down Expand Up @@ -90,9 +93,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: |
Expand All @@ -110,6 +124,27 @@ 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: |
# Get the target branch of the PR but when we are not one a PR, use the current branch
if [ -n "$CIRCLE_PULL_REQUEST" ]; then
TARGET_BRANCH=$(gh pr view $CIRCLE_PULL_REQUEST --json baseRefName --jq '.baseRefName')
else
TARGET_BRANCH=$CIRCLE_BRANCH
fi
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"
Expand All @@ -119,39 +154,14 @@ jobs:
nvm use
echo 127.0.0.1 onedimension.localhost | sudo tee -a /etc/hosts
echo 127.0.0.1 twodimensions.localhost | sudo tee -a /etc/hosts
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
Expand Down Expand Up @@ -204,9 +214,6 @@ workflows:
- e2e:
requires:
- build_flow_app
- post-acceptance-tests-recordings:
requires:
- e2e
- php-unittests:
requires:
- build_flow_app
Expand Down
52 changes: 52 additions & 0 deletions .sauce/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: v1alpha
kind: testcafe
showConsoleLog: true
sauce:
region: us-west-1
concurrency: 1 # Controls how many suites are executed at the same time.
# todo fix and enable retries
retries: 0
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: "Tests in Firefox on Windows"
browserName: "firefox"
src:
- "Tests/IntegrationTests/Fixtures/*/*.e2e.js"
platformName: "Windows 10"
screenResolution: "1280x1024"
- name: "Tests in Firefox on MacOS"
# todo use chrome here and fix ci https://github.com/neos/neos-ui/issues/3591
browserName: "firefox"
src:
- "Tests/IntegrationTests/Fixtures/*/*.e2e.js"
platformName: "macOS 13"
screenResolution: "1440x900"
npm:
dependencies:
- testcafe-react-selectors

# Controls what artifacts to fetch when the suites have finished.
artifacts:
download:
match:
- neosui-test-report.json
- console.log
- sauce-test-report.json
when: always
allAttempts: true
directory: ../../Data/Logs/saucelabs-artifacts/

reporters:
json:
enabled: true
filename: neosui-test-report.json
12 changes: 12 additions & 0 deletions .sauceignore
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
2 changes: 1 addition & 1 deletion Build/Jenkins/update-neos-ui-compiled.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export NODE_OPTIONS="--max-old-space-size=4096"

nvm install && nvm use
make clean && make setup
NEOS_UI_VERSION="${GIT_TAG:-${GIT_BRANCH}-dev}" make build-production
NEOS_UI_VERSION="${GIT_TAG:-${GIT_BRANCH#*/}-dev}" make build-production

rm -Rf tmp_compiled_pkg
git clone [email protected]:neos/neos-ui-compiled.git tmp_compiled_pkg
Expand Down
71 changes: 0 additions & 71 deletions Build/comment-acceptance-tests.sh

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ test:

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

## Executes integration tests locally.
test-e2e:
bash Tests/IntegrationTests/e2e.sh chrome:--disable-search-engine-choice-screen
bash Tests/IntegrationTests/e2e.sh --browser chrome:--disable-search-engine-choice-screen

## Executes integration tests locally in a docker-compose setup.
#
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ To speed up the e2e-test workflow/feedback loop you can start the system under t
* The neos dev instance is available at `localhost:8081`
* To enter the container run `docker compose -f Tests/IntegrationTests/docker-compose.neos-dev-instance.yaml exec php bash`
* `yarn run testcafe <browser> <testFile> <optional flags>`
* for example, this runs all tests in chrome: (NOTE starting with Chrome 127, --disable-search-engine-choice-screen is needed)
* for example, this runs all tests in chrome: (NOTE starting with Chrome 127, --disable-search-engine-choice-screen is needed until https://github.com/DevExpress/testcafe/pull/8248 is released)
`yarn run testcafe chrome:--disable-search-engine-choice-screen Tests/IntegrationTests/Fixtures/1Dimension`
* some helpful optional flags are
* `-T 'sidebars'` - grep tests by pattern and only execute those
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ test('SelectBox opens below and breaks out of the creation dialog if there\'s en

test('SelectBox opens above in creation dialog if there\'s not enough space below.', async t => {
await t
.resizeWindow(1200, 768)
.click(Selector('#neos-PageTree-AddNode'))
.click(ReactSelector('NodeTypeItem').withExactText('SelectBox opens above'))
.click(ReactSelector('NodeCreationDialog SelectBox'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
groups:
test:
label: Test
# move it before the general document meta-data so there is
# also space below when opening it in the e2e tests
position: start
properties:
TextField:
type: string
Expand Down
Loading

0 comments on commit ca41c4e

Please sign in to comment.