66 "fmt"
77 "os"
88 "os/exec"
9+ "time"
910
11+ "github.com/briandowns/spinner"
1012 "github.com/rs/zerolog/log"
1113 "github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard/reports"
1214 "github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard/runner"
@@ -64,6 +66,28 @@ var RunTestsCmd = &cobra.Command{
6466 log .Warn ().Err (err ).Str ("projectPath" , goProject ).Msg ("Failed to get pretty project path" )
6567 }
6668
69+ projectPath , err = utils .ResolveFullPath (projectPath )
70+ if err != nil {
71+ log .Error ().Err (err ).Str ("projectPath" , projectPath ).Msg ("Failed to resolve full path for project path" )
72+ flushSummaryAndExit (ErrorExitCode )
73+ }
74+
75+ if mainResultsPath != "" {
76+ mainResultsPath , err = utils .ResolveFullPath (mainResultsPath )
77+ if err != nil {
78+ log .Error ().Err (err ).Str ("mainResultsPath" , mainResultsPath ).Msg ("Failed to resolve full path for main results path" )
79+ flushSummaryAndExit (ErrorExitCode )
80+ }
81+ }
82+
83+ if rerunResultsPath != "" {
84+ rerunResultsPath , err = utils .ResolveFullPath (rerunResultsPath )
85+ if err != nil {
86+ log .Error ().Err (err ).Str ("rerunResultsPath" , rerunResultsPath ).Msg ("Failed to resolve full path for rerun results path" )
87+ flushSummaryAndExit (ErrorExitCode )
88+ }
89+ }
90+
6791 // Retrieve go-test-count flag as a pointer if explicitly provided.
6892 var goTestCountFlag * int
6993 if cmd .Flags ().Changed ("go-test-count" ) {
@@ -133,11 +157,15 @@ var RunTestsCmd = &cobra.Command{
133157 // Run the tests
134158 var mainResults []reports.TestResult
135159 if len (testCmdStrings ) > 0 {
160+ s := spinner .New (spinner .CharSets [14 ], 100 * time .Millisecond )
161+ s .Suffix = " Running custom test command..."
162+ s .Start ()
136163 mainResults , err = testRunner .RunTestCmd (testCmdStrings )
137164 if err != nil {
138165 log .Fatal ().Err (err ).Msg ("Error running custom test command" )
139166 flushSummaryAndExit (ErrorExitCode )
140167 }
168+ s .Stop ()
141169 } else {
142170 mainResults , err = testRunner .RunTestPackages (testPackages )
143171 if err != nil {
@@ -147,8 +175,8 @@ var RunTestsCmd = &cobra.Command{
147175 }
148176
149177 if len (mainResults ) == 0 {
150- log .Warn ().Msg ("No tests were run for the specified packages " )
151- flushSummaryAndExit (0 )
178+ log .Error ().Msg ("No tests were run. " )
179+ flushSummaryAndExit (ErrorExitCode )
152180 }
153181
154182 // Save the main test results to file
0 commit comments