Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/8.3' into feature/cssBuildRefactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Feb 20, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 1059be2 + b082a54 commit c6c8f59
Showing 71 changed files with 403 additions and 155 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/add-pr-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Add Labels to Pull Request

on:
pull_request:
types: [opened, reopened, synchronize, edited]

jobs:
add-labels:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Maybe remove base branch label
if: github.event.action == 'edited' && github.event.changes.base.ref.from != ''
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: ${{ github.event.changes.base.ref.from }}
- name: Add feature label
if: startsWith(github.event.pull_request.title, 'FEATURE:')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'Feature'
- name: Add bugfix label
if: startsWith(github.event.pull_request.title, 'BUGFIX:')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'Bug'
- name: Add task label
if: startsWith(github.event.pull_request.title, 'TASK:')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'Task'
- name: Add target branch label
uses: actions-ecosystem/action-add-labels@v1
with:
labels: ${{ github.base_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -126,6 +126,9 @@ test-e2e:
test-e2e-docker:
@bash Tests/IntegrationTests/e2e-docker.sh $(or $(browser),chrome)

start-neos-dev-instance:
bash Tests/IntegrationTests/start-neos-dev-instance.sh

## Executes make lint-js and make lint-editorconfig.
lint: lint-js lint-editorconfig

14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -167,6 +167,20 @@ To setup end-to-end tests locally you have got to do the same things described i
For executing the end to end tests on a Mac with catalina or higher you need to permit screen recording. Open 'System Preferences > Security & Privacy > Privacy > Screen Recording' and check 'TestCafe Browser Tools' in the application list.
#### Local Development with e2e-tests & docker
To speed up the e2e-test workflow/feedback loop you can start the system under test in a docker setup and run the tests against that:
* `make start-neos-dev-instance` (starts a docker setup with the system under test)
* 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:
`yarn run testcafe chrome Tests/IntegrationTests/Fixtures`
* some helpful optional flags are
* `-T 'sidebars'` - grep tests by pattern and only execute those
* `--selector-timeout=10000` - if you work on async pieces of the UI then this might help to prevent race conditions
* `--assertion-timeout=30000` - see above
* `--debug-on-fail` - you can debug the state of the app at the moment an assertion failed
##### Debugging integration tests
* View the recording via Sauce Labs. You can find the url in the beginning of the test output.
25 changes: 25 additions & 0 deletions Tests/IntegrationTests/docker-compose.neos-dev-instance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "3.4"
services:

php:
image: thecodingmachine/php:8.0-v4-cli-node16
command: tail -f /dev/null
ports:
- 8081:8081
volumes:
- composer_cache:/home/circleci/.composer/cache
# add Neos Ui root as cached read-only volume that will be later symlinked into TestDistribution/Packages/
- ../../.:/usr/src/neos-ui:cached,ro
environment:
# Enable GD
PHP_EXTENSION_GD: 1
COMPOSER_CACHE_DIR: /home/circleci/.composer/cache

db:
image: mysql:8
environment:
MYSQL_DATABASE: neos
MYSQL_ROOT_PASSWORD: not_a_real_password

volumes:
composer_cache:
89 changes: 89 additions & 0 deletions Tests/IntegrationTests/start-neos-dev-instance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env bash

set -e

function dc() {
# use the docker composer plugin
docker compose -f ./Tests/IntegrationTests/docker-compose.neos-dev-instance.yaml $@
}

echo "#############################################################################"
echo "# Start docker environment... #"
echo "#############################################################################"
dc down
dc up -d
dc exec -T php bash <<-'BASH'
rm -rf /usr/src/app/*
BASH
docker cp "$(pwd)"/Tests/IntegrationTests/. "$(dc ps -q php)":/usr/src/app
sleep 2

echo ""
echo "#############################################################################"
echo "# Install dependencies... #"
echo "#############################################################################"
dc exec -T php bash <<-'BASH'
cd /usr/src/app
sudo chown -R docker:docker .
sudo chown -R docker:docker /home/circleci/
cd TestDistribution
composer install
BASH

echo "#############################################################################"
echo "# Initialize Neos... #"
echo "#############################################################################"
dc exec -T php bash <<-'BASH'
cd TestDistribution
sed -i 's/host: 127.0.0.1/host: db/g' Configuration/Settings.yaml
./flow flow:cache:flush
./flow flow:cache:warmup
./flow doctrine:migrate
./flow user:create --username=admin --password=password --first-name=John --last-name=Doe --roles=Administrator || true
BASH

echo ""
echo "#############################################################################"
echo "# Start Flow Server... #"
echo "#############################################################################"
dc exec -T php bash <<-'BASH'
cd TestDistribution
./flow server:run --port 8081 --host 0.0.0.0 &
BASH

dc exec -T php bash <<-BASH
mkdir -p ./TestDistribution/DistributionPackages
rm -rf ./TestDistribution/DistributionPackages/Neos.TestSite
ln -s "../../Fixtures/1Dimension/SitePackage" ./TestDistribution/DistributionPackages/Neos.TestSite
# TODO: optimize this
cd TestDistribution
composer reinstall neos/test-site
./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
BASH

echo ""
echo "#############################################################################"
echo "# Create sym links to mounted Docker volumes... #"
echo "#############################################################################"
echo ""
dc exec -T php bash <<-'BASH'
# replace installed Neos Ui with local dev via sym link to mounted volume
# WHY: We want changes of dev to appear in system under test without rebuilding the whole system
rm -rf /usr/src/app/TestDistribution/Packages/Application/Neos.Neos.Ui
ln -s /usr/src/neos-ui /usr/src/app/TestDistribution/Packages/Application/Neos.Neos.Ui
# enable changes of the Neos.TestNodeTypes outside of the container to appear in the container via sym link to mounted volume
rm -rf /usr/src/app/TestDistribution/Packages/Application/Neos.TestNodeTypes
ln -s /usr/src/neos-ui/Tests/IntegrationTests/SharedNodeTypesPackage/ /usr/src/app/TestDistribution/Packages/Application/Neos.TestNodeTypes
BASH
2 changes: 1 addition & 1 deletion Tests/IntegrationTests/utils.js
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ export async function checkPropTypes() {
delete error[0];
}
// Quick fix to be able to use node 16 with testcafe @see https://github.com/DevExpress/testcafe/issues/7097
if (error[0] && error[0].search('hammerhead.js:15:1506') >= 0) {
if (error[0] && error[0].search('hammerhead.js') >= 0) {
delete error[0];
}
if (error[0]) {
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -12,6 +12,9 @@
"isemail@3.2.0": "patch:isemail@npm:3.2.0#./patches/isemail-npm-3.2.0-browserified.patch",
"react-codemirror2@7.2.1": "patch:react-codemirror2@npm:7.2.1#./patches/react-codemirror2-npm-7.2.1-browserified.patch"
},
"scripts": {
"lint": "tsc --noemit"
},
"engines": {
"node": "~16"
},
8 changes: 1 addition & 7 deletions packages/jest-preset-neos-ui/src/esbuildTransformer.js
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ function isTarget(path) {
// you can clear the jest cache also by running `yarn jest --clearCache`
const thisFileRaw = readFileSync(__filename)

const tsconfigRaw = readFileSync("../tsconfig.json", "utf8");
const tsconfigRaw = readFileSync("../../tsconfig.json", "utf8");

const createTransformer = () => {
/** @type {import("esbuild").TransformOptions} */
@@ -63,12 +63,6 @@ const createTransformer = () => {
...options,
});


if (result.code.includes("ichBinDasIcon")) {
console.log({path});
console.log(result.code);
}

if (result.warnings.length) {
result.warnings.forEach((m) => {
// eslint-disable-next-line no-console
2 changes: 1 addition & 1 deletion packages/neos-ts-interfaces/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"scripts": {
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-backend-connector/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-constants/package.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"main": "./src/index.js",
"scripts": {
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}"
"lint": "eslint src/**/*.{js,jsx,ts,tsx}"
},
"devDependencies": {
"@neos-project/babel-preset-neos-ui": "workspace:*",
2 changes: 1 addition & 1 deletion packages/neos-ui-containers/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"scripts": {
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-contentrepository/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-decorators/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-extensibility/package.json
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
"build": "yarn tsc --declaration",
"build:watch": "yarn tsc --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
5 changes: 4 additions & 1 deletion packages/neos-ui-extensibility/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "./../tsconfig.json",
"include": [
"src"
],
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
}
2 changes: 1 addition & 1 deletion packages/neos-ui-guest-frame/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn run jest -- --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-i18n/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-inspector/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"dependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-redux-store/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-sagas/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
2 changes: 1 addition & 1 deletion packages/neos-ui-validators/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"scripts": {
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"clean": "rimraf ./lib ./dist",
"jest": "NODE_ENV=test jest"
},
2 changes: 1 addition & 1 deletion packages/neos-ui-views/package.json
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
"lodash.isequal": "^4.5.0",
"moment": "^2.20.1",
"plow-js": "3.0.0",
"recharts": "^1.0.0-alpha.6"
"recharts": "^2.4.1"
},
"devDependencies": {
"@neos-project/babel-preset-neos-ui": "workspace:*",
2 changes: 1 addition & 1 deletion packages/positional-array-sorter/package.json
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"build": "yarn tsc --declaration",
"build:watch": "yarn tsc --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
5 changes: 4 additions & 1 deletion packages/positional-array-sorter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "./../tsconfig.json",
"include": [
"src"
],
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
}
2 changes: 1 addition & 1 deletion packages/react-proptypes/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"test": "yarn jest -w 2 --coverage",
"test:watch": "yarn jest --watch",
"clean": "rimraf ./lib ./dist",
"lint": "yarn tsc --noemit && eslint src/**/*.{js,jsx,ts,tsx}",
"lint": "eslint src/**/*.{js,jsx,ts,tsx}",
"jest": "NODE_ENV=test jest"
},
"devDependencies": {
Loading

0 comments on commit c6c8f59

Please sign in to comment.