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
Internal: Disable clean-up in Behat tests #3393
Conversation
We previously utilised a lot of clean-up steps to make sure our tests didn't affect eachother. However we've since moved to a scenario where both in the CI and locally a new database is loaded between scenarios, this makes the clean-up no longer needed. Additionally if the clean-up does run then this makes debugging a failed test a lot more difficult because you can't inspect the state of the platform at the time the test failed. This commit ensures that all the clean-up that is provided by the DrupalExtension by default is disabled. For this we have to disable autoloading of sub-contexts (which we weren't using anyway) because the search_api contained a `behat.inc` file that would load the `RawDrupalContext` class which contained more cleaning. There are DrupalExtension stories open to remove the cleaning from `RawDrupalContext`, but we don't have time to wait for that. We also add a step in our CI to dump the failed database to disk along with the installation.sql file. This allows a developer to load the failed database locally and see what was going wrong without having to rerun the test.
Thanks for contributing towards Open Social! A maintainer from the @goalgorilla/maintainers group might not review all changes from all teams/contributors. Please don't be discouraged if it takes a while. In the meantime, we have some automated checks running and it might be that you will see our comments with some tips or requests to speed up the review process. 😊 |
❌ Error Occurred while executing an ActionIf you believe this is an unexpected error, please report it on our issue tracker: https://github.com/mergeability/mergeable/issues/new Error DetailsHttpError: Invalid request. No subschema in "anyOf" matched. |
❌ Error Occurred while executing an ActionIf you believe this is an unexpected error, please report it on our issue tracker: https://github.com/mergeability/mergeable/issues/new Error DetailsHttpError: Invalid request. No subschema in "anyOf" matched. |
In newly written tests we were already doin this manually in each scenario. Between scenario's the user manager in the DrupalExtension was not correctly keeping track of the logged in user status which could prevent a new scenario from logging a user in. With the removal of clean-up in scenario's we now need that logout step literally everywhere, so it's easier to add it as an `@afterScenario` and run it every time than to require developers to decide about 100s of places whether it's needed. See jhedstrom/drupalextension#641
Nice, that could be super helpful, cheers @Kingdutch 🚀 |
These were used in the past to help set-up test automation on Travis but they don't actually test Open Social. In any scenario that these tests might fail other tests would fail too. The tests are removed to reduce the number of parallel tests being executed.
Problem / Solution
We previously utilised a lot of clean-up steps to make sure our tests didn't affect eachother. However we've since moved to a scenario where both in the CI and locally a new database is loaded between scenarios, this makes the clean-up no longer needed.
Additionally if the clean-up does run then this makes debugging a failed test a lot more difficult because you can't inspect the state of the platform at the time the test failed.
This commit ensures that all the clean-up that is provided by the DrupalExtension by default is disabled. For this we have to disable autoloading of sub-contexts (which we weren't using anyway) because the search_api contained a
behat.inc
file that would load theRawDrupalContext
class which contained more cleaning.There are DrupalExtension stories open to remove the cleaning from
RawDrupalContext
, but we don't have time to wait for that.We also add a step in our CI to dump the failed database to disk along with the installation.sql file. This allows a developer to load the failed database locally and see what was going wrong without having to rerun the test.
Issue tracker
Internal no issue
How to test
Definition of done
Before merge
After merge