Skip to content

Removing unnecessary `remove_via_api!` in tests

Per discussion gitlab-org/gitlab#412816 (comment 1403642508)

Project removal should be removed from the after block for this not to happen in future. The reason for the failure is interesting, but this is not the spec to try and catch issues with project deletion

While looking into this I discovered we need to break this work down to smaller tasks:

  • Allow resource cleanup jobs to use admin token where it is available (e.g. for live environments that we can create users in, we need the same token to delete them afterward) - gitlab-org/gitlab!121777 (merged)
  • Make sure users created in tests are created with hard_delete_on_api_removal = true for delete job to be able to clean them up.
    • This also means updating the MR template to make sure new tests that create users will do this.
  • Remove remove_via_api! steps in tests where resources can be cleaned up by cleanup jobs.
Edited by Tiffany Rea