Skip to content

Commit

Permalink
Fail fast in tests if avalancheGo executable isn't an absolute path
Browse files Browse the repository at this point in the history
Currently when running ginkgo tests with --avalanchego flag with a relative path,
the tests fail when trying to ascertain the rpcvm plugin path, because they execute the binary
without an absolute path, and the binary path is evaluated from a wrong location.

In order to make the underlying issue clear, I added a check that fails the test
and warns that an absolute path must be used.

Signed-off-by: Yacov Manevich <[email protected]>
  • Loading branch information
yacovm committed Feb 6, 2025
1 parent 2641b53 commit 8203025
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/fixture/e2e/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"flag"
"fmt"
"os"
"path/filepath"
"time"

"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
Expand All @@ -29,6 +30,10 @@ type FlagVars struct {
}

func (v *FlagVars) AvalancheGoExecPath() string {
if !filepath.IsAbs(v.avalancheGoExecPath) {
fmt.Fprintf(os.Stderr, "avalanchego-path (%s) is a relative path but must be an absolute path\n", v.avalancheGoExecPath)
os.Exit(2)
}
return v.avalancheGoExecPath
}

Expand Down

0 comments on commit 8203025

Please sign in to comment.