api_http_fabrication_method is incorrectly being set to get for groups created via API, causing delete test resources jobs to filter them out
Since approximately 12/15/2022, the delete-test-resources
job has not been deleting groups created by tests. This is because the api_http_fabrication_method
is incorrectly being set to get
instead of post
, which then gets assigned to http_method
and causes test_resources_handler
to skip these for deletion: https://gitlab.com/gitlab-org/gitlab/-/blob/master/qa/qa/tools/test_resources_handler.rb#L153
Steps to Reproduce
gitlab-org/gitlab!105157 (merged) may be the cause, specifically this line of code in qa/qa/ee/resource/group_base.rb
:
def api_delete_path
if marked_for_deletion?
"#{super}?permanently_remove=true&full_path=#{CGI.escape(full_path)}"
else
super
end
end
- Add a
puts
statement indef api_fabrication_http_method
inapi_fabricator.rb
such asputs "API Fabrication Method: #{@api_fabrication_http_method}"
- Run a spec such as
qa/qa/specs/features/browser_ui/2_plan/milestone/assign_milestone_spec.rb:59
- Note the following output from the spec:
API Fabrication Method:
API Fabrication Method: get
[Jan 04 2023 14:34:17 CST (QA Tests)] INFO -- ==> Built a QA::Resource::Group with full_path 'gitlab-qa-sandbox-group-4/group-to-test-milestones-825a3400' via api in 0.65 seconds
- Remove the block of code for
api_delete_path
mentioned above, and rerun again - Notice the
api_fabrication_http_method
is now displaying correctly:
API Fabrication Method:
API Fabrication Method: post
[Jan 04 2023 14:35:56 CST (QA Tests)] INFO -- ==> Built a QA::Resource::Group with full_path 'gitlab-qa-sandbox-group-4/group-to-test-milestones-3ed493c2' via api in 18.45 seconds
Edited by Valerie Burton