Skip to content

refactor(integration-tests): Deprecate clp_mode_utils in favour of per-package mode definitions.#2243

Merged
quinntaylormitchell merged 3 commits into
y-scope:mainfrom
quinntaylormitchell:testing-migration-modes
May 12, 2026
Merged

refactor(integration-tests): Deprecate clp_mode_utils in favour of per-package mode definitions.#2243
quinntaylormitchell merged 3 commits into
y-scope:mainfrom
quinntaylormitchell:testing-migration-modes

Conversation

@quinntaylormitchell

@quinntaylormitchell quinntaylormitchell commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR deprecates the clp_mode_utils module in favour of the mode descriptions from tests/package_tests/clp_*/utils/mode.py.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Ran uv run pytest -m 'package' and uv run pytest -m 'core'; all tests pass.

Summary by CodeRabbit

  • Tests

    • Updated test infrastructure to consolidate configuration management and simplified validation logic across test modules.
  • Chores

    • Removed log ingestor component from the clp-json operating mode configuration.
    • Reorganized internal testing utilities for improved maintainability.

@quinntaylormitchell quinntaylormitchell requested a review from a team as a code owner May 4, 2026 20:28
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR refactors the test infrastructure to simplify validation logic. Mode configurations are consolidated into dedicated utility modules, the validation function is renamed and streamlined to check only running Docker services (removing mode config correctness checks), and unused utility functions are removed.

Changes

Test Infrastructure Refactoring

Layer / File(s) Summary
Mode Configuration Consolidation
integration-tests/tests/package_tests/clp_json/test_clp_json.py, integration-tests/tests/package_tests/clp_text/test_clp_text.py
CLP_JSON_MODE and CLP_TEXT_MODE are now imported from dedicated utils.mode modules instead of being constructed locally via PackageModeConfig.
Component List Updates
integration-tests/tests/package_tests/clp_json/utils/mode.py
CLP_LOG_INGESTOR_COMPONENT is removed from the import list and the CLP_JSON_MODE component tuple.
Validation Function Refactoring
integration-tests/tests/utils/asserting_utils.py
validate_package_instance is renamed to validate_package_running and simplified to verify only that required Docker Compose services are running; mode config validation logic and related imports (ClpConfig, YAML parsing, signature comparison) are removed.
Test Updates
integration-tests/tests/package_tests/clp_json/test_clp_json.py, integration-tests/tests/package_tests/clp_text/test_clp_text.py
Test assertions are updated to call the renamed validate_package_running instead of validate_package_instance in startup, compression, and search tests.
Utility Cleanup
integration-tests/tests/utils/clp_mode_utils.py
The entire module is removed; it previously exported CLP component constants and a mode signature comparison function that are no longer needed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately describes the main refactoring objective: deprecating clp_mode_utils in favour of per-package mode definitions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@Bill-hbrhbr Bill-hbrhbr 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.

For title, how about:

refactor(integration-tests): Deprecate `clp_mode_utils` and adopt package-specific mode utilities; Remove problematic running-mode validation for `clp-presto` and `clp-json-s3` tests.

@quinntaylormitchell quinntaylormitchell changed the title refactor(integration-tests): Deprecate clp_mode_utils module. refactor(integration-tests): Deprecate clp_mode_utils and adopt package-specific mode utilities; Remove problematic running-mode validation for clp-presto and clp-json-s3 tests. May 5, 2026
@quinntaylormitchell quinntaylormitchell changed the title refactor(integration-tests): Deprecate clp_mode_utils and adopt package-specific mode utilities; Remove problematic running-mode validation for clp-presto and clp-json-s3 tests. refactor(integration-tests): Deprecate clp_mode_utils and adopt package-specific mode utilities; remove problematic running-mode validation for clp-presto and clp-json-s3 tests. May 5, 2026

@junhaoliao junhaoliao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

posted some questions. the code lgtm

for the title, how about:

refactor(integration-tests): Deprecate `clp_mode_utils` in favour of per-package mode definitions.

logger.info("Starting test: 'test_clp_json_startup'")

validate_package_instance(fixt_package_instance)
validate_package_running(fixt_package_instance)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

qq: is there a reason not to put validate_package_running() calls into the fixture. it appears that everywhere the fixture is used we have been calling this validate_package_running(). is it to avoid coupling of some sort?

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.

It will be put in the new clp_package fixture; see this line in #2231.

verify_package_compression,
)
from tests.utils.clp_mode_utils import CLP_API_SERVER_COMPONENT, CLP_BASE_COMPONENTS
from tests.utils.config import PackageCompressionJob, PackageInstance, PackageModeConfig

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just to confirm my understanding, we will eventually phase out PackageModeConfig and replace it with ClpPackageModeConfig right? the PackageModeConfig removal is to be submitted later?

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.

That's correct; I'll work that removal into #2231.

@quinntaylormitchell quinntaylormitchell changed the title refactor(integration-tests): Deprecate clp_mode_utils and adopt package-specific mode utilities; remove problematic running-mode validation for clp-presto and clp-json-s3 tests. refactor(integration-tests): Deprecate clp_mode_utils in favour of per-package mode definitions. May 12, 2026
@quinntaylormitchell quinntaylormitchell merged commit a56d880 into y-scope:main May 12, 2026
25 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.

3 participants