Skip to content

Commit e17bbb7

Browse files
committed
move tests to test.sh
1 parent fc4b3fc commit e17bbb7

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

.travis.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,7 @@ before_install:
3333
before_script:
3434
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0
3535

36-
script:
37-
- go vet
38-
- golangci-lint run
39-
- test -z "$(go fmt ./...)" # fail if not formatted properly
40-
- go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
41-
# logadapter use its own module and go test not supported nested modules
42-
- |
43-
ls -d logadapter/* | \
44-
xargs -I {} bash -c "\
45-
cd '{}' \
46-
&& go test -race -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./... \
47-
&& cat coverage.out | grep -v \"mode:\" >> ../../coverage.out \
48-
&& rm coverage.out"
36+
script: ./test.sh
4937

5038
after_success:
5139
- $GOPATH/bin/goveralls -v -coverprofile=coverage.out -service=travis-ci -repotoken=$COVERALLS_TOKEN

test.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -ev
3+
go vet
4+
golangci-lint run
5+
test -z "$(go fmt ./...)" # fail if not formatted properly
6+
go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
7+
ls -d logadapter/* | xargs -I {} bash -c "cd '{}' \
8+
&& go test -race -coverprofile=coverage.out -covermode=atomic -coverpkg=./... ./... \
9+
&& cat coverage.out | grep -v \"mode:\" >> ../../coverage.out \
10+
&& rm coverage.out"

0 commit comments

Comments
 (0)