Commit 9c844b32 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'qa-shl-use-unique-group-for-access-termination-specs' into 'master'

Use unique group path and update e2e test MR template

See merge request gitlab-org/gitlab!58478
parents ed727d66 6c3ce1b5
...@@ -10,7 +10,7 @@ Please link to the respective test case in the testcases project ...@@ -10,7 +10,7 @@ Please link to the respective test case in the testcases project
- [ ] Note if the test is intended to run in specific scenarios. If a scenario is new, add a link to the MR that adds the new scenario. - [ ] Note if the test is intended to run in specific scenarios. If a scenario is new, add a link to the MR that adds the new scenario.
- [ ] Follow the end-to-end tests [style guide](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/style_guide.html) and [best practices](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/best_practices.html). - [ ] Follow the end-to-end tests [style guide](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/style_guide.html) and [best practices](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/best_practices.html).
- [ ] Use the appropriate [RSpec metadata tag(s)](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/rspec_metadata_tests.html#rspec-metadata-for-end-to-end-tests). - [ ] Use the appropriate [RSpec metadata tag(s)](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/rspec_metadata_tests.html#rspec-metadata-for-end-to-end-tests).
- [ ] Ensure that a created resource is removed after test execution. - [ ] Ensure that a created resource is removed after test execution. A `Group` resource can be shared between multiple tests. Do not remove it unless it has a unique path. Note that we have a cleanup job that periodically removes groups under `gitlab-qa-sandbox-group`.
- [ ] Ensure that no [transient bugs](https://about.gitlab.com/handbook/engineering/quality/issue-triage/#transient-bugs) are hidden accidentally due to the usage of `waits` and `reloads`. - [ ] Ensure that no [transient bugs](https://about.gitlab.com/handbook/engineering/quality/issue-triage/#transient-bugs) are hidden accidentally due to the usage of `waits` and `reloads`.
- [ ] Verify the tags to ensure it runs on the desired test environments. - [ ] Verify the tags to ensure it runs on the desired test environments.
- [ ] If this MR has a dependency on another MR, such as a GitLab QA MR, specify the order in which the MRs should be merged. - [ ] If this MR has a dependency on another MR, such as a GitLab QA MR, specify the order in which the MRs should be merged.
......
...@@ -12,7 +12,9 @@ module QA ...@@ -12,7 +12,9 @@ module QA
@user_api_client = Runtime::API::Client.new(:gitlab, user: @user) @user_api_client = Runtime::API::Client.new(:gitlab, user: @user)
@group = Resource::Group.fabricate_via_api! @group = QA::Resource::Group.fabricate_via_api! do |group|
group.path = "group-to-test-access-termination-#{SecureRandom.hex(8)}"
end
@group.sandbox.add_member(@user) @group.sandbox.add_member(@user)
...@@ -73,11 +75,7 @@ module QA ...@@ -73,11 +75,7 @@ module QA
after(:all) do after(:all) do
@user.remove_via_api! @user.remove_via_api!
@project.remove_via_api! @project.remove_via_api!
begin @group.remove_via_api!
@group.remove_via_api!
rescue Resource::ApiFabricator::ResourceNotDeletedError
# It is ok if the group is already marked for deletion by another test
end
end end
end end
end end
......
...@@ -12,7 +12,9 @@ module QA ...@@ -12,7 +12,9 @@ module QA
end end
let!(:group) do let!(:group) do
group = Resource::Group.fabricate_via_api! group = QA::Resource::Group.fabricate_via_api! do |group|
group.path = "group-to-test-access-termination-#{SecureRandom.hex(8)}"
end
group.sandbox.add_member(user) group.sandbox.add_member(user)
group group
end end
...@@ -53,11 +55,7 @@ module QA ...@@ -53,11 +55,7 @@ module QA
after do after do
user.remove_via_api! user.remove_via_api!
project.remove_via_api! project.remove_via_api!
begin group.remove_via_api!
group.remove_via_api!
rescue Resource::ApiFabricator::ResourceNotDeletedError
# It is ok if the group is already marked for deletion by another test
end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment