-
Notifications
You must be signed in to change notification settings - Fork 4
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
test panic: I think something is broken #149
Comments
You could try install go-task/task, and run test with task test. |
I'm using tasker on other repositories as well. $ task --version
Task version: v3.35.1 (h1:zjQ3tLv+LIStDDTzOQx8F97NE/8FSTanjZuwgy/hwro=)
$ task test
task: [test] GOEXPERIMENT=nocoverageredesign go test -race -cover -coverprofile=coverage.out \
-covermode=atomic ./... ./tests/... ./examples/... \
-coverpkg .,./cmd/...,./internal/...
pattern ./tests/...: directory prefix tests does not contain main module or its selected dependencies
pattern ./examples/...: directory prefix examples does not contain main module or its selected dependencies
task: Failed to run task "test": exit status 1 I manage to get further by editing But then I get the exact same error. $ task test
task: [test] GOEXPERIMENT=nocoverageredesign go test -race -cover -coverprofile=coverage.out \
-covermode=atomic ./... \
-coverpkg .,./cmd/...,./internal/...
--- FAIL: TestGraph (0.01s)
--- FAIL: TestGraph/linux_amd64 (0.01s)
callgraph_test.go:32:
Error Trace: kod/cmd/kod/internal/callgraph_test.go:32
Error: Expected nil, but got: &exec.ExitError{ProcessState:(*os.ProcessState)(0xc000012360), Stderr:[]uint8(nil)}
Test: TestGraph/linux_amd64
panic: open graphcase: no such file or directory [recovered]
panic: open graphcase: no such file or directory |
Could you try launching the tests in a fresh docker instance to see it doesn't work as expected |
@ccoVeille It's quite weird, seems like the path located in your system is different from mine, and everything works fine in github actions and my mac system.
|
@ccoVeille please check your go version
The reason to add ./tests/... and ./examples/... is we seperate these two directory as individual modules. |
I'll review everything, thanks If GitHub Action works, there is indeed something strange with my setup |
I'm using go 1.22.4 I tried with earlier Go version it's still the same 🤔 |
I'm unable to make it work locally. I quit 🤔🤣 I'm closing the issue, maybe someone will face it again and might reference this issue later |
Hi @ccoVeille , I would like to know your detailed system info, maybe we can find something out. |
Maybe you did not get the compiled graphcase here, or you can try this command directly. cd cmd/kod/internal
go build -o tests/graphcase ../../../tests/graphcase Links: |
Here is what I get $ cd cmd/kod/internal
$ ls ../../../tests/graphcase/
case.go kod_gen.go kod_gen_interface.go kod_gen_mock.go
$ go build -o tests/graphcase ../../../tests/graphcase
main module (github.com/go-kod/kod) does not contain package github.com/go-kod/kod/tests/graphcase I hope it would help |
try add ./ before the ../../../tests/graphcase path? |
Same results, but this worked
but then tests doesn't work, as it tries to launch this [pid 2392453] execve("/home/linuxbrew/.linuxbrew/Cellar/go/1.22.4/libexec/bin/go", ["go", "build", "-o", "graphcase", "../../../tests/graphcase"], 0xc00022db08 /* 70 vars */) = 0 It looks like there is something wrong with go, maybe something with homebrew 🤔, or your code, but I don't see why it would cause problem |
try run cd cmd/kod/internal
go build -o graphcase ./../../../tests/graphcase |
Same as previously, this fail $ go build -o graphcase ./../../../tests/graphcase
main module (github.com/go-kod/kod) does not contain package github.com/go-kod/kod/tests/graphcase I'm afraid I'm unable to tell you why it's happening 🤷 |
emm,I got it,do you init go module workspace? check if go.work exist? Please try run go env and show me the result |
I don't have a go.work or go.work.sum in kod folder, and none if folder above my dev folder $ go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/redacted/.cache/go-build'
GOENV='/home/redacted/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/redacted/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/redacted/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/home/linuxbrew/.linuxbrew/Cellar/go/1.22.4/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/home/linuxbrew/.linuxbrew/Cellar/go/1.22.4/libexec/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.4'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/home/redacted/Documents/dev/kod/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2225665431=/tmp/go-build -gno-record-gcc-switches' |
that's it, you should run task first to generate go.work and then run task test |
it worked, what a journey then I'm surprised task test do not depend on build go work, maybe So maybe something in the readme, would help |
also something were there is a problem Your project should have a because, right now, with the way golangci-lint works, if there is a golangci file in the parent folder, it would apply its settings, and my settings are way more restrictive than the default value. I can open a PR or create an issue, just tell me |
Great, pr is welcome |
I've enhanced Taskfile, please checkout when convenient, thanks a lot~ |
Closed, golangci related things can open another issue or pr. |
Thanks a lot for fixing test. It will be easier to contribute now. I'll open PR about fixing bugs/style then |
#176 was opened for records |
The text was updated successfully, but these errors were encountered: