forked from ibis-project/ibis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
67 lines (59 loc) · 2.25 KB
/
circle.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
machine:
python:
version: 3.4.3
pre:
- sudo apt-get install --only-upgrade sqlite3 # make sure we have instr
environment:
IBIS_TEST_SQLITE_DB_PATH: $HOME/ibis-testing-data/ibis_testing.db
IBIS_TEST_POSTGRES_DB: circle_test
IBIS_TEST_CRUNCHBASE_DB: $HOME/crunchbase.db
post:
# download the crunchbase sqlite database, for lineage testing
- wget https://ibis-resources.s3.amazonaws.com/data/crunchbase/crunchbase.db
# download the data
- wget https://ibis-resources.s3.amazonaws.com/testing/ibis-testing-data.tar.gz
# untar it
- tar xvzf ibis-testing-data.tar.gz
services:
- docker
dependencies:
override:
- pip install -U pip
- pip install -r requirements.txt
post:
- docker info
#- docker pull cloudera/impala-dev:minimal
#- docker run --name impala -d -t cloudera/impala-dev:minimal
#- sudo lxc-attach -n "$(docker inspect --format "{{.Id}}" impala)" -- sudo -H -u dev bash 'docker-boot && cd ~/Impala && JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 . bin/impala-config.sh && JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 ./buildall.sh -format -notests -release && run-all.sh && start-impala-cluster.py'
database:
override:
# dump the data to a CSV file
- sqlite3 -separator ',' -csv -noheader $IBIS_TEST_SQLITE_DB_PATH <<< 'SELECT * FROM functional_alltypes;' > dump.csv
# create the Postgres table
- >
psql -U ubuntu -d circle_test <<EOF
CREATE TABLE functional_alltypes (
"index" BIGINT,
other BIGINT,
id BIGINT,
bool_col BOOLEAN,
tinyint_col SMALLINT,
smallint_col SMALLINT,
int_col INTEGER,
bigint_col BIGINT,
float_col FLOAT4,
double_col FLOAT8,
date_string_col TEXT,
string_col TEXT,
timestamp_col TIMESTAMP,
year BIGINT,
month BIGINT
);
CREATE INDEX ON functional_alltypes ("index");
EOF
# load the sqlite dump into the pg table
- cat dump.csv | psql -U ubuntu -d circle_test -c "COPY functional_alltypes FROM STDIN WITH (FORMAT CSV, HEADER FALSE, DELIMITER ',')"
- rm dump.csv
test:
override:
- py.test ibis --postgresql --sqlite --tb=short --junitxml="$CIRCLE_TEST_REPORTS/junit.xml"