Skip to content

test: refactor for ansible-core 2.19 #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
May 2, 2025
Merged

Conversation

Nemental
Copy link
Collaborator

@Nemental Nemental commented Apr 22, 2025

SUMMARY

Since commit 9683ad2 some ansible tests fail. With this PR I want to update some versions and fix/improve some tests.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

Molecule tests for "devel" (ansible 2.19) will fail until ansible-community/molecule-plugins#308 is merged/fixed.


Copy link

codecov bot commented Apr 22, 2025

Codecov Report

Attention: Patch coverage is 98.15668% with 4 lines in your changes missing coverage. Please review.

Project coverage is 72.56%. Comparing base (936c14c) to head (b126c39).
Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
.../modules/grafana/grafana_team/test_grafana_team.py 97.61% 3 Missing ⚠️
.../modules/grafana/grafana_user/test_grafana_user.py 97.05% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #419      +/-   ##
==========================================
+ Coverage   64.39%   72.56%   +8.17%     
==========================================
  Files          16       21       +5     
  Lines        1747     2260     +513     
  Branches      374      475     +101     
==========================================
+ Hits         1125     1640     +515     
+ Misses        453      450       -3     
- Partials      169      170       +1     
Flag Coverage Δ
integration 70.87% <ø> (ø)
sanity 23.29% <ø> (ø)
units 65.24% <98.15%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Nemental Nemental marked this pull request as ready for review April 24, 2025 15:16
@Nemental Nemental requested review from rrey and seuf as code owners April 24, 2025 15:16
@Nemental Nemental requested a review from rndmh3ro April 24, 2025 15:17
@Nemental
Copy link
Collaborator Author

I can hardly believe it, but after hours of trial and error, the tests now also work with the current Ansible devel version (2.19). This version has some changes. It handles certain values and args in the unit tests differently. The molecule tests for Ansible development (2.19) depend on the PR I mentioned in the PR description.

@Nemental Nemental force-pushed the fix/ansible-tests-9683ad2 branch from 720f0a4 to 4292aaf Compare April 24, 2025 20:23
@Nemental Nemental changed the title fix: ansible tests failed since 9683ad2 test: refactor for ansible-core 2.19 Apr 25, 2025
@Nemental Nemental marked this pull request as draft April 25, 2025 20:37
Copy link
Collaborator Author

@Nemental Nemental left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back to draft, I want to rewrite unit tests a little bit. I don't want to check against the version - I want to check if the import of the new args patch functions works with try/catch. I think It's a better approche than the version check.

@Nemental Nemental marked this pull request as ready for review April 25, 2025 22:05
@Nemental
Copy link
Collaborator Author

@rndmh3ro Now everything is finished and ready for review. I don't think we'll have to wait until the merge at molecule plugins repo, right?

@rndmh3ro
Copy link
Collaborator

rndmh3ro commented May 2, 2025

LGTM!

Do you want to fix the failing tests in devel at a later time?

@Nemental
Copy link
Collaborator Author

Nemental commented May 2, 2025

@rndmh3ro the molecule devel tests are failing because of ansible-community/molecule-plugins#308

@Nemental Nemental merged commit 4414044 into main May 2, 2025
28 of 31 checks passed
@Nemental Nemental deleted the fix/ansible-tests-9683ad2 branch May 2, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants