Skip to content

Commit 75ef6d8

Browse files
simonbairdclaude
andcommitted
Show relative paths in acceptance test output
Just a little cosmetic tweak (which I'm not planning to make a Jira for). Strip the working directory prefix from test file paths to display cleaner relative paths like 'features/task_validate_image.feature' instead of full absolute paths like '/home/sbaird/path/to/conforma/cli/features/task_validate_image.feature' Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 36834a2 commit 75ef6d8

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

acceptance/acceptance_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,18 @@ func initializeScenario(sc *godog.ScenarioContext) {
138138
sc.After(func(ctx context.Context, scenario *godog.Scenario, scenarioErr error) (context.Context, error) {
139139
// Log scenario end with status - write to /dev/tty to bypass capture
140140
if tty, err := os.OpenFile("/dev/tty", os.O_WRONLY, 0); err == nil {
141+
// Strip the working directory prefix to show relative paths
142+
uri := scenario.Uri
143+
if cwd, err := os.Getwd(); err == nil {
144+
if rel, err := filepath.Rel(cwd, uri); err == nil {
145+
uri = rel
146+
}
147+
}
148+
141149
if scenarioErr != nil {
142-
fmt.Fprintf(tty, "✗ FAILED: %s (%s)\n", scenario.Name, scenario.Uri)
150+
fmt.Fprintf(tty, "✗ FAILED: %s (%s)\n", scenario.Name, uri)
143151
} else {
144-
fmt.Fprintf(tty, "✓ PASSED: %s (%s)\n", scenario.Name, scenario.Uri)
152+
fmt.Fprintf(tty, "✓ PASSED: %s (%s)\n", scenario.Name, uri)
145153
}
146154
tty.Close()
147155
}

0 commit comments

Comments
 (0)