now tests no longer use compose
This commit is contained in:
parent
80d365c859
commit
034addb234
3 changed files with 10 additions and 18 deletions
|
@ -38,10 +38,3 @@ services:
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
booksearch_tests:
|
|
||||||
build: .
|
|
||||||
container_name: booksearch_tests
|
|
||||||
volumes:
|
|
||||||
- ./test_data:/app/test_data
|
|
||||||
- ./tests:/app/tests
|
|
||||||
command: sh -c "cd /app && PYTHONPATH=/app python -m unittest tests.unit.test_epub_extraction -v"
|
|
||||||
|
|
|
@ -3,11 +3,13 @@
|
||||||
# Get absolute path to project root
|
# Get absolute path to project root
|
||||||
PROJECT_ROOT=$(dirname $(dirname $(realpath $0)))
|
PROJECT_ROOT=$(dirname $(dirname $(realpath $0)))
|
||||||
|
|
||||||
|
# Build the test image
|
||||||
|
docker build -t booksearch_tests .
|
||||||
|
|
||||||
# Run the test container
|
# Run the test container
|
||||||
docker-compose -f $PROJECT_ROOT/docker-compose.yml up -d booksearch_tests
|
docker run --rm \
|
||||||
|
-v $PROJECT_ROOT/test_data:/app/test_data \
|
||||||
# Follow the logs
|
-v $PROJECT_ROOT/tests:/app/tests \
|
||||||
docker logs -f booksearch_tests
|
--name booksearch_tests \
|
||||||
|
booksearch_tests \
|
||||||
# Clean up
|
sh -c "cd /app && PYTHONPATH=/app python -m unittest tests.unit.test_epub_extraction -v"
|
||||||
docker-compose -f $PROJECT_ROOT/docker-compose.yml down
|
|
||||||
|
|
|
@ -9,10 +9,7 @@ import PyPDF2
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import sys
|
from src.core.index import index_files, get_progress
|
||||||
from pathlib import Path
|
|
||||||
sys.path.append(str(Path(__file__).parent.parent))
|
|
||||||
from index import index_files, get_progress
|
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue