-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
75 lines (65 loc) · 5.71 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
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
services:
- postgresql
install:
- python setup.py develop
- pip install -e .[test]
- pip install -U pytest
before_script:
- "TMPDIR=`mktemp -d`"
- psql -c 'create database hgt_test;' -U postgres
- psql -U postgres -d hgt_test -c "create extension postgis;"
script:
- pytest -v gmaltcli/tests/
- flake8 gmaltcli
- "gmalt-hgtread 1.0001 10.0001 gmaltcli/tests/srtm3/N00E010.hgt | grep \"Value: 57\""
- "gmalt-hgtread 1.0001 10.0001 gmaltcli/tests/srtm3/N00E010.hgt | grep \"Location: (0P,0L)\""
- "gmalt-hgtread 0.861295 10.339703 gmaltcli/tests/srtm3/N00E010.hgt | grep \"Value: 644\""
- "gmalt-hgtread 0.861295 10.339703 gmaltcli/tests/srtm3/N00E010.hgt | grep \"Location: (408P,166L)\""
- "gmalt-hgtread 1.0001 10.0001 gmaltcli/tests/srtm1/N00E010.hgt | grep \"Value: 57\""
- "gmalt-hgtread 1.0001 10.0001 gmaltcli/tests/srtm1/N00E010.hgt | grep \"Location: (0P,0L)\""
- "gmalt-hgtread 0.861295 10.339703 gmaltcli/tests/srtm1/N00E010.hgt | grep \"Value: 646\""
- "gmalt-hgtread 0.861295 10.339703 gmaltcli/tests/srtm1/N00E010.hgt | grep \"Location: (1223P,499L)\""
- "gmalt-hgtget small $TMPDIR"
- "ls $TMPDIR | wc -l | grep 6"
- "ls $TMPDIR | grep '^N00E009.hgt.zip$'"
- "ls $TMPDIR | grep '^N00E009.hgt$'"
- "md5sum -b $TMPDIR/N00E009.hgt | grep '0dc319cb922bac1b7ccefa0b55688a51'"
# Tests without GIS extension on Postgres
- "gmalt-hgtload -vv -tb -c 2 -u postgres -d hgt_test -H '' -t elevation gmaltcli/tests/import/"
- "psql -U postgres -d hgt_test -c 'SELECT COUNT(*) FROM elevation;' | grep 5000"
- "psql -U postgres -d hgt_test -c 'SELECT value FROM elevation WHERE (2.67 BETWEEN lat_min AND lat_max) AND (10.69 BETWEEN lng_min AND lng_max);' | grep 434"
- "psql -U postgres -d hgt_test -c 'SELECT value FROM elevation WHERE (0.46 BETWEEN lat_min AND lat_max) AND (1.02 BETWEEN lng_min AND lng_max);' | grep 146"
# Tests with GIS extension on Postgres without sampling the file
- "gmalt-hgtload -vv -tb -c 2 -u postgres -d hgt_test -H '' -t elevation_gis_full -r gmaltcli/tests/import/"
- "psql -U postgres -d hgt_test -c 'SELECT COUNT(*) FROM elevation_gis_full;' | grep 2"
- "psql -U postgres -d hgt_test -c 'select ST_MetaData(rast) from elevation_gis_full;' | grep '50,50,0.0204081632653061,-0.0204081632653061,0,0,4326,1)' | wc -l | grep 2"
- "psql -U postgres -d hgt_test -c 'select ST_MetaData(rast) from elevation_gis_full;' | grep '(9.98979591836735,3.01020408163265,'"
- "psql -U postgres -d hgt_test -c 'select ST_MetaData(rast) from elevation_gis_full;' | grep '(0.989795918367347,1.01020408163265,'"
- "psql -U postgres -d hgt_test -c \"SELECT ST_VALUE(rast, ST_PointFromText('POINT(10.69 2.67)', 4326)) FROM elevation_gis_full WHERE rast ~ ST_PointFromText('POINT(10.69 2.67)');\" | grep 434"
- "psql -U postgres -d hgt_test -c \"SELECT ST_VALUE(rast, ST_PointFromText('POINT(1.02 0.46)', 4326)) FROM elevation_gis_full WHERE rast ~ ST_PointFromText('POINT(1.02 0.46)');\" | grep 146"
# Tests with GIS extension on Postgres while sampling the file
- "gmalt-hgtload -vv -tb -c 2 -u postgres -d hgt_test -H '' -t elevation_gis_sampled -r -s 12 11 gmaltcli/tests/import/"
- "psql -U postgres -d hgt_test -c 'SELECT count(*) from elevation_gis_sampled;' | grep 50"
- "psql -U postgres -d hgt_test -c 'select ST_MetaData(rast) from elevation_gis_sampled;' | grep ',0.0204081632653061,-0.0204081632653061,0,0,4326,1)' | wc -l | grep 50"
- "psql -U postgres -d hgt_test -c 'select ST_MetaData(rast) from elevation_gis_sampled;' | grep ',12,11,' | wc -l | grep 32"
- "psql -U postgres -d hgt_test -c 'select ST_MetaData(rast) from elevation_gis_sampled;' | grep ',2,11,' | wc -l | grep 8"
- "psql -U postgres -d hgt_test -c 'select ST_MetaData(rast) from elevation_gis_sampled;' | grep ',12,6,' | wc -l | grep 8"
- "psql -U postgres -d hgt_test -c 'select ST_MetaData(rast) from elevation_gis_sampled;' | grep ',2,6,' | wc -l | grep 2"
- "psql -U postgres -d hgt_test -c \"SELECT ST_VALUE(rast, ST_PointFromText('POINT(10.69 2.67)', 4326)) FROM elevation_gis_sampled WHERE rast ~ ST_PointFromText('POINT(10.69 2.67)');\" | grep 434"
- "psql -U postgres -d hgt_test -c \"SELECT ST_VALUE(rast, ST_PointFromText('POINT(1.02 0.46)', 4326)) FROM elevation_gis_sampled WHERE rast ~ ST_PointFromText('POINT(1.02 0.46)');\" | grep 146"
# Tests with GIS extension on Postgres with original STRM3 file
- "gmalt-hgtload -vv -tb -c 2 -u postgres -d hgt_test -H '' -t elevation_gis_srtm_full -r gmaltcli/tests/srtm3/"
- "psql -U postgres -d hgt_test -c 'SELECT count(*) from elevation_gis_srtm_full;' | grep 1"
- "psql -U postgres -d hgt_test -c \"SELECT ST_VALUE(rast, ST_PointFromText('POINT(10.0001 1.0001)', 4326)) FROM elevation_gis_srtm_full WHERE rast ~ ST_PointFromText('POINT(10.0001 1.0001)');\" | grep 57"
- "psql -U postgres -d hgt_test -c \"SELECT ST_VALUE(rast, ST_PointFromText('POINT(10.339703 0.861295)', 4326)) FROM elevation_gis_srtm_full WHERE rast ~ ST_PointFromText('POINT(10.339703 0.861295)');\" | grep 644"
# Tests with GIS extension on Postgres with sampled STRM3 file
- "gmalt-hgtload -vv -tb -c 2 -u postgres -d hgt_test -H '' -t elevation_gis_srtm_sampled -r -s 50 50 gmaltcli/tests/srtm3/"
- "psql -U postgres -d hgt_test -c 'SELECT count(*) from elevation_gis_srtm_sampled;' | grep 625"
- "psql -U postgres -d hgt_test -c \"SELECT ST_VALUE(rast, ST_PointFromText('POINT(10.0001 1.0001)', 4326)) FROM elevation_gis_srtm_sampled WHERE rast ~ ST_PointFromText('POINT(10.0001 1.0001)');\" | grep 57"
- "psql -U postgres -d hgt_test -c \"SELECT ST_VALUE(rast, ST_PointFromText('POINT(10.339703 0.861295)', 4326)) FROM elevation_gis_srtm_sampled WHERE rast ~ ST_PointFromText('POINT(10.339703 0.861295)');\" | grep 644"