Skip to content

Commit

Permalink
Merge pull request #1081 from libp2p/feat/interop-testing
Browse files Browse the repository at this point in the history
feat: add upstream & interop tests
  • Loading branch information
Stebalien committed May 17, 2021
2 parents 7dc0e11 + 2dedcd0 commit 4239830
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/interop.yml
@@ -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
59 changes: 59 additions & 0 deletions .github/workflows/upstream.yml
@@ -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 ./...

0 comments on commit 4239830

Please sign in to comment.