- Add fetcher/tests/ with 21 tests covering all bug fixes:
- test_utils: get_with_protocol URL normalization (5 tests)
- test_config: scheduled_tasks.json PK uniqueness, Celery queue
settings (7 tests)
- test_publish: URL routing and view for /task/publish_<id>/ (4 tests)
- test_template_field: url_detail.html renders images_url field (2 tests)
- test_search_postprocess: URL host filtering and param stripping (3 tests)
- Replace empty fetcher/tests.py with tests/ package
- Add .gitea/workflows/test.yml: runs on PRs and pushes to main,
installs dependencies and runs `manage.py test fetcher.tests`
This commit is contained in:
1 parent
3a33697ca3
commit
d18eda2fc4
8 files changed
+298
-3
No files matched your search
@@ -0,0 +1,57 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:17
|
||||
env:
|
||||
POSTGRES_DB: matitos
|
||||
POSTGRES_USER: supermatitos
|
||||
POSTGRES_PASSWORD: supermatitos
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
|
||||
env:
|
||||
DJANGO_SECRET_KEY: ci-test-secret
|
||||
DJANGO_ALLOWED_HOSTS: '*'
|
||||
DJANGO_ALLOWED_ORIGINS: 'http://localhost'
|
||||
DB_NAME: matitos
|
||||
DB_USER: supermatitos
|
||||
DB_PASSWORD: supermatitos
|
||||
DB_HOST: localhost
|
||||
DB_PORT: '5432'
|
||||
REDIS_CACHE_HOST: localhost
|
||||
REDIS_CACHE_PORT: '6379'
|
||||
REDIS_CELERY_HOST: localhost
|
||||
REDIS_CELERY_PORT: '6379'
|
||||
PATH_LOGS_DIRECTORY: /tmp/logs
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
cache: 'pip'
|
||||
cache-dependency-path: app_urls/requirements.txt
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install -r app_urls/requirements.txt
|
||||
|
||||
- name: Run tests
|
||||
working-directory: app_urls
|
||||
run: python manage.py test fetcher.tests -v 2
|
||||
Reference in new issue
Block a user