Skip to content
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

Introduce tests to run after upgrade #561

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mirekdlugosz
Copy link
Collaborator

These tests focus around the question: if I upgrade Quipucords to newest version, can I still use it?

They modify existing data, reuse it and create brand new data. Data reading is covered by snapshot tests, as creating a new snapshot fundamentally reads the data through API.

This PR includes #560 and will be rebased after the other one is merged. I included #560 to avoid conflicts.

Some of the new tests would end up being run by PR pipeline, which is not what we want. This will be fixed on discovery-ci side in next step.

@mirekdlugosz mirekdlugosz requested review from a team February 13, 2025 15:58
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.13%. Comparing base (7b83580) to head (155a1b2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #561   +/-   ##
=======================================
  Coverage   77.13%   77.13%           
=======================================
  Files           7        7           
  Lines         726      726           
=======================================
  Hits          560      560           
  Misses        166      166           

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

These tests focus around the question: if I upgrade Quipucords to newest
version, can I still use it?

They modify existing data, reuse it and create brand new data. Data
reading is covered by snapshot tests, as creating a new snapshot
fundamentally reads the data through API.
@mirekdlugosz mirekdlugosz marked this pull request as ready for review February 20, 2025 12:35
Comment on lines +745 to +748
credential = random.choice(all_credentials)
credential_name = credential.get("name")
if not credential.get("username"):
pytest.skip("Credential does not store username")
Copy link
Contributor

@bruno-fs bruno-fs Feb 20, 2025

Choose a reason for hiding this comment

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

I'm probably missing context here, but I'm under the impression we might want to only skip if no credentials have username. I suggest we randomly select from credentials pre-filtered, with the filter being "credential has username key". If not credentials match this criteria, then we skip.

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