Skip to content

Commit

Permalink
Fix tcp6 on Travis (kavu#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
kavu authored Mar 9, 2018
1 parent 13d0e4b commit 2943cf5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sudo: false
group: edge
dist: trusty
sudo: true

language: go

Expand All @@ -8,6 +8,7 @@ go:
- 1.7
- 1.8
- 1.9
- "1.10"
- tip

os:
Expand All @@ -17,15 +18,12 @@ os:
before_install:
- uname -a

script:
- go test -v -cover ./...
- go test -v -cover -race ./... -coverprofile=coverage.txt -covermode=atomic
- go test -v -cover -race -benchmem -benchtime=5s -bench=.
script: ./test.bash

matrix:
allow_failures:
- os: osx
- go: tip

after_success:
- bash <(curl -s https://codecov.io/bash)
22 changes: 22 additions & 0 deletions test.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

set -e

# Thanks to IPFS team
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$TRAVIS_SUDO" == true ]]; then
# Ensure that IPv6 is enabled.
# While this is unsupported by TravisCI, it still works for localhost.
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=0
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
fi
else
# OSX has a default file limit of 256, for some tests we need a
# maximum of 8192.
ulimit -Sn 8192
fi

go test -v -cover ./...
go test -v -cover -race ./... -coverprofile=coverage.txt -covermode=atomic
go test -v -cover -race -benchmem -benchtime=5s -bench=.

0 comments on commit 2943cf5

Please sign in to comment.