Skip to content

Commit

Permalink
Test room manager (#63)
Browse files Browse the repository at this point in the history
## Description

This PR adds a simple test for Room Manager.

## Motivation and Context

Testing the build, health status and proper token retrieval allow for
more confidence in merging new changes to Room Manager example and
prevent bad images from ending up in Cloud panel.

Fixes FCE-679

## Types of changes

- [x] tech debt remedy
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to
      not work as expected)
  • Loading branch information
PiotrWodecki authored Oct 11, 2024
1 parent db91337 commit 7280aa1
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 36 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build-and-test-room-manager-amd64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and Test Room Manager on amd64

on:
pull_request:
branches: [main]
paths:
- 'examples/room-manager/**'

workflow_dispatch:

jobs:
build-and-test-amd64-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
file: examples/room-manager/Dockerfile
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
tags: room-manager:${{ github.event.pull_request.head.sha }}
load: true
- name: Run Room Manager
run: |
docker run -d -p 8080:8080 \
--name gh-runner-room-manager \
--restart always \
-e PORT=8080 \
-e PEERLESS_PURGE_TIMEOUT=600 \
-e FISHJAM_URL=${{ secrets.ROOM_MANAGER_FISHJAM_URL }} \
-e FISHJAM_SERVER_TOKEN=${{ secrets.ROOM_MANAGER_FISHJAM_SERVER_TOKEN }} \
room-manager:${{ github.event.pull_request.head.sha }}
- name: Test Room Manager Healtcheck
run: |
sleep 2
curl -o tmp1.json -s -vvv http://127.0.0.1:8080/health
jq . tmp1.json
[[ $(jq -r .status tmp1.json) == "ok" ]]
- name: Test Room Manager API
run: |
curl -o tmp2.json -s -vvv "http://127.0.0.1:8080/api/rooms?roomName=testRoomName&peerName=testPeerName"
jq '{peerToken: .peerToken, room: .room, peer: .peer}' tmp2.json
[[ $(jq -r .peerToken tmp2.json) != "null" ]]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Room Manager Image
name: Build and Push Room Manager Multiplatform Image

on:
push:
Expand All @@ -9,7 +9,7 @@ on:
workflow_dispatch:

jobs:
build-and-push-image:
build-and-push-multiplatform-image:
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
6 changes: 0 additions & 6 deletions examples/room-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ Simple as that - send a plain GET request and receive an auth token.
Room Manager will search its memory for the username for the requested room and return a token.
Otherwise, it will create a new one.

### '/api/rooms/:roomName/start-recording'

Will start recording in the specified room.

> **_WARNING:_** Not implemented yet!
### '/api/rooms/webhook'

Exposes a webhook endpoint to allow the Fishjam instance to send notifications to the Room Manager.
28 changes: 0 additions & 28 deletions examples/room-manager/docker-compose-dev.yaml

This file was deleted.

0 comments on commit 7280aa1

Please sign in to comment.