Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add upstream & interop tests #1081

Merged
merged 4 commits into from May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 ./...