Skip to content

Commit

Permalink
Merge pull request #7 from SimerusM/3-github-actions-for-tests
Browse files Browse the repository at this point in the history
test gh action
  • Loading branch information
16BitNarwhal authored Aug 26, 2024
2 parents 2117ba3 + b373a36 commit 7b4ce6b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run Tests
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
name: Run Tests
env:
TESTING: true
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20.5.0'

- name: Install Node.js Dependencies
run: npm install

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10.10'

- name: Setup Python Virtual Environment
run: python -m venv python3-virtualenv

- name: Activate Virtual Environment and Install Dependencies
run: |
source python3-virtualenv/bin/activate
pip install -r api-server/requirements.txt
- name: Run Flask Server in Background
run: |
source python3-virtualenv/bin/activate
python api-server/app.py &
sleep 5 # Ensure server has time to start
- name: Run Tests
run: npm run test
6 changes: 5 additions & 1 deletion api-server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ def log_message(level, message, meeting=''):
setup_webrtc_sockets(socketio)

if __name__ == '__main__':
socketio.run(app, debug=True)
import os
if os.getenv('TESTING', True):
socketio.run(app, debug=True, allow_unsafe_werkzeug=True)
else:
socketio.run(app, debug=True)

0 comments on commit 7b4ce6b

Please sign in to comment.