Skip to content

test: Added integration tests for content override Varlink API - #543

Open
DuckBoss wants to merge 3 commits into
mainfrom
jajerome/cct-2809-content-override-integration-tests
Open

test: Added integration tests for content override Varlink API#543
DuckBoss wants to merge 3 commits into
mainfrom
jajerome/cct-2809-content-override-integration-tests

Conversation

@DuckBoss

@DuckBoss DuckBoss commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

This patch adds Behave integration tests for the
com.redhat.rhsm.testing.content.override interface, covering Download and Upload methods.

  • Add feature file with 8 scenarios for content override API
  • Add JSON schema for Download response validation
  • Add step definitions for DNF5 override file management
  • Add reusable generic steps for varlink error and result assertions
  • Attempted a fix for the integration tests CI where locally built rhc binary was overriden
  • Updated rhsm2 dependency to resolve invalid cached connections
  • Updated UploadContentOverrides method to not attempt to send candlepin null overrides

Resolves: CCT-2809

@DuckBoss
DuckBoss force-pushed the jajerome/cct-2809-content-override-integration-tests branch 2 times, most recently from 7bea3af to 417d915 Compare August 4, 2026 18:33
@DuckBoss

DuckBoss commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Note: some integration test failures are expected right now due to how rhsm2 handles client and connection caching. This needs a fix in rhsm2.

@DuckBoss
DuckBoss requested a review from jirihnidek August 4, 2026 19:57
@DuckBoss
DuckBoss force-pushed the jajerome/cct-2809-content-override-integration-tests branch from 417d915 to 90df988 Compare August 6, 2026 13:25

@jirihnidek jirihnidek left a comment

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.

Overall it looks good. I can see that you introduced two methods that I already implemented in my PR. I have few comments and suggestions.

Comment thread .github/workflows/integration-tests.yml
Comment thread features/steps/test_content_override.py Outdated


def _cleanup_override_file(context):
"""Restore or remove the override file after a scenario."""

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.

Shouldn't we add such cleanup to environment.py to methods: before_scenario() after_scenario()?

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'm not sure if this really needs to be moved there. Those scenario hooks are called before/after every test, and it seems a bit overkill for this situation since this isn't a common file for other tests.

Considering the above, if you still want me to make this change then I can.

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.

You are right. Calling it before each scenario would be overkill. It would be better to use fixtures described here: https://behave.readthedocs.io/en/latest/fixtures/#docid-fixtures

Comment thread features/steps/test_varlink_method.py
Comment thread features/steps/test_varlink_method.py
Comment thread cmd/rhc-server/rhsm.go
@DuckBoss
DuckBoss force-pushed the jajerome/cct-2809-content-override-integration-tests branch 2 times, most recently from 44e0549 to 15799cc Compare August 6, 2026 19:18
@DuckBoss

DuckBoss commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for the review, I've addressed your comments and also added some missing docstrings.

@DuckBoss
DuckBoss requested a review from jirihnidek August 6, 2026 19:20
@DuckBoss
DuckBoss force-pushed the jajerome/cct-2809-content-override-integration-tests branch from 15799cc to 10f378e Compare August 7, 2026 02:43
Remove 'rhc' from the dnf install list in the integration test workflow
so the locally-built RPM is not shadowed by the system package.

Assisted-by: Cursor
Signed-off-by: Jason Jerome <jajerome@redhat.com>
UploadContentOverrides now returns early when ReadLocalContentOverrides
yields an empty slice, avoiding a 400 Bad Request from Candlepin which
rejects a null/empty payload on PUT content_overrides.

Assisted-by: Cursor
Signed-off-by: Jason Jerome <jajerome@redhat.com>
@DuckBoss
DuckBoss force-pushed the jajerome/cct-2809-content-override-integration-tests branch 2 times, most recently from eef7110 to e015dde Compare August 7, 2026 16:13
Add integration tests for com.redhat.rhsm.testing.content.override
covering Download and Upload methods across registered and unregistered
system states.

- Add feature file with 8 scenarios for content override API
- Add JSON schema for Download response validation
- Add step definitions for DNF5 override file management
- Add reusable generic steps for varlink error and result assertions
- Update rhsm2 dependency to include connection invalidation fix

Resolves: CCT-2809

Assisted-by: Cursor
Signed-off-by: Jason Jerome <jajerome@redhat.com>
@DuckBoss
DuckBoss force-pushed the jajerome/cct-2809-content-override-integration-tests branch from e015dde to ecf664e Compare August 7, 2026 16:28
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