Skip to content

Commit

Permalink
ci(e2e): add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
a-wing committed Nov 1, 2023
1 parent 1ddaa63 commit 6f3b790
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: E2E

on:
push:
branches:
- "main"
- "ci-*"
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
e2e:
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Build
run: |
cargo build --release
cargo build --package=whipinto --release
cargo build --package=whepfrom --release
- name: Install Tools
run: |
apt update -y && apt install ffmpeg
wget https://gist.github.com/a-wing/f7b074770b558e114911e339bb6a3e84/raw/9529d71fb8abe16fe4900a0232c77b2621c8d318/multirun.sh
chmod +x multirun.sh
- name: Run E2E Test
run: ./e2e.sh

35 changes: 35 additions & 0 deletions e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

TARGET_DIR="./target/release"

cat >stream.sdp <<EOF
v=0
m=video 5004 RTP/AVP 96
c=IN IP4 127.0.0.1
a=rtpmap:96 VP8/90000
EOF

cat >whip.sh <<EOF
#!/bin/bash
${TARGET_DIR}/whipinto -c vp8 -u http://localhost:3000/whip/777 --port 5003 --command "ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=30 -vcodec libvpx -cpu-used 5 -deadline 1 -g 10 -error-resilient 1 -auto-alt-ref 1 -f rtp 'rtp://127.0.0.1:{port}?pkt_size=1200'"
EOF

chmod +x whip.sh

cat >whep.sh <<EOF
#!/bin/bash
sleep 10
${TARGET_DIR}/whepfrom -c vp8 -u http://localhost:3000/whep/777 -t localhost:5004 --command "ffplay -protocol_whitelist rtp,file,udp -i stream.sdp"
EOF

chmod +x whep.sh

./multirun.sh \
"${TARGET_DIR}/live777" \
"./whip.sh" \
"./whep.sh" \
"sleep 30"

rm stream.sdp
rm whip.sh
rm whep.sh

0 comments on commit 6f3b790

Please # to comment.