Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1081 from libp2p/feat/interop-testing
feat: add upstream & interop tests
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
name: Interop Tests | ||
|
||
jobs: | ||
unit: | ||
runs-on: ubuntu-latest | ||
name: Js/Go | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.16.x" | ||
- name: Go information | ||
run: | | ||
go version | ||
go env | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: 'libp2p' | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: 'libp2p/go-libp2p-daemon' | ||
path: 'daemon' | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: 'libp2p/interop' | ||
path: 'interop' | ||
- name: Mod replace go-libp2p in go-libp2p-daemon | ||
working-directory: daemon | ||
run: | | ||
go mod edit -replace "github.com/libp2p/go-libp2p=../libp2p" | ||
go mod tidy | ||
- name: Build libp2p daemon | ||
working-directory: daemon | ||
run: | | ||
go build -o daemon ./p2pd | ||
- name: Setup interop tests | ||
working-directory: interop | ||
run: npm install | ||
- name: Run interop tests | ||
working-directory: interop | ||
run: LIBP2P_GO_BIN="$(pwd)/../daemon/daemon" npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
push: | ||
branches: | ||
- master | ||
name: Upstream Test | ||
|
||
jobs: | ||
unit: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- 'ubuntu' | ||
go: | ||
# - '1.15.x' | ||
- '1.16.x' | ||
upstream: | ||
# - 'libp2p/go-libp2p-pubsub' flaky | ||
# - 'ipfs/go-bitswap' flaky | ||
# - 'libp2p/go-libp2p-kad-dht' | ||
- 'libp2p/go-libp2p-daemon' | ||
runs-on: ${{ matrix.os }}-latest | ||
name: ${{ matrix.upstream }} unit tests (${{ matrix.os }}, Go ${{ matrix.go }}) | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Go information | ||
run: | | ||
go version | ||
go env | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: 'libp2p' | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ matrix.upstream }} | ||
path: upstream | ||
- name: Patch in new go-libp2p | ||
working-directory: upstream | ||
run: | | ||
go mod edit -replace "github.com/libp2p/go-libp2p=../libp2p" | ||
go mod tidy | ||
- name: Run tests | ||
working-directory: upstream | ||
run: go test -v ./... | ||
- name: Run tests (32 bit) | ||
working-directory: upstream | ||
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX. | ||
env: | ||
GOARCH: 386 | ||
run: go test -v ./... | ||
- name: Run tests with race detector | ||
working-directory: upstream | ||
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow | ||
run: go test -v -race ./... |