Skip to content

Commit

Permalink
Revert "Rewrote readme in tests for faster start of work"
Browse files Browse the repository at this point in the history
This reverts commit 6b7180e.
  • Loading branch information
maccelf committed Mar 6, 2024
1 parent 6b7180e commit 786479a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
13 changes: 0 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@ version: "3.9"

services:

web_server_tests:
image: quay.io/almalinuxorg/albs:latest
env_file:
- test_vars.env
volumes:
- "./alws:/code/alws"
- "./scripts:/code/scripts"
- "./reference_data:/code/reference_data"
- "./tests:/code/tests"
- "./requirements.txt:/code/requirements.txt"
command:
bash -c 'source env/bin/activate && pytest -v --ignore alws/'

db:
image: postgres:13
env_file:
Expand Down
13 changes: 4 additions & 9 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,21 @@

`mock_classes.py` - a module which contain base class with `httpx` request method, setup logic for each test suite and HTTP status codes
## How to run tests locally
1. Create `test_vars.env` in the root folder of project
2. Adjust variables in `test_vars.env`
1. Create `test-almalinux-bs` database
2. Adjust variables in `vars.env`
```
POSTGRES_DB="test-almalinux-bs"
POSTGRES_PASSWORD="password"
DATABASE_URL="postgresql+asyncpg://postgres:password@db/test-almalinux-bs"
SYNC_DATABASE_URL="postgresql+psycopg2://postgres:password@db/test-almalinux-bs"
PULP_DATABASE_URL="postgresql+psycopg2://postgres:password@db/test-almalinux-bs"
GITHUB_CLIENT="test-github-client"
GITHUB_CLIENT_SECRET="test-github-secret"
ALTS_TOKEN="test"
JWT_SECRET="test"
```
also if you don’t have `vars.env` created, you need to create it and fill it out
3. Up docker-compose services. Before starting docker, make sure that you have local postgres disabled
3. Up docker-compose services
```bash
docker-compose up -d --no-deps web_server db
```
4. Run `pytest` within `web_server` container
```bash
docker-compose run --rm web_server_tests
docker-compose run --no-deps --rm web_server bash -c 'source env/bin/activate && pytest -v --ignore alws/'
```
- we ignore `alws/` directory because it's contains files which names starts with `test*.py`

1 comment on commit 786479a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Total coverage

Coverage report for changed files •
FileStmtsMissCoverMissing
TOTAL9701424156% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
81 2 💤 0 ❌ 0 🔥 40.124s ⏱️

Please sign in to comment.