Closed kyrregjerstad closed 10 months ago
Recent updates in PR #119 enable the backend to be operated locally via a Docker setup. This allows for testing in an isolated environment, which you should be able to easily set up by following the instructions in the PR. This could help avoid unnecessary cluttering on the actual server.
As it stands the current running API is the testing environment, so the database could be periodically purge. I would suggest your E2E tests incorporate some degree of self cleaning for the moment.
A flag could be added at some point in the future, this will probably also require creating a dedicated endpoint to trigger a cleanup process before re-running tests, to ensure a clean state for each test cycle, similar to our route tests.
Hi @Anclagen, thanks for the quick reply! That's super useful info, I will set up Docker for the testing environment 🚀
Summary
We're enhancing our end-to-end (E2E) testing for the frontend, with a focus on user journeys like registration. To effectively test user signup without spamming the database with test accounts, we need to consider various strategies for managing test data.
Proposed Solutions
Dedicated Testing Environment: Set up a separate environment with its own database for realistic testing scenarios.
API Flagging: Implement a special flag in the API for test registrations, allowing these accounts to be marked for automatic cleanup.
Each of these methods offers a way to manage test data while ensuring the database remains uncluttered.
Your input and suggestions on these proposed solutions would be greatly appreciated.
Thank you!