Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail fast in tests if avalancheGo executable isn't an absolute path #3707

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yacovm
Copy link
Contributor

@yacovm yacovm commented Feb 6, 2025

How this works

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.

Why this should be merged

Checks if the path is relative and if so, fails fast with an error.

How this was tested

ran it locally:

➜  avalanchego git:(absolutePath) ginkgo -v --focus-file=faultinjection/duplicate_node_id.go  ./tests/e2e -- --avalanchego-path=./build/avalanchego        
Running Suite: e2e test suites - /Users/yacov.manevich/avalanchego/tests/e2e
============================================================================
Random Seed: 1738883202

Will run 1 of 13 specs
------------------------------
[SynchronizedBeforeSuite] 
/Users/yacov.manevich/avalanchego/tests/e2e/e2e_test.go:34
  [FAILED] in [SynchronizedBeforeSuite] - /Users/yacov.manevich/go/pkg/mod/github.com/stretchr/[email protected]/assert/assertions.go:1545 @ 02/07/25 00:06:52.681
[SynchronizedBeforeSuite] [FAILED] [0.023 seconds]
[SynchronizedBeforeSuite] 
/Users/yacov.manevich/avalanchego/tests/e2e/e2e_test.go:34

  [FAILED] 
        Error Trace:    /Users/yacov.manevich/avalanchego/tests/fixture/e2e/env.go:137
                                                /Users/yacov.manevich/avalanchego/tests/e2e/e2e_test.go:39
                                                /Users/yacov.manevich/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:596
                                                /Users/yacov.manevich/go/pkg/mod/golang.org/[email protected]/src/reflect/value.go:380
                                                /Users/yacov.manevich/go/pkg/mod/github.com/onsi/ginkgo/[email protected]/internal/node.go:486
                                                /Users/yacov.manevich/go/pkg/mod/github.com/onsi/ginkgo/[email protected]/internal/suite.go:642
                                                /Users/yacov.manevich/go/pkg/mod/github.com/onsi/ginkgo/[email protected]/internal/suite.go:889
                                                /Users/yacov.manevich/go/pkg/mod/golang.org/[email protected]/src/runtime/asm_amd64.s:1695
        Error:          Received unexpected error:
                        avalanchego-path (./build/avalanchego) is a relative path but must be an absolute path
  
  In [SynchronizedBeforeSuite] at: /Users/yacov.manevich/go/pkg/mod/github.com/stretchr/[email protected]/assert/assertions.go:1545 @ 02/07/25 00:06:52.681

Need to be documented in RELEASES.md?

No

tests/fixture/e2e/flags.go Outdated Show resolved Hide resolved
@yacovm yacovm force-pushed the absolutePath branch 2 times, most recently from 51828a0 to d4e648a Compare February 6, 2025 22:39
tests/fixture/e2e/flags.go Outdated Show resolved Hide resolved
@yacovm yacovm force-pushed the absolutePath branch 2 times, most recently from a33f7a0 to 263649e Compare February 6, 2025 23:07
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants