-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Nneji123/testing-client
Added automated tests
- Loading branch information
Showing
33 changed files
with
1,509 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Python Tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: ["3.8", "3.9", "3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run build script | ||
run: | | ||
apt-get update && apt-get ffmpeg libsm6 build-essential cmake libxext6 | ||
pip install --upgrade setuptools | ||
pip install dlib --verbose | ||
cd src | ||
pip install -r requirements.txt | ||
shell: bash | ||
- name: Install dependencies | ||
run: | | ||
cd tests | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
- name: Test with pytest | ||
uses: dariocurr/pytest-summary@main | ||
with: | ||
output: test-summary.md | ||
paths: tests/**.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.env | ||
database.db | ||
src/database.db | ||
__pycache__/ | ||
.pytest_cache/ | ||
env/ | ||
instance/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Create virtual environment | ||
.PHONY: venv | ||
|
||
venv: | ||
sh -c 'python -m venv env' | ||
|
||
|
||
# Activate virtual environment | ||
.PHONY: activate | ||
|
||
activate: | ||
sh -c 'source env/Scripts/activate' | ||
|
||
# Lint files | ||
.PHONY: lint | ||
|
||
lint: | ||
sh -c 'black src && isort src' | ||
|
||
# Install requirements | ||
.PHONY: install | ||
|
||
install: | ||
sh -c 'cd src && pip install -r requirements.txt' | ||
|
||
# Run init script | ||
.PHONY: init | ||
|
||
init: | ||
sh -c 'cd src && ./init.sh' | ||
|
||
# Start application | ||
.PHONY: start | ||
|
||
start: | ||
sh -c 'cd src && python app.py' | ||
|
||
# Run tests | ||
.PHONY: test | ||
|
||
test: | ||
pip install pytest pytest-html | ||
sh -c 'cd src/tests && pytest . -W ignore::DeprecationWarning --verbose --html=report.html' | ||
|
||
# Cleanup | ||
.PHONY: clean | ||
|
||
clean: | ||
sh -c 'rm -rf env && cd src && rm -rf database.db' | ||
|
||
# Default target | ||
all: venv activate install init start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.