Skip to content

Conversation

@SoulPancake
Copy link
Member

@SoulPancake SoulPancake commented Dec 11, 2025

Description

What problem is being solved?

How is it being solved?

What changes are made to solve it?

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

Summary by CodeRabbit

Release Notes

  • Chores
    • Improved test organization by introducing integration test markers to identify tests requiring external service dependencies.
    • Added dedicated test target for executing integration tests with consistent coverage reporting.

✏️ Tip: You can customize this high-level summary in your review settings.

@SoulPancake SoulPancake requested a review from a team as a code owner December 11, 2025 05:45
Copilot AI review requested due to automatic review settings December 11, 2025 05:45
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The changes introduce infrastructure for marking and running integration tests separately. A new Makefile target executes integration-only tests, the pyproject.toml defines and enforces the integration marker, and error integration tests are decorated with the integration marker.

Changes

Cohort / File(s) Summary
Test infrastructure setup
Makefile, pyproject.toml
Added test-integration Makefile target with pytest marker filtering and coverage options. Added strict-markers enforcement in pyproject.toml with a new integration marker for tests requiring a running OpenFGA server.
Integration test marking
test/error_integration_test.py
Applied @pytest.mark.integration decorator to TestErrorIntegration and TestErrorIntegrationSync classes for proper test collection.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: mark integration tests' directly and clearly summarizes the main change in the pull request, which adds pytest integration markers to test classes and infrastructure support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@dosubot
Copy link

dosubot bot commented Dec 11, 2025

Related Documentation

Checked 7 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.17%. Comparing base (79eaaea) to head (549ceb1).

❌ Your project status has failed because the head coverage (71.17%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #248   +/-   ##
=======================================
  Coverage   71.17%   71.17%           
=======================================
  Files         137      137           
  Lines       11100    11100           
=======================================
  Hits         7900     7900           
  Misses       3200     3200           

☔ 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces pytest markers to distinguish integration tests from unit tests, enabling selective test execution. Integration tests now use the @pytest.mark.integration decorator, which is registered in pytest configuration with the --strict-markers flag to ensure only valid markers are used. A new test-integration Make target is added to run integration tests separately.

  • Adds @pytest.mark.integration decorator to integration test classes
  • Configures pytest marker in pyproject.toml with --strict-markers enforcement
  • Adds test-integration Make target for running integration tests selectively

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/error_integration_test.py Adds @pytest.mark.integration decorator to both async and sync integration test classes
pyproject.toml Registers the integration marker and enables --strict-markers to enforce valid markers
Makefile Adds new test-integration target to run only integration tests with coverage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@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: 0

🧹 Nitpick comments (2)
pyproject.toml (1)

134-141: Pytest marker config looks good; consider centralizing coverage options in one place

The --strict-markers flag and integration marker definition are aligned with how you’re tagging tests and will keep marker usage tidy across the suite.

You now also have coverage configuration in both addopts and the Makefile targets (they each pass --cov/--cov-report), which is redundant though not harmful. To avoid duplicated options and keep coverage behavior defined in a single place, consider relying on addopts for coverage and simplifying the Makefile invocations to just pytest (plus -m/path filters as needed).

Makefile (1)

13-15: Ensure test-integration actually covers all integration tests

The -m integration selector is correct, but the default path is test/, while pyproject.toml’s testpaths includes both "test" and "integration". If you add integration tests under the integration/ directory, they won’t run via this target unless TEST is explicitly set.

You might want to either:

  • Let pytest’s testpaths drive collection:
test-integration:
	uv run pytest -m integration

or

  • Explicitly include both directories:
test-integration:
	uv run pytest -m integration --cov-report term-missing --cov=openfga_sdk $(if $(TEST),$(TEST),test integration)

Optionally, you can also add test-integration to the .PHONY list and consider relying on addopts for coverage options to avoid duplication, similar to the main test target.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79eaaea and 3c9de3d.

📒 Files selected for processing (3)
  • Makefile (1 hunks)
  • pyproject.toml (1 hunks)
  • test/error_integration_test.py (2 hunks)
⏰ 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: Agent
🔇 Additional comments (2)
test/error_integration_test.py (2)

56-58: Async integration tests correctly tagged

Tagging TestErrorIntegration with the integration marker, on top of the existing async marker and module-level skip, cleanly integrates this suite with the new -m integration flow while keeping the existing environment gate.


427-428: Sync integration tests consistently tagged as well

Adding the integration marker to TestErrorIntegrationSync keeps async and sync suites aligned for selection with -m integration, matching the marker definition in pyproject.toml.

@SoulPancake SoulPancake added this pull request to the merge queue Dec 11, 2025
Merged via the queue into main with commit 1c16fe6 Dec 11, 2025
28 checks passed
@SoulPancake SoulPancake deleted the chore/ci/integration-test-mark branch December 11, 2025 07:03
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.

4 participants