fix: honor absolute path in --test-file flag#2689
Merged
eddycharly merged 2 commits intoApr 30, 2026
Merged
Conversation
Ayush-Patel-56
force-pushed
the
fix/test-file-absolute-path
branch
from
April 21, 2026 08:43
6dce034 to
3256875
Compare
There was a problem hiding this comment.
Pull request overview
Fixes --test-file handling so absolute paths are honored during discovery/loading, preventing incorrect filepath.Join(testDir, absPath) behavior and avoiding unintended fallback to step-file discovery.
Changes:
- Add path resolution in
tryLoadTestFilesto use absolute--test-filevalues as-is. - Prevent step-file discovery fallback when an explicitly-provided absolute test file path is not found.
- Add a unit test covering absolute
--test-filebehavior (found + missing).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/discovery/load.go | Resolves absolute test-file paths correctly and disables step discovery fallback for missing absolute paths. |
| pkg/discovery/load_test.go | Adds coverage for loading an absolute test file and ensuring missing absolute paths don’t fall through to step discovery. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2689 +/- ##
==========================================
+ Coverage 66.97% 67.00% +0.03%
==========================================
Files 149 149
Lines 5704 5710 +6
==========================================
+ Hits 3820 3826 +6
Misses 1624 1624
Partials 260 260 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Ayush-Patel-56
force-pushed
the
fix/test-file-absolute-path
branch
from
April 29, 2026 13:44
3256875 to
9a783f0
Compare
lucchmielowski
approved these changes
Apr 29, 2026
Signed-off-by: Ayush Patel <[email protected]>
Ayush-Patel-56
force-pushed
the
fix/test-file-absolute-path
branch
from
April 30, 2026 07:54
9a783f0 to
0d2086f
Compare
eddycharly
enabled auto-merge (squash)
April 30, 2026 11:14
eddycharly
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
--test-filesilently ignored absolute paths -filepath.Join(testDir, absolutePath)produced a wrong path, causing chainsaw to fall through to step-file discovery instead of loading the specified file. This fix makes absolute paths work as expected.Related issue
Fixes #2687 (case 3)
Proposed Changes
resolvehelper intryLoadTestFilesthat returns the filename as-is when it's absolute, skipping thefilepath.Joinwith test-dirChecklist
Further Comments
Cases 1 and 2 from the issue (silent fallback when an explicit relative filename doesn't exist) involve the KUTTL-compat step-discovery behavior - left those for maintainer input before touching.