Skip to content

Commit 1567180

Browse files
committed
Merge
2 parents d0ebf13 + ec7dba0 commit 1567180

File tree

1 file changed

+53
-7
lines changed

1 file changed

+53
-7
lines changed

.circleci/config.yml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,57 @@
11
version: 2
22
jobs:
33
ubuntu:
4+
docker:
5+
- image: circleci/buildpack-deps:20.04
6+
7+
- image: circleci/postgres:12-alpine-ram
8+
environment:
9+
POSTGRES_USER: postgres
10+
POSTGRES_DB: circle_test
11+
12+
- image: circleci/mysql:8.0-ram
13+
environment:
14+
MYSQL_ALLOW_EMPTY_PASSWORD=true
15+
MYSQL_ROOT_HOST=%
16+
17+
resource_class: small
18+
19+
working_directory: ~/repo
20+
21+
steps:
22+
- checkout
23+
24+
- run:
25+
name: install packages
26+
command: |
27+
sudo apt-get update
28+
sudo apt-get install -y libgpgme-dev default-mysql-client-core postgresql-client python3-docutils python3-gpg python3-jwt python3-markdown python3-markdown2 python3-mistune python3-mysqldb python3-pip python3-psycopg2 python3-pytest python3-pytest-cov python3-tz python3-venv python3-whoosh python3-xapian swig
29+
30+
- run:
31+
name: setup databases
32+
command: |
33+
psql -d postgresql://postgres@localhost/circle_test -c "CREATE ROLE rounduptest WITH CREATEDB LOGIN PASSWORD 'rounduptest';"
34+
mysql -h 127.0.0.1 -u root -e "CREATE USER 'rounduptest'@'127.0.0.1' IDENTIFIED BY 'rounduptest'; GRANT ALL ON rounduptest.* TO 'rounduptest'@'127.0.0.1';"
35+
# patch host to 127.0.0.1 to force TCP connection to MySQL
36+
sed -i -e 's/\(config[.]RDBMS_HOST =\) "localhost"/\1 "127.0.0.1"/' test/db_test_base.py
37+
38+
- run:
39+
name: run tests
40+
command: |
41+
py.test-3 -v test/ --cov=roundup
42+
environment:
43+
MYSQL_HOST: 127.0.0.1
44+
45+
- run:
46+
name: run coverage
47+
command: |
48+
python3-coverage html -i
49+
50+
- store_artifacts:
51+
path: htmlcov
52+
destination: roundup-ubuntu
53+
54+
ubuntu-old:
455
docker:
556
- image: circleci/buildpack-deps:18.04
657

@@ -34,9 +85,6 @@ jobs:
3485
mysql -h 127.0.0.1 -u root -e "GRANT ALL ON rounduptest.* TO rounduptest@'127.0.0.1' IDENTIFIED BY \"rounduptest\";"
3586
# patch host to 127.0.0.1 to force TCP connection to MySQL
3687
sed -i -e 's/\(config[.]RDBMS_HOST =\) "localhost"/\1 "127.0.0.1"/' test/db_test_base.py
37-
# HACK: workaround mysql bug: http://bugs.mysql.com/bug.php?id=74901
38-
# needed for test_mysql.mysqlDBTest.testFilteringSpecialChars
39-
sed -i -e 's/CREATE DATABASE \%s/CREATE DATABASE \%s COLLATE utf8_general_ci/' roundup/backends/back_mysql.py
4088
4189
- run:
4290
name: run tests
@@ -52,7 +100,7 @@ jobs:
52100
53101
- store_artifacts:
54102
path: htmlcov
55-
destination: roundup-ubuntu
103+
destination: roundup-ubuntu-old
56104

57105
debian:
58106
docker:
@@ -88,9 +136,6 @@ jobs:
88136
mysql -h 127.0.0.1 -u root -e "GRANT ALL ON rounduptest.* TO rounduptest@'127.0.0.1' IDENTIFIED BY \"rounduptest\";"
89137
# patch host to 127.0.0.1 to force TCP connection to MySQL
90138
sed -i -e 's/\(config[.]RDBMS_HOST =\) "localhost"/\1 "127.0.0.1"/' test/db_test_base.py
91-
# HACK: workaround mysql bug: http://bugs.mysql.com/bug.php?id=74901
92-
# needed for test_mysql.mysqlDBTest.testFilteringSpecialChars
93-
sed -i -e 's/CREATE DATABASE \%s/CREATE DATABASE \%s COLLATE utf8_general_ci/' roundup/backends/back_mysql.py
94139
95140
- run:
96141
name: run tests
@@ -113,4 +158,5 @@ workflows:
113158
test_all:
114159
jobs:
115160
- ubuntu
161+
- ubuntu-old
116162
- debian

0 commit comments

Comments
 (0)