Commit e3aef48b authored by Dan Davison's avatar Dan Davison

Merge branch 'ml-delete-netrc-after-each-test' into 'master'

Delete .netrc after each test

See merge request gitlab-org/gitlab!50809
parents 249d0cae d4274b66
...@@ -32,7 +32,7 @@ module QA ...@@ -32,7 +32,7 @@ module QA
end end
end end
it 'allows a project to be created via the CLI with a different default branch name', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1019', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/295305', type: :flaky } do it 'allows a project to be created via the CLI with a different default branch name', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1019' do
project_name = "default-branch-name-via-cli-#{SecureRandom.hex(8)}" project_name = "default-branch-name-via-cli-#{SecureRandom.hex(8)}"
group = Resource::Group.fabricate_via_api! group = Resource::Group.fabricate_via_api!
......
...@@ -28,13 +28,6 @@ module QA ...@@ -28,13 +28,6 @@ module QA
end end
end end
after do
# Delete the .netrc file created during this test so that subsequent tests don't try to use the logins
Git::Repository.perform do |repository|
repository.delete_netrc
end
end
it 'download archives of each user project then check they are different', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/427' do it 'download archives of each user project then check they are different', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/427' do
archive_checksums = {} archive_checksums = {}
......
...@@ -27,6 +27,11 @@ RSpec.configure do |config| ...@@ -27,6 +27,11 @@ RSpec.configure do |config|
QA::Runtime::Logger.debug("\nStarting test: #{example.full_description}\n") QA::Runtime::Logger.debug("\nStarting test: #{example.full_description}\n")
end end
config.after do
# If a .netrc file was created during the test, delete it so that subsequent tests don't try to use the same logins
QA::Git::Repository.new.delete_netrc
end
config.after(:context) do config.after(:context) do
if !QA::Runtime::Browser.blank_page? && QA::Page::Main::Menu.perform(&:signed_in?) if !QA::Runtime::Browser.blank_page? && QA::Page::Main::Menu.perform(&:signed_in?)
QA::Page::Main::Menu.perform(&:sign_out) QA::Page::Main::Menu.perform(&:sign_out)
......
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