Skip to content

Conversation

@ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Nov 10, 2025

Summary by CodeRabbit

  • Tests
    • Relaxed parallel task query validation: tests now allow the parallel query to return additional results while ensuring the original expected tasks are still present. This prevents brittle failures when task completion timing varies and keeps subsequent filtering and task-verification steps intact.

@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

The test_task_query test in tests/integration/test_infrahub_client.py was updated to relax validation of parallel task results. Instead of asserting equal lengths with the sequential query, the test now collects IDs from the parallel results, asserts the parallel result count is at least the sequential count, and verifies all IDs from the initial sequential query appear in the parallel results. A variable stores the parallel query IDs; the subsequent filtering and validation steps remain unchanged.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Update flaky event test' is vague and doesn't clearly describe the specific changes made to address the flakiness. The actual changes involve modifying assertions in a task query test to handle race conditions, but the title doesn't convey this. Consider a more descriptive title such as 'Make task query test less flaky by handling timing race conditions' or 'Update task test to assert on set inclusion rather than exact equality' to better reflect the actual fix.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pog-event-test

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b0cd91d and 592ee28.

📒 Files selected for processing (1)
  • tests/integration/test_infrahub_client.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

When implementing Infrahub checks, subclass InfrahubCheck and override validate(data); do not implement or rely on a check() method

Files:

  • tests/integration/test_infrahub_client.py
tests/integration/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Place and write integration tests under tests/integration/ (tests against real Infrahub instances)

Files:

  • tests/integration/test_infrahub_client.py
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use the custom pytest plugin (infrahub_sdk.pytest_plugin) fixtures for clients, configuration, and Infrahub-specific testing

Files:

  • tests/integration/test_infrahub_client.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
tests/integration/test_infrahub_client.py (1)

190-196: LGTM! All previous issues have been addressed.

The changes successfully fix the flaky test by accounting for tasks that may complete between queries. All issues from the previous review have been resolved:

  • Variable is correctly named task_parallel_ids
  • Comment correctly states "at least"
  • Membership check uses efficient set operations

The relaxed validation logic (>= comparison and subset check) is appropriate for handling the non-deterministic nature of parallel task completion.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 10, 2025

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 592ee28
Status: ✅  Deploy successful!
Preview URL: https://ef5d092f.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pog-event-test.infrahub-sdk-python.pages.dev

View logs

@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@           Coverage Diff           @@
##           stable     #616   +/-   ##
=======================================
  Coverage   75.46%   75.46%           
=======================================
  Files         113      113           
  Lines        9512     9512           
  Branches     1893     1893           
=======================================
  Hits         7178     7178           
  Misses       1834     1834           
  Partials      500      500           
Flag Coverage Δ
integration-tests 34.90% <ø> (+0.01%) ⬆️
python-3.10 48.74% <ø> (-0.03%) ⬇️
python-3.11 48.76% <ø> (+0.02%) ⬆️
python-3.12 48.72% <ø> (-0.03%) ⬇️
python-3.13 48.72% <ø> (ø)
python-3.9 47.46% <ø> (ø)
python-filler-3.12 24.29% <ø> (ø)

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

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

@ogenstad ogenstad marked this pull request as ready for review November 11, 2025 07:44
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88c7907 and b0cd91d.

📒 Files selected for processing (1)
  • tests/integration/test_infrahub_client.py (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

When implementing Infrahub checks, subclass InfrahubCheck and override validate(data); do not implement or rely on a check() method

Files:

  • tests/integration/test_infrahub_client.py
tests/integration/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Place and write integration tests under tests/integration/ (tests against real Infrahub instances)

Files:

  • tests/integration/test_infrahub_client.py
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use the custom pytest plugin (infrahub_sdk.pytest_plugin) fixtures for clients, configuration, and Infrahub-specific testing

Files:

  • tests/integration/test_infrahub_client.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cloudflare Pages

@ogenstad ogenstad requested a review from a team November 11, 2025 08:32
@ogenstad ogenstad merged commit 709cbd2 into stable Nov 11, 2025
20 checks passed
@ogenstad ogenstad deleted the pog-event-test branch November 11, 2025 15:30
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.

3 participants