-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests
- Loading branch information
Showing
11 changed files
with
391 additions
and
8 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,49 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
test: | ||
name: Tests microservice | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install Python dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Run tests & Coverage file | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pytest | ||
pytest --cache-clear --cov=app/service app/tests/ --cov-report=xml > pytest-coverage.txt | ||
env: | ||
DATABASE_URL: postgresql://pepe | ||
PYTHONPATH: ./app | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
directory: ./coverage/reports/ | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
path_to_write_report: ./coverage/codecov_report.txt | ||
verbose: true |
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,17 @@ | ||
FROM python:3.11-slim-buster | ||
|
||
WORKDIR /users | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y install libpq-dev gcc \ | ||
&& pip install psycopg2 | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
EXPOSE ${PORT} | ||
|
||
COPY . . | ||
|
||
CMD ["sh", "-c","DATABASE_URL=postgresql://user:1234@sql:5432/users", "PYTHONPATH=./app", "pytest"] |
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
File renamed without changes.
Empty file.
Empty file.
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
Empty file.
Oops, something went wrong.