-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
67 lines (51 loc) · 1.96 KB
/
Copy path.travis.yml
File metadata and controls
67 lines (51 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
language: python
python:
- "3.12" # Specify the Python version to use
env:
- TESTING=True
# Enable caching for pip to speed up builds by reusing previously downloaded packages
cache:
pip: true
# Add PostgreSQL service for testing database interactions
services:
- postgresql
# Environment variables for PostgreSQL
env:
global:
# Define a separate test database
- POSTGRES_DB=de66dcp38h2o4m
- POSTGRES_USER=u57kmcm3orlrse
- POSTGRES_PASSWORD=p9ba3c40033c848824b46a92c562a41564a01454a9de36d46c8435d518715185f
# DATABASE_URL for the test database
- TEST_DATABASE_URL=postgresql://u57kmcm3orlrse:p9ba3c40033c848824b46a92c562a41564a01454a9de36d46c8435d518715185f@c1v04v8krpfbct.cluster-czrs8kj4isg7.us-east-1.rds.amazonaws.com:5432/de66dcp38h2o4m
# Upgrade pip and setuptools before installation
before_install:
- pip install --upgrade pip setuptools wheel # Add wheel for building distributions
# Install project dependencies and the project itself
install:
- pip install -r requirements.txt
- pip install .
# Set up the PostgreSQL database and run migrations
before_script:
# Verify PostgreSQL installation
- psql --version
# Create the test database
- psql -c 'CREATE DATABASE labmate_test_db;' -U postgres
# Install Alembic for database migrations
- pip install alembic
# Run Alembic migrations to set up the test database schema
# Ensure that alembic.ini is correctly configured to use TEST_DATABASE_URL for testing
- alembic upgrade head
# Run tests with coverage reporting
script:
- pytest -n auto --cov=labmateai --cov-report=xml --cov-report=term-missing
# After successful tests, upload coverage reports to Codecov
after_success:
- bash <(curl -s https://codecov.io/bash)
# Email notifications for build results
notifications:
email:
recipients:
- tnoblin@health.ucsd.edu
on_success: change # Notify only if the build status changes to success
on_failure: always # Always notify on failures