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

WIP: BUGFIX: Fix Behat tests without CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION #4689

Closed

Conversation

bwaidelich
Copy link
Member

Fixes: #4612

@github-actions github-actions bot added the 9.0 label Nov 2, 2023
@bwaidelich
Copy link
Member Author

Draft because this is the ugliest piece of code that I produced in a long time (TooManyDrinksException) – but the approach to save the state in files seems to work in general

@mhsdesign
Copy link
Member

Hmm it makes sense that this is currently broken, as the dynamic configuration isnt available of course in the subprocess ... but i think there is no way around this than using the file system or caching this somewhere else ...

@bwaidelich
Copy link
Member Author

i think there is no way around this than using the file system or caching this somewhere else

@mhsdesign That's exactly what this PR suggests to do. What was your point?

@mhsdesign
Copy link
Member

An approval of this hack :D

@kitsunet
Copy link
Member

kitsunet commented Nov 24, 2023

I fail to understand at the moment why this is needed, especially why a file is needed? Couldn't we have this just in memory, in an array or something? or alternatively in a file cache or so? Could actually use PSR cache interfaces 🤔

@bwaidelich
Copy link
Member Author

Couldn't we have this just in memory, in an array or something?

The whole reason for this PR is to make the tests work without the CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION flag, i.e. with the sub-process catch up..
So we can't share the memory with the projection logic and since some of those rely on the configuration partly (NodeType Schema, ...) we have to persist the the config.

or alternatively in a file cache or so?

Yes, that was my initial idea but it would require a larger rewrite because we use all those traits statically o.O

@mhsdesign
Copy link
Member

i think we should move forward with this hack as it just affects the test cases. This is and improvement already as we are running our tests basically for months now only in sync mode which not reflects the real world.

But as the async tests will take way longer i still would like to only run them on merge to 9.0

... to not change the current sync mode, i think we can leave out the file writing if CATCHUPTRIGGER_ENABLE_SYNCHRONOUS_OPTION is not set? Otherwise this would lead to lots of unnecessary stuff being written while developing


private static function cacheFileName(ContentRepositoryId $contentRepositoryId): string
{
return sys_get_temp_dir() . 'nodeTypesConfiguration_' . $contentRepositoryId->value . '.json';
Copy link
Member

Choose a reason for hiding this comment

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

sys_get_temp_dir() is without trailing slash, there should be DIRECTORY_SEPARATOR in there afterwards.

Copy link
Member

Choose a reason for hiding this comment

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

or we just use FLOW_PATH_TEMPORARY so its easier to debug it when it fails :D ... i know we technically dont have a depenendcy but we do as we do use the content repository registry for tests. and that is fine. if someone wants to run the tests without flow he can improve that ;)

@mhsdesign
Copy link
Member

We just discussed that we absolutely need this change because we will move the cr to sync by default and then no one, will use and test async out of the box. Currently async is okayish covered by manual testing and the Neos ui e2e tests.
It will be already interesting if our testsuite will survive bernhards workspace change ...

@mhsdesign mhsdesign force-pushed the bugfix/4612-make-behat-tests-run-in-async-mode branch from eac52a9 to 73679ab Compare March 14, 2024 18:34
@bwaidelich
Copy link
Member Author

Will be obsolete with #4746

@bwaidelich bwaidelich closed this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Async behat tests no longer work
3 participants