forked from openvar/variantValidator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
95 lines (72 loc) · 3.23 KB
/
.travis.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
language: python
matrix:
include:
# Here you can add or remove specific builds, and Python versions. You
# should currently be able to use Python 2.6, 2.7, or 3.3 or later. The
# NUMPY and SCIPY versions are set here as an example, but you can
# add/remove environment variables, and use them below during the install.
- python: 3.10
services:
- mysql
addons:
postgresql: "12"
apt:
packages:
- postgresql-12
- postgresql-client-12
env:
global:
- PGPORT=5433
- CODECOV_TOKEN="50dd5c2e-4259-4cfa-97a7-b4429e0d179e"
before_install:
# Increase size of database drive
- sudo mount -o remount,size=50% /var/ramfs
# Set up the databases - install seqrepo and UTA
- mysql -e 'CREATE DATABASE validator;'
- df -h
# seqrepo needs bgzip from htslib, in ubuntu this is included in the tabix package
- sudo apt-get -y install tabix
## prep psql, get and load vvta db dump
# fix auth (taken from https://alphahydrae.com/2021/02/how-to-run-postgresql-13-on-travis-ci/)
- sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/12/main/pg_hba.conf
# Restart the PostgreSQL service:
- sudo service postgresql@12-main restart
- sleep 3
- createuser -e --createdb uta_admin
### for local use we probably just need to add -P to createuser and use uta_admin, but that spawns an interactive prompt
### also we need to test that the database works with only public permissions too, as should be for any web attached user
- createdb -e vvta -O uta_admin
- psql -d vvta -U postgres -c "CREATE USER ta_user WITH PASSWORD 'read_only'"
- wget --output-document=vvta_2022_11_noseq.sql.gz https://www528.lamp.le.ac.uk/vvdata/vvta/vvta_2022_11_noseq.sql.gz
- gunzip -c vvta_2022_11.noseq.psql.gz | psql --quiet vvta
- psql -d vvta -U postgres -c 'GRANT SELECT ON vvta_2022_11.gene TO public;'
- psql -d vvta -U postgres -c 'GRANT SELECT ON ALL TABLES IN SCHEMA public TO ta_user;'
# Access to materialzed views
- psql -d vvta -U postgres -c 'GRANT SELECT ON vvta_2022_11.tx_def_summary_v TO ta_user;'
- psql -d vvta -U postgres -c 'GRANT SELECT ON vvta_2022_11.tx_exon_aln_v TO ta_user;'
- psql -d vvta -U postgres -c 'GRANT SELECT ON vvta_2022_11.transcript_lengths_v TO ta_user;'
- psql -d vvta -U postgres -c 'GRANT SELECT ON vvta_2022_11.exon_set TO ta_user;'
# Copy configuration file
- cp configuration/travis.ini "$HOME"/.variantvalidator
# Get validator database
- wget --output-document=validator_2022_11.sql.gz https://www528.lamp.le.ac.uk/vvdata/validator/validator_2022_11.sql.gz
- gunzip validator_2022_11.sql.gz
install:
# Test dependencies
- pip install -r requirements_dev.txt
- pip install -e .
## get seqrepo data and load it into now installed seqrepo
- mkdir "$HOME"/vvta_seqrepo
- wget --output-document="$HOME"/vvta_seqrepo/VV_SR_2022_11.tar https://www528.lamp.le.ac.uk/vvdata/vv_seqrepo/VV_SR_2022_11.tar
- cd "$HOME"/vvta_seqrepo/
- tar -xvf VV_SR_2022_11.tar
- cd -
# Set up validator database
- mysql validator < validator_2022_11.sql
- rm validator_2022_11.sql
# - update_vdb.py
- df -h
script:
- pytest --cov-report=term --cov=VariantValidator/ # will run all tests in the package
after_script:
- codecov