E2E testing using testing framework #2223
Merged
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.
This starts the process of moving e2e testing over to using the new testing framework. As you can see, this resulted in roughly 5 times the amount of code being deleted as added.
The ultimate aim is that:
How things currently look
Here's an example of all the code needed to write a fairly complex e2e test that starts Spin as an inbound redis handler. This test depends on Redis running which is all handled by the testing framework. The only thing that needs to be installed on the machine to run this test (besides a Rust toolchain) is Docker which will run redis for the user.
As you can see in this test, the user has controlled access to the testing environment allowing the user to do things like make calls against the redis database without needing to know which port redis is actually running on locally. The user can also query the test environment to see if a log file was written in the expected place.
Next Steps
The next thing to do is continue to move more integration and e2e tests over to this framework and eventually delete all the old e2e and integration testing support code.