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

test2json exit status 101 #32719

Closed
wxjeek opened this issue Jun 21, 2019 · 4 comments
Closed

test2json exit status 101 #32719

wxjeek opened this issue Jun 21, 2019 · 4 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@wxjeek
Copy link

wxjeek commented Jun 21, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.6 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN="/usr/local/gopath/bin"
GOCACHE="/Users/apple/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/usr/local/gopath"
GOPROXY="https://goproxy.io"
GORACE=""
GOROOT="/usr/local/go1.12"
GOTMPDIR="/tmp"
GOTOOLDIR="/usr/local/go1.12/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build079743697=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

package test

import (
	"errors"
	"testing"
)

func TestError(t *testing.T)  {
	t.Log(errors.New("error").Error())
}

What did you expect to see?

error

What did you see instead?

GOROOT=/usr/local/go1.12 #gosetup
GOPATH=/usr/local/gopath #gosetup
/usr/local/go1.12/bin/go test -c -i -o /private/var/folders/vs/mtk659950d7f6j2g3p7ykyrw0000gn/T/___TestError_in_chogolix_test chogolix/test #gosetup
/usr/local/go1.12/bin/go tool test2json -t /private/var/folders/vs/mtk659950d7f6j2g3p7ykyrw0000gn/T/___TestError_in_chogolix_test -test.v -test.run ^TestError$ #gosetup
test2json: exit status 101

@agnivade
Copy link
Contributor

I am unable to reproduce this.

$cat test/ll_test.go 
package test

import (
	"errors"
	"testing"
)

func TestError(t *testing.T) {
	t.Log(errors.New("error").Error())
}
$go test -c -i -o ./testbin ./test
$go tool test2json -t ./testbin -test.v -test.run ^TestError
{"Time":"2019-06-21T22:28:21.424586909+05:30","Action":"run","Test":"TestError"}
{"Time":"2019-06-21T22:28:21.424834259+05:30","Action":"output","Test":"TestError","Output":"=== RUN   TestError\n"}
{"Time":"2019-06-21T22:28:21.424863906+05:30","Action":"output","Test":"TestError","Output":"--- PASS: TestError (0.00s)\n"}
{"Time":"2019-06-21T22:28:21.424875616+05:30","Action":"output","Test":"TestError","Output":"    ll_test.go:9: error\n"}
{"Time":"2019-06-21T22:28:21.42488488+05:30","Action":"pass","Test":"TestError","Elapsed":0}
{"Time":"2019-06-21T22:28:21.424896513+05:30","Action":"output","Output":"PASS\n"}
{"Time":"2019-06-21T22:28:21.424930015+05:30","Action":"pass","Elapsed":0.001}

@MWangxj - Is test2json: exit status 101 the only output that you get when you run the command ? I would expect atleast some json lines to be printed before the error.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 21, 2019
@wxjeek
Copy link
Author

wxjeek commented Jun 28, 2019

sorry too later for this.
the new project i test will NOT reproduce
but the older project that will reproduce
hope someone like me

@wxjeek
Copy link
Author

wxjeek commented Jun 28, 2019

I am unable to reproduce this.

$cat test/ll_test.go 
package test

import (
	"errors"
	"testing"
)

func TestError(t *testing.T) {
	t.Log(errors.New("error").Error())
}
$go test -c -i -o ./testbin ./test
$go tool test2json -t ./testbin -test.v -test.run ^TestError
{"Time":"2019-06-21T22:28:21.424586909+05:30","Action":"run","Test":"TestError"}
{"Time":"2019-06-21T22:28:21.424834259+05:30","Action":"output","Test":"TestError","Output":"=== RUN   TestError\n"}
{"Time":"2019-06-21T22:28:21.424863906+05:30","Action":"output","Test":"TestError","Output":"--- PASS: TestError (0.00s)\n"}
{"Time":"2019-06-21T22:28:21.424875616+05:30","Action":"output","Test":"TestError","Output":"    ll_test.go:9: error\n"}
{"Time":"2019-06-21T22:28:21.42488488+05:30","Action":"pass","Test":"TestError","Elapsed":0}
{"Time":"2019-06-21T22:28:21.424896513+05:30","Action":"output","Output":"PASS\n"}
{"Time":"2019-06-21T22:28:21.424930015+05:30","Action":"pass","Elapsed":0.001}

@MWangxj - Is test2json: exit status 101 the only output that you get when you run the command ? I would expect atleast some json lines to be printed before the error.

today i test it print ok on my terminal

@agnivade
Copy link
Contributor

Thanks for getting back @MWangxj. I will close this one since you cannot reproduce this any more. Please feel free to comment on the issue if you hit this again, along with concrete steps to reproduce it.

@golang golang locked and limited conversation to collaborators Jun 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants