manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

[WIP] Remove deletion of data/git_repos for EmbeddedAnsible tests

Open agrare opened this issue 10 months ago • 7 comments

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

agrare avatar Mar 27 '24 18:03 agrare

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)

kbrock avatar Mar 28 '24 13:03 kbrock

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.

agrare avatar Mar 28 '24 13:03 agrare

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.

agrare avatar Mar 28 '24 14:03 agrare

Does anything ever delete these git_repository lockfiles at runtime?

agrare avatar Mar 28 '24 14:03 agrare

WIP until I cover the other specs that leave these lockfiles around

agrare avatar Apr 05 '24 17:04 agrare

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).

miq-bot avatar Jul 08 '24 00:07 miq-bot

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).

miq-bot avatar Oct 14 '24 00:10 miq-bot

Checked commit https://github.com/agrare/manageiq/commit/4bedce6e5784ecce94a3bc03614c4c25a1ed2f76 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :trophy:

miq-bot avatar Oct 14 '24 18:10 miq-bot

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

agrare avatar Oct 14 '24 18:10 agrare

@Fryguy rebased and taken out of WIP, PTAL

agrare avatar Oct 14 '24 18:10 agrare

@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

agrare avatar Oct 14 '24 20:10 agrare