Skip to content

Commit

Permalink
Merge pull request #22960 from agrare/fix_data_git_repos_locks_deleted
Browse files Browse the repository at this point in the history
Remove deletion of data/git_repos for EmbeddedAnsible tests
  • Loading branch information
Fryguy authored Oct 14, 2024
2 parents 02c20ec + 4bedce6 commit 1461bd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/models/git_repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
let(:userid) { 'user' }
let(:password) { 'password' }

after do
described_class::LOCKFILE_DIR.join(repo.id.to_s).unlink
rescue Errno::ENOENT
nil
end

context "parameter check" do
let(:args) do
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
let(:clone_dir) { Dir.mktmpdir }
let(:local_repo) { File.join(clone_dir, "hello_world_local") }
let(:repo_dir) { Pathname.new(Dir.mktmpdir) }
let(:locks_dir) { Pathname.new(Dir.mktmpdir) }
let(:repos) { Dir.glob(File.join(repo_dir, "*")) }
let(:repo_dir_structure) { %w[hello_world.yaml] }

Expand All @@ -26,6 +27,7 @@

GitRepository
stub_const("GitRepository::GIT_REPO_DIRECTORY", repo_dir)
stub_const("GitRepository::LOCKFILE_DIR", locks_dir)

EvmSpecHelper.assign_embedded_ansible_role
end
Expand All @@ -34,6 +36,7 @@
after do
FileUtils.rm_rf(repo_dir)
FileUtils.rm_rf(clone_dir)
FileUtils.rm_rf(locks_dir)
end

def files_in_repository(git_repo_dir)
Expand Down

0 comments on commit 1461bd7

Please sign in to comment.