-
-
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: Add another way to run tests locally with a system under test in docker #3369
Conversation
If $someone is able to come up with a better name for the make command Something like |
I just asked bing ki to fix this setup for linux lets see :D |
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.
Thank you for this ❤️ i had some small issues running this on linux at first but that is fixed now ;)
After linking the neos-ui again the Host.js is found and i could continue to actually run a test.
For some reason the tests dindt work though ... nothing happened (besides opening the publish button dropdown ... and it failed)
# WHY: We want changes of dev to appear in system under test without rebuilding the whole system | ||
rm -rf Packages/Application/Neos.Neos.Ui | ||
ln -s /usr/src/neos-ui/ /usr/src/app/TestDistribution/Packages/Application/Neos.Neos.Ui |
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.
This works in generally, but not in this flow. Later i think due to the composer reinstall neos/test-site
this linking will be gone and we have the original composer neos ui... so this step should come 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.
I used this setup and it worked for me.
Thanks for fixing the issues on Linux ❤️
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.
Well this is not fixed yet ... and I don't know why it would work on your machine ... I mean the problem is within docker after all
dc exec -T php bash <<-'BASH' | ||
rm -rf /usr/src/app/* | ||
BASH | ||
docker cp "$(pwd)"/Tests/IntegrationTests/. "$(dc ps -q php)":/usr/src/app |
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.
Todo: Lets use paths relative to the shellscript?
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.
Fine by me, I didn't want to put too much time into it and copy pasted the most stuff.
It's clear, that we could build a better system for all of this but I needed a faster feedback loop fast 😬
I want to build tests for Bugs I fix and wasting 2h just for building the test and another 2 for running them to see if the fix works and we don't mess up something else ist just too much ^^
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.
github is buggy ^^
c3527e4
to
d93c3cf
Compare
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.
Works *
What I did
I made it possible to start a neos test instance as system under test (SUT) via docker. You are able to run testcafe tests on your machine to faster implement tests and features.
How I did it
Add a shell script to start the SUT.
Add a make command to do it fast.
Add some configs to make it possible.
We Mount the NeosUi root into the SUT.
Then we symlink the
[...]/Packages/Application/Neos.Ui
to this mounted volume.We do the same for
[...]/Packages/Application/Neos.TestNodeTypes
->[...]/Tests/IntegrationTests/SharedNodeTypesPackage
.This way we can build tests, features and bugfixes without the need to restart the SUT (in 99% of cases).
This speeds up the feedback loop by at least an order of magnitude. It's insane.
We don't even need to have a Neos Instance to develop the UI! I think this could be huge for new contributors.
Just start the SUT and you have a running Neos 🚀
If you have to nuke it, just re-run the make command.
Why I did it
It's extremely slow to run tests on my local machine via docker because it completely wipes and reinstalls neos and all the things everytime I want to run 1 or 2 tests.
I decoupled the SUT and "running the tests". This makes writing tests and features so much faster for me.
How to verify it
make e2e-start-system-under-test
yarn run testcafe chrome Tests/IntegrationTests/Fixtures -T 'sidebars'
- tests should not failmake build-e2e-testing
- rebuild Uiyarn run testcafe chrome Tests/IntegrationTests/Fixtures -T 'sidebars'
- tests should fail