Running `go test ./...` shouldn't fail
I cloned the repo, and ran the tests via go test ./.... Some of them seem to fail.
I further restricted this to go test -v ./pkg/boot/..., and there still seem to be some failures.
There's a lot of other prints going on, so it's hard to see what's failing.
One failure seems to be:
kver_test.go:119: mismatch
kver_test.go:122:
want bzimage.KInfo{Release:"2.6.24.111", Version:"#606 Mon Apr 14 00:06:11 CEST 2014", Builder:"", BuildNum:0x25e, BuildTime:time.Time{wall:0x0, ext:63533030771, loc:(*time.Location)(nil)}, Maj:0x2, Min:0x6, Patch:0x18, LocalVer:""}
got bzimage.KInfo{Release:"2.6.24.111", Version:"#606 Mon Apr 14 00:06:11 CEST 2014", Builder:"", BuildNum:0x25e, BuildTime:time.Time{wall:0x0, ext:63533023571, loc:(*time.Location)(0x6bf8c0)}, Maj:0x2, Min:0x6, Patch:0x18, LocalVer:""}
--- FAIL: TestParseDesc (0.00s)
--- PASS: TestParseDesc/normboot (0.00s)
--- FAIL: TestParseDesc/ancient (0.00s)
FAIL
FAIL github.com/u-root/u-root/pkg/boot/bzimage 11.944s
I'd feel more comfortable adding changes if go test ./... would succeed, and CI would uncover/prevent go test from regressing.
go test is part of CI.
What version of Go are you on?
On Thu, Mar 4, 2021, 01:46 Florian Klink [email protected] wrote:
I cloned the repo, and ran the tests via go test ./.... Some of them seem to fail.
I further restricted this to go test -v ./pkg/boot/..., and there still seem to be some failures.
There's a lot of other prints going on, so it's hard to see what's failing.
One failure seems to be:
kver_test.go:119: mismatch kver_test.go:122: want bzimage.KInfo{Release:"2.6.24.111", Version:"#606 Mon Apr 14 00:06:11 CEST 2014", Builder:"", BuildNum:0x25e, BuildTime:time.Time{wall:0x0, ext:63533030771, loc:(*time.Location)(nil)}, Maj:0x2, Min:0x6, Patch:0x18, LocalVer:""} got bzimage.KInfo{Release:"2.6.24.111", Version:"#606 Mon Apr 14 00:06:11 CEST 2014", Builder:"", BuildNum:0x25e, BuildTime:time.Time{wall:0x0, ext:63533023571, loc:(*time.Location)(0x6bf8c0)}, Maj:0x2, Min:0x6, Patch:0x18, LocalVer:""}--- FAIL: TestParseDesc (0.00s) --- PASS: TestParseDesc/normboot (0.00s) --- FAIL: TestParseDesc/ancient (0.00s) FAIL FAIL github.com/u-root/u-root/pkg/boot/bzimage 11.944s
I'd feel more comfortable adding changes if go test ./... would succeed, and CI would uncover/prevent go test from regressing.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/u-root/u-root/issues/1954, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPG3ERNVVXEZZ2CKLOPY4LTB5JHZANCNFSM4YS47RBA .
See https://github.com/u-root/u-root/blob/859ca5728ec336bced14fb3c3b3aaa7b94bc907f/.circleci/config.yml#L125
I don't have 1.13 provided anymore in my distribution. Should this line succeed with other Go versions, like 1.15 or 1.16 too?
Further looking at the config.yml, where is uroottest/test-image-amd64:v3.2.13 defined?
I don't have 1.13 provided anymore in my distribution. Should this line succeed with other Go versions, like 1.15 or 1.16 too?
1.15 def. I was just discovering some other 1.16 issues earlier, so I doubt 1.16 works right now.
Further looking at the
config.yml, where isuroottest/test-image-amd64:v3.2.13defined?
Dockerhub
Oh, sorry, definition for the image is in .circleci/images
1.15 def. I was just discovering some other 1.16 issues earlier, so I doubt 1.16 works right now.
Yeah, I was just confused by the readme explicitly mentioning 1.13.
Okay, running
go test -a -timeout 15m -ldflags '-s' ./cmds/... ./pkg/...
certainly fails here:
On MacOS Big Sur 11.2.2, with go version go1.16.3 darwin/amd64, and with export GO111MODULE=off
Running go test ./... now having following issues
➜ u-root git:(davidhu-watchdog-disarm-reliably) ✗ go test ./...
package ./cmds/core/lddfiles
imports github.com/u-root/u-root/pkg/ldd: build constraints exclude all Go files in /Users/xuehaohu/opensource/go/src/u-root/src/github.com/u-root/u-root/pkg/ldd
package ./cmds/boot/fbnetboot
imports github.com/u-root/u-root/pkg/boot/kexec: build constraints exclude all Go files in /Users/xuehaohu/opensource/go/src/u-root/src/github.com/u-root/u-root/pkg/boot/kexec
src/github.com/insomniacslk/dhcp/netboot/netconf.go:15:2: cannot find package "github.com/jsimonetti/rtnetlink" in any of:
/usr/local/opt/go/libexec/src/github.com/jsimonetti/rtnetlink (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/jsimonetti/rtnetlink (from $GOPATH)
src/github.com/insomniacslk/dhcp/netboot/netconf.go:16:2: cannot find package "github.com/jsimonetti/rtnetlink/rtnl" in any of:
/usr/local/opt/go/libexec/src/github.com/jsimonetti/rtnetlink/rtnl (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/jsimonetti/rtnetlink/rtnl (from $GOPATH)
src/github.com/insomniacslk/dhcp/netboot/netconf.go:17:2: cannot find package "github.com/mdlayher/netlink" in any of:
/usr/local/opt/go/libexec/src/github.com/mdlayher/netlink (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/mdlayher/netlink (from $GOPATH)
src/github.com/insomniacslk/dhcp/dhcpv4/client4/client.go:14:2: cannot find package "golang.org/x/net/ipv4" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/net/ipv4 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/net/ipv4 (from $GOPATH)
cmds/boot/localboot/grub.go:17:2: cannot find package "golang.org/x/text/transform" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/text/transform (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/text/transform (from $GOPATH)
cmds/boot/localboot/grub.go:18:2: cannot find package "golang.org/x/text/unicode/norm" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/text/unicode/norm (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/text/unicode/norm (from $GOPATH)
cmds/boot/stboot/time.go:15:2: cannot find package "github.com/beevik/ntp" in any of:
/usr/local/opt/go/libexec/src/github.com/beevik/ntp (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/beevik/ntp (from $GOPATH)
package ./cmds/boot/stboot
imports github.com/u-root/u-root/pkg/rtc: build constraints exclude all Go files in /Users/xuehaohu/opensource/go/src/u-root/src/github.com/u-root/u-root/pkg/rtc
cmds/core/basename/basename.go:18:2: cannot find package "github.com/spf13/pflag" in any of:
/usr/local/opt/go/libexec/src/github.com/spf13/pflag (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/spf13/pflag (from $GOPATH)
cmds/core/cmp/cmp.go:32:2: cannot find package "github.com/rck/unit" in any of:
/usr/local/opt/go/libexec/src/github.com/rck/unit (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/rck/unit (from $GOPATH)
cmds/core/gpgv/gpgv.go:33:2: cannot find package "golang.org/x/crypto/openpgp/errors" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/openpgp/errors (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/openpgp/errors (from $GOPATH)
cmds/core/gpgv/gpgv.go:34:2: cannot find package "golang.org/x/crypto/openpgp/packet" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/openpgp/packet (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/openpgp/packet (from $GOPATH)
cmds/core/pci/pci.go:24:2: cannot find package "github.com/pborman/getopt/v2" in any of:
/usr/local/opt/go/libexec/src/github.com/pborman/getopt/v2 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/pborman/getopt/v2 (from $GOPATH)
cmds/core/sluinit/uinit.go:15:2: cannot find package "github.com/u-root/iscsinl" in any of:
/usr/local/opt/go/libexec/src/github.com/u-root/iscsinl (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/u-root/iscsinl (from $GOPATH)
cmds/core/sshd/sshd.go:18:2: cannot find package "golang.org/x/crypto/ssh" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/ssh (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/ssh (from $GOPATH)
cmds/exp/disk_unlock/disk_unlock.go:32:2: cannot find package "golang.org/x/crypto/hkdf" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/hkdf (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/hkdf (from $GOPATH)
cmds/exp/netbootxyz/netbootxyz.go:20:2: cannot find package "gopkg.in/yaml.v2" in any of:
/usr/local/opt/go/libexec/src/gopkg.in/yaml.v2 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/gopkg.in/yaml.v2 (from $GOPATH)
cmds/exp/newsshd/newsshd.go:18:2: cannot find package "github.com/gliderlabs/ssh" in any of:
/usr/local/opt/go/libexec/src/github.com/gliderlabs/ssh (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/gliderlabs/ssh (from $GOPATH)
cmds/exp/newsshd/newsshd.go:19:2: cannot find package "github.com/kr/pty" in any of:
/usr/local/opt/go/libexec/src/github.com/kr/pty (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/kr/pty (from $GOPATH)
src/github.com/insomniacslk/dhcp/dhcpv6/server6/server.go:61:2: cannot find package "golang.org/x/net/ipv6" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/net/ipv6 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/net/ipv6 (from $GOPATH)
cmds/exp/pxeserver/main.go:27:2: cannot find package "pack.ag/tftp" in any of:
/usr/local/opt/go/libexec/src/pack.ag/tftp (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/pack.ag/tftp (from $GOPATH)
cmds/exp/validate/validate.go:34:2: cannot find package "golang.org/x/crypto/md4" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/md4 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/md4 (from $GOPATH)
cmds/exp/validate/validate.go:35:2: cannot find package "golang.org/x/crypto/openpgp" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/openpgp (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/openpgp (from $GOPATH)
cmds/exp/validate/validate.go:36:2: cannot find package "golang.org/x/crypto/ripemd160" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/ripemd160 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/ripemd160 (from $GOPATH)
cmds/exp/validate/validate.go:37:2: cannot find package "golang.org/x/crypto/sha3" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/sha3 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/sha3 (from $GOPATH)
cmds/exp/vboot/vboot.go:17:2: cannot find package "github.com/google/go-tpm/tpm" in any of:
/usr/local/opt/go/libexec/src/github.com/google/go-tpm/tpm (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/google/go-tpm/tpm (from $GOPATH)
cmds/exp/vboot/vboot.go:18:2: cannot find package "golang.org/x/crypto/ed25519" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/crypto/ed25519 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/crypto/ed25519 (from $GOPATH)
pkg/boot/boottest/json.go:28:2: cannot find package "github.com/google/go-cmp/cmp" in any of:
/usr/local/opt/go/libexec/src/github.com/google/go-cmp/cmp (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/google/go-cmp/cmp (from $GOPATH)
pkg/boot/menu/menu.go:22:2: cannot find package "golang.org/x/term" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/term (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/term (from $GOPATH)
package ./pkg/boot/multiboot
pkg/boot/multiboot/multiboot.go:25:2: use of internal package github.com/u-root/u-root/pkg/boot/multiboot/internal/trampoline not allowed
pkg/checker/interfaces.go:14:2: cannot find package "github.com/safchain/ethtool" in any of:
/usr/local/opt/go/libexec/src/github.com/safchain/ethtool (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/safchain/ethtool (from $GOPATH)
pkg/curl/schemes.go:24:2: cannot find package "github.com/cenkalti/backoff/v4" in any of:
/usr/local/opt/go/libexec/src/github.com/cenkalti/backoff/v4 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/cenkalti/backoff/v4 (from $GOPATH)
pkg/gzip/gunzip.go:10:2: cannot find package "github.com/klauspost/pgzip" in any of:
/usr/local/opt/go/libexec/src/github.com/klauspost/pgzip (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/klauspost/pgzip (from $GOPATH)
pkg/ipmi/ipmi.go:24:2: cannot find package "github.com/vtolstov/go-ioctl" in any of:
/usr/local/opt/go/libexec/src/github.com/vtolstov/go-ioctl (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/vtolstov/go-ioctl (from $GOPATH)
pkg/ls/fileinfo_unix.go:19:2: cannot find package "github.com/dustin/go-humanize" in any of:
/usr/local/opt/go/libexec/src/github.com/dustin/go-humanize (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/dustin/go-humanize (from $GOPATH)
package ./pkg/mod/golang.org/x/[email protected]/cpu: can only use path@version syntax with 'go get' and 'go install' in module-aware mode
package ./pkg/mod/golang.org/x/[email protected]/execabs: can only use path@version syntax with 'go get' and 'go install' in module-aware mode
package ./pkg/mod/golang.org/x/[email protected]/internal/unsafeheader: can only use path@version syntax with 'go get' and 'go install' in module-aware mode
package ./pkg/mod/golang.org/x/[email protected]/unix: can only use path@version syntax with 'go get' and 'go install' in module-aware mode
package ./pkg/mod/golang.org/x/[email protected]/windows/mkwinsyscall: can only use path@version syntax with 'go get' and 'go install' in module-aware mode
pkg/mount/block/blockdev.go:23:2: cannot find package "github.com/rekby/gpt" in any of:
/usr/local/opt/go/libexec/src/github.com/rekby/gpt (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/rekby/gpt (from $GOPATH)
pkg/qemu/qemu.go:26:2: cannot find package "github.com/google/goexpect" in any of:
/usr/local/opt/go/libexec/src/github.com/google/goexpect (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/google/goexpect (from $GOPATH)
pkg/securelaunch/measurement/cpuid.go:14:2: cannot find package "github.com/intel-go/cpuid" in any of:
/usr/local/opt/go/libexec/src/github.com/intel-go/cpuid (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/intel-go/cpuid (from $GOPATH)
pkg/securelaunch/tpm/tpm.go:17:2: cannot find package "github.com/google/go-tpm/tpm2" in any of:
/usr/local/opt/go/libexec/src/github.com/google/go-tpm/tpm2 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/google/go-tpm/tpm2 (from $GOPATH)
package ./pkg/strace
pkg/strace/socket.go:21:2: use of internal package github.com/u-root/u-root/pkg/strace/internal/abi not allowed
package ./pkg/strace
pkg/strace/socket.go:22:2: use of internal package github.com/u-root/u-root/pkg/strace/internal/binary not allowed
pkg/tss/nvram.go:14:2: cannot find package "github.com/google/go-tpm/tpmutil" in any of:
/usr/local/opt/go/libexec/src/github.com/google/go-tpm/tpmutil (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/google/go-tpm/tpmutil (from $GOPATH)
package ./pkg/vmtest
pkg/vmtest/gotest.go:20:2: use of internal package github.com/u-root/u-root/pkg/vmtest/internal/json2test not allowed
src/github.com/insomniacslk/dhcp/dhcpv4/async/client.go:11:2: cannot find package "github.com/fanliao/go-promise" in any of:
/usr/local/opt/go/libexec/src/github.com/fanliao/go-promise (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/github.com/fanliao/go-promise (from $GOPATH)
src/golang.org/x/tools/godoc/redirect/redirect.go:22:2: cannot find package "golang.org/x/net/context/ctxhttp" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/net/context/ctxhttp (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/net/context/ctxhttp (from $GOPATH)
src/golang.org/x/tools/internal/lsp/source/analysis.go:20:2: cannot find package "golang.org/x/sync/errgroup" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/sync/errgroup (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/sync/errgroup (from $GOPATH)
src/golang.org/x/tools/internal/lsp/protocol/span.go:13:2: cannot find package "golang.org/x/xerrors" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/xerrors (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/xerrors (from $GOPATH)
src/golang.org/x/tools/cmd/html2article/conv.go:21:2: cannot find package "golang.org/x/net/html" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/net/html (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/net/html (from $GOPATH)
src/golang.org/x/tools/cmd/html2article/conv.go:22:2: cannot find package "golang.org/x/net/html/atom" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/net/html/atom (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/net/html/atom (from $GOPATH)
src/golang.org/x/tools/playground/socket/socket.go:37:2: cannot find package "golang.org/x/net/websocket" in any of:
/usr/local/opt/go/libexec/src/golang.org/x/net/websocket (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/golang.org/x/net/websocket (from $GOPATH)
src/golang.org/x/tools/gopls/internal/hooks/analysis.go:10:2: cannot find package "honnef.co/go/tools/simple" in any of:
/usr/local/opt/go/libexec/src/honnef.co/go/tools/simple (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/honnef.co/go/tools/simple (from $GOPATH)
src/golang.org/x/tools/gopls/internal/hooks/analysis.go:11:2: cannot find package "honnef.co/go/tools/staticcheck" in any of:
/usr/local/opt/go/libexec/src/honnef.co/go/tools/staticcheck (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/honnef.co/go/tools/staticcheck (from $GOPATH)
src/golang.org/x/tools/gopls/internal/hooks/analysis.go:12:2: cannot find package "honnef.co/go/tools/stylecheck" in any of:
/usr/local/opt/go/libexec/src/honnef.co/go/tools/stylecheck (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/honnef.co/go/tools/stylecheck (from $GOPATH)
tools/stconfig/stconfig.go:17:2: cannot find package "gopkg.in/alecthomas/kingpin.v2" in any of:
/usr/local/opt/go/libexec/src/gopkg.in/alecthomas/kingpin.v2 (from $GOROOT)
/Users/xuehaohu/opensource/go/src/u-root/src/gopkg.in/alecthomas/kingpin.v2 (from $GOPATH)
I don't believe we test with MacOS in the CI, so all bets are off there. Pull Requests to improve it will be accepted.
A bunch of tests broke in go1.15+ and were fixed in https://github.com/u-root/u-root/pull/1974. Please try again.
Unfortunately, the CI only tests with go1.13 so these issues aren't caught.
You might also need to set GO111MODULE=off when running the tests (as does the CI).
So, I tried running go test ./... locally myself, it hanged and I can't CTRL-C it either...