Skip to content

Commit ea9467d

Browse files
authored
Merge pull request #150 from hanxizh9910/feature/automated-test-failure-detector
Fix the relative path of issues created for cluster and sentinel fail…
2 parents 9fe6076 + 0d73e97 commit ea9467d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/instances.tcl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,14 @@ while 1 {
499499
continue
500500
}
501501
if {[file isdirectory $test]} continue
502-
set ::cur_test_file $test
502+
# Convert relative path (../tests/...) to project-relative path (tests/<suite>/tests/...)
503+
set normalized [file normalize $test]
504+
set project_root [file normalize "../../.."]
505+
if {[string match "${project_root}/*" $normalized]} {
506+
set ::cur_test_file [string range $normalized [expr {[string length $project_root] + 1}] end]
507+
} else {
508+
set ::cur_test_file $test
509+
}
503510
puts [colorstr yellow "Testing unit: [lindex [file split $test] end]"]
504511
if {[catch { source $test } err]} {
505512
puts "FAILED: caught an error in the test $err"

0 commit comments

Comments
 (0)