-
-
Notifications
You must be signed in to change notification settings - Fork 132
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 #342 from zurdi15/master
v1.10
- Loading branch information
Showing
111 changed files
with
195,797 additions
and
1,449 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
**/tests/cassettes/*.yaml linguist-generated |
File renamed without changes.
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,69 @@ | ||
name: run pytest | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- "opened" | ||
- "synchronize" | ||
paths-ignore: | ||
- "docker/**" | ||
- "examples/*" | ||
- "frontend/**" | ||
push: | ||
branches: | ||
- "master" | ||
paths-ignore: | ||
- "docker/**" | ||
- "examples/*" | ||
- "frontend/**" | ||
|
||
jobs: | ||
pytest: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
services: | ||
mariadb: | ||
image: mariadb:10.11 | ||
ports: | ||
- 3306 | ||
env: | ||
MYSQL_USER: romm_test | ||
MYSQL_PASSWORD: passwd | ||
MYSQL_DATABASE: romm_test | ||
MYSQL_ROOT_PASSWORD: passwd | ||
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Install mariadb connectors | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y libmariadb3 libmariadb-dev | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'poetry' | ||
- name: Install dependencies | ||
run: | | ||
poetry install --sync | ||
- name: Initiate database | ||
run: | | ||
mysql --host 127.0.0.1 --port ${{ job.services.mariadb.ports['3306'] }} -uroot -ppasswd -e "GRANT ALL PRIVILEGES ON romm_test.* TO 'romm_test'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;" | ||
- name: Run python tests | ||
env: | ||
DB_HOST: 127.0.0.1 | ||
DB_PORT: ${{ job.services.mariadb.ports['3306'] }} | ||
run: | | ||
cd backend | ||
poetry run pytest -vv --maxfail=10 --junitxml=pytest-report.xml . | ||
- name: Publish test results | ||
uses: EnricoMi/publish-unit-test-result-action/composite@v2 | ||
if: always() | ||
with: | ||
files: | | ||
backend/pytest-report.xml |
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,52 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "dev", | ||
"path": "frontend", | ||
"problemMatcher": [], | ||
"label": "Launch frontend [npm]" | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "source ~/.cache/pypoetry/virtualenvs/romm-TjwgbYlf-py3.11/bin/activate; cd backend; python main.py", | ||
"label": "Launch backend [python]", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "source ~/.cache/pypoetry/virtualenvs/romm-TjwgbYlf-py3.11/bin/activate; cd backend; pytest -v", | ||
"label": "Execute tests [pytest]", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "./docker/build_local_image.sh", | ||
"label": "Build docker local image [docker]", | ||
"problemMatcher": [], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "docker compose up -d", | ||
"label": "Setup development environment [docker] (1)", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "export $(cat .env | xargs); docker exec -i mariadb mariadb -u root -p$DB_ROOT_PASSWD < backend/romm_test/setup.sql", | ||
"label": "Setup development environment migrations [docker] (2)", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"type": "shell", | ||
"command": "cd romm_mock; docker compose up -d", | ||
"label": "Setup testing environment [docker]", | ||
"problemMatcher": [] | ||
} | ||
] | ||
} |
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.