Skip to content

Commit

Permalink
Add test for pion-to-pion example
Browse files Browse the repository at this point in the history
Also add new GitHub Actions workflow to run tests for example apps
  • Loading branch information
ashellunts committed Nov 5, 2022
1 parent 25624d6 commit 2e42dfd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/examples-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Examples Tests
on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
pion-to-pion-test:
name: Test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: test
run: cd examples/pion-to-pion && ./test.sh

2 changes: 2 additions & 0 deletions examples/pion-to-pion/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
version: '3'
services:
answer:
container_name: answer
build: ./answer
command: answer -offer-address offer:50000

offer:
container_name: offer
depends_on:
- answer
build: ./offer
Expand Down
14 changes: 14 additions & 0 deletions examples/pion-to-pion/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -eu

docker compose up -d

function on_exit {
docker compose logs
docker compose rm -fsv
}

trap on_exit EXIT

TIMEOUT=10
timeout $TIMEOUT docker compose logs -f | grep -q "answer | Message from DataChannel"
timeout $TIMEOUT docker compose logs -f | grep -q "offer | Message from DataChannel"

0 comments on commit 2e42dfd

Please sign in to comment.