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

Make goss compile on windows and enable travis tests on windows. #448

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ go:
sudo: required
dist: trusty

os:
- linux
- windows

services:
- docker

before_install:
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then choco install make; fi
- go get -u golang.org/x/lint/golint
- DEP_RELEASE_TAG=0.5.0 curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

script:
- make deps
- make
# TODO(ENG-1523): windows does not currently support test-int-*, only unit tests executed from make.
- if [ "$TRAVIS_OS_NAME" == "windows" ]; then make lint test; else make; fi

deploy:
provider: releases
Expand Down
152 changes: 0 additions & 152 deletions Gopkg.lock

This file was deleted.

57 changes: 0 additions & 57 deletions Gopkg.toml

This file was deleted.

7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ pkgs = $(shell ./novendor.sh)
cmd = goss
TRAVIS_TAG ?= "0.0.0"
GO_FILES = $(shell find . \( -path ./vendor -o -name '_test.go' \) -prune -o -name '*.go' -print)
GO111MODULE=on

.PHONY: all build install test coverage deps release bench test-int lint gen centos7 wheezy precise alpine3 arch test-int32 centos7-32 wheezy-32 precise-32 alpine3-32 arch-32
.PHONY: all build install test coverage release bench test-int lint gen centos7 wheezy precise alpine3 arch test-int32 centos7-32 wheezy-32 precise-32 alpine3-32 arch-32

all: test-all test-all-32

Expand Down Expand Up @@ -91,10 +92,6 @@ arch: build
test-all-32: lint test test-int-32
test-all: lint test test-int

deps:
$(info INFO: Starting build $@)
dep ensure

gen:
$(info INFO: Starting build $@)
go generate -tags genny $(pkgs)
Expand Down
20 changes: 20 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module github.com/aelsabbahy/goss

require (
github.com/achanda/go-sysctl v0.0.0-20160222034550-6be7678c45d2
github.com/aelsabbahy/GOnetstat v0.0.0-20160428114218-edf89f784e08
github.com/aelsabbahy/go-ps v0.0.0-20170721000941-443386855ca1
github.com/cheekybits/genny v0.0.0-20160824153601-e8e29e67948b
github.com/docker/docker v0.0.0-20161109014415-383a2f046b16
github.com/fatih/color v0.0.0-20161025120501-bf82308e8c85
github.com/mattn/go-colorable v0.0.9
github.com/mattn/go-isatty v0.0.4
github.com/miekg/dns v0.0.0-20161018060808-58f52c57ce9d
github.com/oleiade/reflections v0.0.0-20160817071559-0e86b3c98b2f
github.com/onsi/gomega v0.0.0-20161031154339-ff4bc6b6f9f5
github.com/opencontainers/runc v0.0.0-20161107232042-8779fa57eb4a
github.com/patrickmn/go-cache v2.0.0+incompatible
github.com/urfave/cli v0.0.0-20161102131801-d86a009f5e13
golang.org/x/sys v0.0.0-20181210030007-2a47403f2ae5
gopkg.in/yaml.v2 v2.0.0-20160928153709-a5b47d31c556
)
53 changes: 0 additions & 53 deletions system/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"path/filepath"
"strconv"
"strings"
"syscall"

"github.com/aelsabbahy/goss/util"
"github.com/opencontainers/runc/libcontainer/user"
Expand Down Expand Up @@ -84,22 +83,6 @@ func (f *DefFile) Contains() (io.Reader, error) {
return fh, nil
}

func (f *DefFile) Mode() (string, error) {
if err := f.setup(); err != nil {
return "", err
}

fi, err := os.Lstat(f.realPath)
if err != nil {
return "", err
}

sys := fi.Sys()
stat := sys.(*syscall.Stat_t)
mode := fmt.Sprintf("%04o", (stat.Mode & 07777))
return mode, nil
}

func (f *DefFile) Size() (int, error) {
if err := f.setup(); err != nil {
return 0, err
Expand Down Expand Up @@ -145,42 +128,6 @@ func (f *DefFile) Filetype() (string, error) {
return "file", nil
}

func (f *DefFile) Owner() (string, error) {
if err := f.setup(); err != nil {
return "", err
}

fi, err := os.Lstat(f.realPath)
if err != nil {
return "", err
}

uidS := fmt.Sprint(fi.Sys().(*syscall.Stat_t).Uid)
uid, err := strconv.Atoi(uidS)
if err != nil {
return "", err
}
return getUserForUid(uid)
}

func (f *DefFile) Group() (string, error) {
if err := f.setup(); err != nil {
return "", err
}

fi, err := os.Lstat(f.realPath)
if err != nil {
return "", err
}

gidS := fmt.Sprint(fi.Sys().(*syscall.Stat_t).Gid)
gid, err := strconv.Atoi(gidS)
if err != nil {
return "", err
}
return getGroupForGid(gid)
}

func (f *DefFile) LinkedTo() (string, error) {
if err := f.setup(); err != nil {
return "", err
Expand Down
Loading