manageiq
manageiq copied to clipboard
[WIP] Remove deletion of data/git_repos for EmbeddedAnsible tests
The data/git_repos directory doesn't appear to be used but it does leave local git changes when running the embedded_ansible_spec.rb
$ git status
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: data/git_repos/locks/.gitkeep
I'm very happy for this change. This frustrated me but I hadn't tracked it down.
Do we need to clean these up in another way? Like deleting all files underneath that directory (may cause issues for local development though)
Do we need to clean these up in another way? Like deleting all files underneath that directory (may cause issues for local development though)
Yeah I thought I'd have to delete all dirs+files under this directory, but after removing this line and running this spec file I didn't see any files in this directory left over, and and I don't see anything in the embedded_ansible seed that does anything with git_repos.
If I run the full suite I do see leftover locks, so I think other specs need to clean up their own locks and this was hiding that.
Okay it looks like leftover locks are from these two spec files (not surprisingly), spec/models/git_repository_spec.rb
and spec/models/manageiq/providers/embedded_ansible/automation_manager/configuration_script_source_spec.rb
.
Does anything ever delete these git_repository lockfiles at runtime?
WIP until I cover the other specs that leave these lockfiles around
This pull request has been automatically marked as stale because it has not been updated for at least 3 months.
If these changes are still valid, please remove the stale
label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).
This pull request has been automatically marked as stale because it has not been updated for at least 3 months.
If these changes are still valid, please remove the stale
label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s).
After running the full suite no lockfiles are left over:
$ rake parallel:spec
...
Randomized with seed 19268
12171 examples, 0 failures, 4 pendings
Took 46 seconds
$ ls -la data/git_repos/locks/
total 2
drwxr-xr-x 2 adam grare 3 Oct 14 14:32 .
drwxr-xr-x 3 adam grare 3 Oct 12 17:10 ..
-rw-r--r-- 1 adam grare 0 Oct 12 17:19 .gitkeep
@Fryguy rebased and taken out of WIP, PTAL
@kbrock fyi another fix_auth sporadic failure
1) FixAuth::AuthModel#miq_database uses random numbers for invalid
Failure/Error: expect(ManageIQ::Password.decrypt(bad.session_secret_token)).to_not eq "newpass"
ManageIQ::Password::PasswordError:
cannot decrypt encrypted string
# ./spec/tools/fix_auth/auth_model_spec.rb:118:in `block (3 levels) in <top (required)>'
# ------------------
# --- Caused by: ---
# OpenSSL::Cipher::CipherError:
# bad decrypt
# ./spec/tools/fix_auth/auth_model_spec.rb:118:in `block (3 levels) in <top (required)>'
rspec ./spec/tools/fix_auth/auth_model_spec.rb:115 # FixAuth::AuthModel#miq_database uses random numbers for invalid
https://github.com/ManageIQ/manageiq/actions/runs/11333113423/job/31516627078?pr=22960#step:8:300