Skip to content

feat(components): Autorag introduce unit tests#52

Draft
filip-komarzyniec wants to merge 10 commits into
opendatahub-io:mainfrom
filip-komarzyniec:autorag-introduce-unit-tests
Draft

feat(components): Autorag introduce unit tests#52
filip-komarzyniec wants to merge 10 commits into
opendatahub-io:mainfrom
filip-komarzyniec:autorag-introduce-unit-tests

Conversation

@filip-komarzyniec
Copy link
Copy Markdown

@filip-komarzyniec filip-komarzyniec commented Apr 29, 2026

Description of your changes:

  • created scripts dynamically extracting the nested functions from @dsl.component and @dsl.pipeline functions into a separate module

    I believe this is the best approach to thoroughly and reliably cover the code with unit tests, mainly because it will not be affected by future python releases (like e.g. AST or inspect modules). The tools used (bash, awk) are core utilities on any unix-based systems (and we work and ship on those).

  • modified pytest hooks to execute those scripts right before tests collection phase

  • modified pytest hooks to perform cleanup (deletion of dynamically created modules) after a test session finishes

  • introduced a custom --autorag-no-session-cleanup pytest flag preventing the cleanup from happening upon a test session finishes (helps during development and debugging)

  • introduced unit tests covering all utility functions (dynamically extracted) defined within @dsl.component and @dsl.pipeline functions

    I am aware the volume of the introduced tests is very large. However:

    • the achieved coverage is almost 100% so it should prove very useful during further code changing (and the codebase is undergoing very rapid changes).
    • the previously existing unit tests were very scarse, so naturally the PR introducing decent test suite has to be large
    • The code of the components and pipelines HAS TO BE refactored in the nearest future. Having a large suite of unit tests of almost 100% coverage will help us NOT TO introduce any regression during the inevitable refactoring.

    Having the above in mind this tests suite should be treated only as a first step in improving the maintainability of the code as well as the chance of not introducing any regression ☝🏾

  • deleted duplicated unit tests scenarios

  • disabled kfp_package installation in each autorag component -- the base autorag image already has it baked in.

Checklist:

Pre-Submission Checklist

Additional Checklist Items for New or Updated Components/Pipelines

  • metadata.yaml includes fresh lastVerified timestamp
  • All required files
    are present and complete
  • OWNERS file lists appropriate maintainers
  • README provides clear documentation with usage examples
  • Component follows snake_case naming convention
  • No security vulnerabilities in dependencies
  • Containerfile included if using a custom base image

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Important

Review skipped

Draft detected.

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.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: ca5b812c-a02e-4b61-b48e-745cef6e19b7

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

…ents and pipelines

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
…has it baked already)

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
@filip-komarzyniec filip-komarzyniec force-pushed the autorag-introduce-unit-tests branch 2 times, most recently from c2110ca to 8b7cfdd Compare May 13, 2026 22:16
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lukaszcmielowski for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
…suite)

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
Assisted-by: Claude Code
Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>
Signed-off-by: Filip Komarzyniec <fkomarzy@redhat.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@filip-komarzyniec filip-komarzyniec force-pushed the autorag-introduce-unit-tests branch from d38201e to a03e53c Compare May 14, 2026 00:08
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 16, 2026

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant