Skip to content
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: stabilize local bare metal e2e tests inside neos dev collection #3627

Merged
merged 5 commits into from
Sep 28, 2023

Conversation

mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Sep 25, 2023

I was searching for an ultimate local test setup. And i found out that when linking the test distribution package into my dev collection, i can run the tests 🥳

  "repositories": {
    "testDistPackageNeosUI": {
      "type": "path",
      "url": "./Packages/Application/Neos.Neos.Ui/Tests/IntegrationTests/TestDistribution/DistributionPackages/*"
    }
  },

after this step i included the packages in my neos dev collection's composer root

    "neos/test-onedimension": "@dev",
    "neos/test-twodimensions": "@dev",
    "neos/test-nodetypes": "@dev"

and run update "neos/test-*" and flow flow:package:rescan

after this i setup both of the sites (see Tests/IntegrationTests/e2e.sh):

./flow cr:setup --content-repository onedimension
./flow site:create neos-test-onedimension Neos.Test.OneDimension Neos.TestNodeTypes:Document.HomePage
./flow domain:add neos-test-onedimension onedimension.localhost --port 8081
# TODO: Replace with "--assume-yes" flag once "./flow cr:prune" has one
printf "y\n" | ./flow cr:prune --content-repository onedimension
./flow cr:import --content-repository onedimension --path resource://Neos.Test.OneDimension/Private/Content

./flow cr:setup --content-repository twodimensions
./flow site:create neos-test-twodimensions Neos.Test.TwoDimensions Neos.TestNodeTypes:Document.HomePage
./flow domain:add neos-test-twodimensions twodimensions.localhost --port 8081
# TODO: Replace with "--assume-yes" flag once "./flow cr:prune" has one
printf "y\n" | ./flow cr:prune --content-repository twodimensions
./flow cr:import --content-repository twodimensions --path resource://Neos.Test.TwoDimensions/Private/Content

The admin user with password admin must exist as well.

After this you should be able to run the tests via

yarn run testcafe "chrome" "Tests/IntegrationTests/Fixtures/*/*.e2e.js" --selector-timeout=10000 --assertion-timeout=30000

to update your local setup / reset the content repositories, you mostly only need to prune them and reimport:

printf "y\n" | ./flow cr:prune --content-repository onedimension
./flow cr:import --content-repository onedimension --path resource://Neos.Test.OneDimension/Private/Content

printf "y\n" | ./flow cr:prune --content-repository twodimensions
./flow cr:import --content-repository twodimensions --path resource://Neos.Test.TwoDimensions/Private/Content

What I did

How I did it

How to verify it

@mhsdesign mhsdesign changed the title TASK: stabilize local e2 e tests TASK: stabilize local e2e tests with Neos.Demo installed Sep 25, 2023
@mhsdesign mhsdesign changed the title TASK: stabilize local e2e tests with Neos.Demo installed TASK: stabilize local bare metal e2e tests inside neos dev collection Sep 25, 2023
Copy link
Contributor

@grebaldi grebaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 by reading + local testing of make test-e2e-docker

I need to mention that I do not quite understand the purpose of this PR 😅 . I have noticed earlier, that we're apparently maintaining two different ways of running the E2E tests locally (is it with and without docker? - idk).

Does make test-e2e-docker not work for you? Or is there another reason?

@mhsdesign
Copy link
Member Author

Thanks for testing;)

I need to mention that I do not quite understand the purpose of this PR 😅 . I have noticed earlier, that we're apparently maintaining two different ways of running the E2E tests locally (is it with and without docker? - idk).

Yes one always has the option to run without docker as we need that for circle ci.

Does make test-e2e-docker not work for you? Or is there another reason?

It works very well and I’m glad we have it. But for testing changes from the dev collection and debugging Neos.Neos code directly I like to work directly natively. Also on Mac OS there is a certain overhead when using docker.

My ultimate advantage is that I now have 3 sites in my regular neos 9 dev collection: the demo and both of the test sites from the ui by symlinking them. That allows me to run local e2e tests directly with changes across repositories :D And I need no docker ;)

So most of the changes are made so there are no conflicts if the Neos.Demo is installed as it provides also a few nodeTypes.

@mhsdesign mhsdesign merged commit 9a0080b into 9.0 Sep 28, 2023
3 checks passed
@mhsdesign mhsdesign deleted the task/stabilizeLocalE2ETests branch September 28, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants