Clean up Web IDE global state data in QA specs
Issue: Clean up Web IDE global state data in QA specs (gitlab-web-ide#398 - closed)
What does this MR do and why?
This MR adds a shared context for Web IDE QA specs to:
- Clean up settings sync data after each context is run. This is done by calling the
DELETE
endpoint provided by the Settings Sync API. Note that this clears all Web IDE settings data for the user. - Encapsulate repeated logic in the specs'
before
hook.
How to set up and validate locally
These instructions assume you are signed in the GDK with root
user.
- Load Web IDE and change the IDE theme.
- Confirm changed setting is persisted: Run
gdk psql
command and then the following query:
select * from vs_code_settings where setting_type='settings' and user_id=1;
- You should see the theme you've set in the content.
- Close the Web IDE.
- In the
gitlab
directory,cd qa
and run the QA spec with the following command:
QA_GITLAB_URL=<gdk_url> GITLAB_INTIAL_ROOT_PASSWORD=<password> bundle exec rspec <path_to_spec>
- Check the DB again: setting should be removed.
Edited by Cindy Halim