Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is currently no "migration test" (=verifying the PHP response is identical to the Python response, minus documented changes), because the test infrastructure makes this hard. Since the PHP calls directly
mutate the database, we need to ensure we can recover the old database state after the test. We can not generally do this for the dataset status update call, as for that we need to know the initial state of the database (e.g., activating a dataset can be achieved by either adding an
active
row or removing adeactivated
row).While we do know the database state, we would need to hard-code that information into the tests. A better approach would be to start up a new separate database container for PHP (from the same image). This would negate the need to "undo".
A second issue that arises because of ordering:
This too is mitigated by introducing a second database. The only potential risk you introduce is to be working on different databases. Overall though, the effect of this should be rather minimal as the database would be effectively reset after every individual test.
Spinning up an instance for each test does likely add significant overhead. I would have to measure, but I would expect 1~2 seconds per test locally.
The second database could also just be a SQLite database. At least for this test, the required tables and populated data are manageable and hopefully is much faster than starting a container. Though I think it might not work as neatly when we requiring different data across many tables (though if neatly organized into different fixtures, maybe that works OK).