Skip to content

Commit

Permalink
Specify OS in make test, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bobheadxi committed Feb 4, 2018
1 parent 91f2b6f commit eb26e03
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
PACKAGES = `go list ./... | grep -v vendor/`
SSH_PORT = 22
UBUNTU_VERSION = 16.04
VPS_OS = ubuntu

all: inertia

inertia:
go build

test:
make testenv-ubuntu VERSION=$(UBUNTU_VERSION)
make testenv-$(VPS_OS) VERSION=$(UBUNTU_VERSION)
go test $(PACKAGES) --cover

test-verbose:
make testenv-ubuntu VERSION=$(UBUNTU_VERSION)
make testenv-$(VPS_OS) VERSION=$(UBUNTU_VERSION)
go test $(PACKAGES) -v --cover

testenv-ubuntu:
docker stop testenv || true && docker rm rabbitmq || true
docker build -f ./test_env/Dockerfile.ubuntu \
-t ubuntuvps \
--build-arg VERSION=$(UBUNTU_VERSION) \
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ result, _ := remote.RunSSHCommand(string(shellScriptData))
### Testing

```bash
make test
make test # test ubuntu:16.04
make test VPS_OS=ubuntu UBUNTU_VERSION=latest # test ubuntu:latest
```

## Motivation
Expand Down
6 changes: 1 addition & 5 deletions client/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,7 @@ func AddNewRemote(name, IP, sshPort, user, pemLoc, port string) error {
}

_, err = config.Write()
if err != nil {
return err
}

return nil
return err
}

// Stubbed out for testing.
Expand Down
1 change: 0 additions & 1 deletion client/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,4 @@ func TestInstrumentedBootstrap(t *testing.T) {
var writer bytes.Buffer
err := remote.Bootstrap(session, "testvps", &Config{Writer: &writer})
assert.Nil(t, err)
// TODO: Check if success
}
2 changes: 1 addition & 1 deletion cmd/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,5 @@ func init() {
// is called directly, e.g.:
remoteCmd.Flags().BoolP("verbose", "v", false, "Verbose output")
addCmd.Flags().StringP("port", "p", daemon.DefaultPort, "Daemon port")
addCmd.Flags().StringP("sshPort", "ssh", "22", "SSH port")
addCmd.Flags().StringP("sshPort", "s", "22", "SSH port")
}

0 comments on commit eb26e03

Please sign in to comment.