kubeflow / kubeflow/pipelines-components

[BUG] script running components-level tests dicards some targets

Open
#185 1 comment 0 reactions 1 assignee Claimed by @filip-komarzyniec View on GitHub
bug
Dominant language
Python
Stars
12
Forks
56
Avg merge
1d 11h
Merged PRs (30d)
3

Description

## Description

There are some logic holes in selecting targets as, when provided as paths to the script, the following are surely discarded:
* specific test files, e.g. `components/data_processing/sdg/tests/test_component_local.py`
* nested directories under `tests`, e.g. `tests/unit`

Running the `scripts/tests/run_component_tests.py` with such input produces:
```
No tests/ directories found under the supplied paths. Nothing to do.
```

The current behaviour makes little sense because it completely disallows finer control over executed tests.

## Steps to Reproduce
1. execute `python scripts/tests/run_component_tests.py components/data_processing/sdg/tests/test_component_local.py`

2. Observe the output

## Expected Behavior
Input arguments to the script pointing to the existing test cases or parts of the larger `tests/` suite of the component/pipeline should be accepted and properly executed.

## Actual Behavior
Some targets (as described at the beginning) are completely omitted even though they exist and point to the valid test files.

## Error Messages/Logs

```text
No tests/ directories found under the supplied paths. Nothing to do.
```

## Environment

**Kubeflow Pipelines Version:** 2.16.0
**Kubeflow SDK Version:** 2.16.0
**Python Version:** 3.12.12
**Operating System:** macOS 26.5.2

## Additional Context

## Possible Solution

I have a refactoring proposition already implemented and will issue the PR shortly.

## Willing to Contribute

- [x] Yes, I can submit a fix
- [x] Yes, I can help with testing
- [x] Yes, I can help with documentation
- [ ] No, requesting community help

---

Impacted by this bug? Give it a 👍.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.