feat: add retries & update ping/go interop test (#32)

* .github/workflows/run-composition.yml: retry the build command

* .github/workflows/run-composition.yml: reduce run timeout for now

* .github/workflows/*: run on push and PR

* .github/actions: check testground health

* ping/_composition/*: reorder lib versions

* ping/: update with go-libp2p v0.22

* chore: gofmt

* .github/workflows: allow check test-plans during PR and push

* .github/workflows/*: introduce ping-interop-latest

* .github/workflow: tweak retry + timeout

* .github/actions/setup-testground: retry install

* ping/rust: update with v0.47.0 release
This commit is contained in:
Laurent Senta
2022-08-29 16:34:15 +02:00
committed by GitHub
parent 072d351a5f
commit d872355bc0
18 changed files with 1682 additions and 92 deletions

View File

@@ -16,7 +16,7 @@ runs:
go-version: "1.16.x"
- name: Install testground
run: make install
run: make install || make install || make install || make install
working-directory: testground
shell: bash
@@ -38,4 +38,14 @@ runs:
task_timeout_min = 60
EOF
testground daemon > testground.out 2> testground.err &
fi;
fi;
- name: Check testground daemon health
run:
echo "Waiting for Testground to launch on 8042...";
while ! nc -z localhost 8042; do
sleep 1;
done;
echo "Testground launched";
testground healthcheck --runner local:docker --fix;
shell: bash

View File

@@ -14,6 +14,8 @@ on:
required: false
description: repository to use as replace target
default: github.com/libp2p/go-libp2p
push:
pull_request:
name: go-libp2p ping - go test with testground.
@@ -28,3 +30,5 @@ jobs:
custom_git_target: ${{ github.event.inputs.custom_git_target }} # nothing or "some-fork/go-libp2p"
custom_git_reference: ${{ github.event.inputs.custom_git_reference }} # a git branch
testground_endpoint: ${{ github.event.inputs.testground_endpoint }}
test_repository: ${{ (github.event.inputs && '') || github.repository }}
test_ref: ${{ (github.event.inputs && '') || github.event.pull_request.head.sha || github.sha }}

View File

@@ -0,0 +1,35 @@
on:
workflow_dispatch:
inputs:
testground_endpoint:
type: string
required: false
description: testground endpoint
custom_git_reference:
description: the git commit or branch we're going to use for the custom target
required: false
type: string
custom_git_target:
description: the custom git fork url we're going to use for the custom target (github.com/some-fork/rust-libp2p)
required: false
type: string
custom_interop_target:
description: in the case of cross-implementation testing, the implementation target (go | rust | ...)
required: false
type: string
push:
pull_request:
name: libp2p ping - go + rust test (latest) with testground.
jobs:
run-ping-latest:
uses: "./.github/workflows/run-composition.yml"
with:
composition_file: "ping/_compositions/go-rust-interop-latest.toml"
custom_git_target: ${{ github.event.inputs.custom_git_target }} # nothing or "some-fork/go-libp2p"
custom_git_reference: ${{ github.event.inputs.custom_git_reference }} # a git reference
custom_interop_target: ${{ github.event.inputs.custom_interop_target }} # go | rust
testground_endpoint: ${{ github.event.inputs.testground_endpoint }}
test_repository: ${{ (github.event.inputs && '') || github.repository }}
test_ref: ${{ (github.event.inputs && '') || github.event.pull_request.head.sha || github.sha }}

View File

@@ -14,6 +14,8 @@ on:
required: false
description: repository to use as replace target
default: github.com/libp2p/rust-libp2p
push:
pull_request:
name: rust-libp2p ping - rust test with testground.
@@ -28,3 +30,5 @@ jobs:
custom_git_target: ${{ github.event.inputs.custom_git_target }} # nothing or "some-fork/go-libp2p"
custom_git_reference: ${{ github.event.inputs.custom_git_reference }} # a git reference
testground_endpoint: ${{ github.event.inputs.testground_endpoint }}
test_repository: ${{ (github.event.inputs && '') || github.repository }}
test_ref: ${{ (github.event.inputs && '') || github.event.pull_request.head.sha || github.sha }}

View File

@@ -17,8 +17,10 @@ on:
description: in the case of cross-implementation testing, the implementation target (go | rust | ...)
required: false
type: string
push:
pull_request:
name: libp2p ping - go and rust test with testground.
name: libp2p ping - go and rust test (all) with testground.
jobs:
run-ping-latest:
@@ -29,6 +31,8 @@ jobs:
custom_git_reference: ${{ github.event.inputs.custom_git_reference }} # a git reference
custom_interop_target: ${{ github.event.inputs.custom_interop_target }} # go | rust
testground_endpoint: ${{ github.event.inputs.testground_endpoint }}
test_repository: ${{ (github.event.inputs && '') || github.repository }}
test_ref: ${{ (github.event.inputs && '') || github.event.pull_request.head.sha || github.sha }}
run-ping-all:
uses: "./.github/workflows/run-composition.yml"
with:
@@ -36,4 +40,6 @@ jobs:
custom_git_target: ${{ github.event.inputs.custom_git_target }} # nothing or "some-fork/go-libp2p"
custom_git_reference: ${{ github.event.inputs.custom_git_reference }} # a git reference
custom_interop_target: ${{ github.event.inputs.custom_interop_target }} # go | rust
testground_endpoint: ${{ github.event.inputs.testground_endpoint }}
testground_endpoint: ${{ github.event.inputs.testground_endpoint }}
test_repository: ${{ (github.event.inputs && '') || github.repository }}
test_ref: ${{ (github.event.inputs && '') || github.event.pull_request.head.sha || github.sha }}

View File

@@ -22,13 +22,19 @@ on:
testground_endpoint:
required: false
type: string
test_repository:
required: false
type: string
test_ref:
required: false
type: string
jobs:
run_test:
name: Run a test with different versions
runs-on: ubuntu-latest
env:
TEST_PLAN_REPO: "libp2p/test-plans"
TEST_PLAN_BRANCH: "master"
TEST_PLAN_REPO: ${{ inputs.test_repository || 'libp2p/test-plans' }}
TEST_PLAN_BRANCH: ${{ inputs.test_ref || 'master' }}
TESTGROUND_ENDPOINT: ${{ inputs.testground_endpoint }}
defaults:
run:
@@ -56,17 +62,23 @@ jobs:
echo "::set-output name=custom_git_sha::${SHA}"
- name: Build the composition file
working-directory: ./test-plans
timeout-minutes: 30
run: |
testground build composition \
-f ${{ inputs.composition_file }} \
--wait
for i in 1 2 3; do
echo "=== Attempt $i ==="
testground build composition \
-f ${{ inputs.composition_file }} \
--wait && exit 0;
sleep 10
done
exit 1
env:
GitReference: ${{ steps.resolve_reference.outputs.custom_git_sha || inputs.custom_git_reference }}
GitTarget: ${{ inputs.custom_git_target }}
InteropTarget: ${{ inputs.custom_interop_target }}
- name: Run the composition file
working-directory: ./test-plans
timeout-minutes: 10
timeout-minutes: 6
run: |
testground run composition \
-f ${{ inputs.composition_file }} \