Skip to content

tests: Add a custom script for getting info about Stratis pools#522

Merged
richm merged 1 commit intolinux-system-roles:mainfrom
vojtechtrefny:main_stratis-verify-fix
Apr 30, 2025
Merged

tests: Add a custom script for getting info about Stratis pools#522
richm merged 1 commit intolinux-system-roles:mainfrom
vojtechtrefny:main_stratis-verify-fix

Conversation

@vojtechtrefny
Copy link
Copy Markdown
Collaborator

There are multiple versions of Stratis in systems we support and it is hard to get all the information to verify test results from the Stratis cmdline utility in a consistent way. This adds a small Python script that uses Stratis DBus API to get the information we need for the tests.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.72%. Comparing base (59fd1c6) to head (0124d39).
Report is 46 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (59fd1c6) and HEAD (0124d39). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (59fd1c6) HEAD (0124d39)
sanity 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #522      +/-   ##
==========================================
- Coverage   16.54%   10.72%   -5.83%     
==========================================
  Files           2        8       +6     
  Lines         284     1949    +1665     
  Branches       79        0      -79     
==========================================
+ Hits           47      209     +162     
- Misses        237     1740    +1503     
Flag Coverage Δ
sanity ?

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vojtechtrefny vojtechtrefny force-pushed the main_stratis-verify-fix branch 2 times, most recently from d2b9b99 to 5bcaee2 Compare April 29, 2025 17:11
@vojtechtrefny vojtechtrefny marked this pull request as draft April 29, 2025 17:13
Comment thread tests/verify-pool-stratis.yml Outdated
Comment thread pylint_extra_requirements.txt Outdated

# Write extra requirements for running pylint here:
pytest
PyGObject
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I am not sure if this is the best place for this "dependency", but pylint is complaining about import error on the import gi line. This is dependency of blivet so it is available on systems with the role (and the test suite) running, but not for the pylint run.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The network role also uses import gi and pylint tests pass there.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Network role uses it in a try-except block so I guess pylint is OK with that. Anyway installing PyGObject from pypi doesn't work, it's a C extension and it fails to compile. I think skipping the warning is probably the best way to "fix" this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vojtechtrefny vojtechtrefny force-pushed the main_stratis-verify-fix branch 2 times, most recently from 17f3775 to 71d871c Compare April 29, 2025 17:26
@richm
Copy link
Copy Markdown
Contributor

richm commented Apr 29, 2025

to fix the pylint issue:

try:
    import gi

    gi.require_version("GLib", "2.0")
    gi.require_version("Gio", "2.0")

    from gi.repository import GLib, Gio
except ImportError:
    GLib = None
    class GioObj(object): pass
    Gio = GioObj()
    Gio.DBusCallFlags = GioObj()
    Gio.DBusCallFlags.NONE = None

@vojtechtrefny vojtechtrefny force-pushed the main_stratis-verify-fix branch from 71d871c to 64dbeb8 Compare April 30, 2025 05:17
There are multiple versions of Stratis in systems we support and
it is hard to get all the information to verify test results from
the Stratis cmdline utility in a consistent way. This adds a small
Python script that uses Stratis DBus API to get the information
we need for the tests.
@vojtechtrefny vojtechtrefny force-pushed the main_stratis-verify-fix branch from 0ef1c4c to 0124d39 Compare April 30, 2025 05:31
@vojtechtrefny vojtechtrefny marked this pull request as ready for review April 30, 2025 08:03
@vojtechtrefny
Copy link
Copy Markdown
Collaborator Author

Marking as ready for review, tests_stratis.yml now passes on all three systems.

@richm
Copy link
Copy Markdown
Contributor

richm commented Apr 30, 2025

[citest]

@richm richm merged commit 3b66fcb into linux-system-roles:main Apr 30, 2025
21 of 28 checks passed
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