Skip to content

Commit

Permalink
Fix up opengcs CI issues/remove ginkgo from Makefile
Browse files Browse the repository at this point in the history
We're not using ginkgo for any of our tests anymore (that I can see) so for Makefile
test just swap to running every test in /internal/guest which comprises (mostly) all of the
Linux specific guest features.

This commit also adds linter tags to a couple things to fix up deadcode warnings as well as fixes
a casing mistake on the setSubreaper function in /internal/guest/runtime/runc/runc.go

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
  • Loading branch information
dcantah committed May 17, 2021
1 parent f8a46eb commit 0c99156
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 14 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,6 @@ jobs:
with:
go-version: '^1.15.0'

- name: Install ginkgo
run: |
go get github.com/onsi/ginkgo/ginkgo
- name: Turn off goproxy
run: |
GOPROXY=off
- name: Pull busybox image
run: docker pull busybox

Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ clean:
rm -rf bin deps rootfs out

test:
cd $(SRCROOT) && go test ./service/gcsutils/...
cd $(SRCROOT) && go test ./...
cd $(SRCROOT)/cmd/gcs && ginkgo -r -keepGoing
cd $(SRCROOT) && go test ./internal/guest/...

out/delta.tar.gz: bin/init bin/vsockexec bin/cmd/gcs bin/cmd/gcstools Makefile
@mkdir -p out
Expand Down
2 changes: 1 addition & 1 deletion internal/guest/gcserr/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (e *wrappingHresultError) Format(s fmt.State, verb rune) {
}
fallthrough
case 's':
io.WriteString(s, e.Error())
_, _ = io.WriteString(s, e.Error())
case 'q':
fmt.Fprintf(s, "%q", e.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion internal/guest/prot/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import (
// III - 12 Bits Message Id
// VV - 8 Bits Version

//nolint:deadcode,varcheck
const (
messageTypeMask = 0xF0000000
messageCategoryMask = 0x0FF00000
messageIDMask = 0x000FFF00
messageVersionMask = 0x000000FF

messageIDShift = 8
messageVersionShift = 0
)
Expand Down
2 changes: 1 addition & 1 deletion internal/guest/runtime/runc/runc.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
initPidFilename = "initpid"
)

func setSubReaper(i int) error {
func setSubreaper(i int) error {
return unix.Prctl(unix.PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0)
}

Expand Down
1 change: 1 addition & 0 deletions internal/guest/transport/vsock.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/sirupsen/logrus"
)

//nolint:deadcode,varcheck
const (
vmaddrCidHost = 2
vmaddrCidAny = 0xffffffff
Expand Down

0 comments on commit 0c99156

Please sign in to comment.