Skip to content

Commit 21c0a97

Browse files
committed
Merge fix to issues.roundup-tracker.org
2 parents 41001c7 + 7bbb467 commit 21c0a97

File tree

1 file changed

+72
-10
lines changed

1 file changed

+72
-10
lines changed

.circleci/config.yml

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
version: 2
22
jobs:
3-
build:
3+
ubuntu:
44
docker:
55
- image: circleci/buildpack-deps:18.04
66

7-
- image: circleci/postgres:9.6-alpine-ram
7+
- image: circleci/postgres:10-alpine-ram
8+
environment:
9+
POSTGRES_USER: postgres
10+
POSTGRES_DB: circle_test
811

912
- image: circleci/mysql:5.7-ram
1013
environment:
1114
MYSQL_ALLOW_EMPTY_PASSWORD=true
1215
MYSQL_ROOT_HOST=%
1316

17+
resource_class: small
18+
1419
working_directory: ~/repo
1520

1621
steps:
@@ -20,19 +25,66 @@ jobs:
2025
name: install packages
2126
command: |
2227
sudo apt-get update
23-
sudo apt-get install -y libgpgme-dev mysql-client-core-5.7 postgresql-client python3-gpg python3-mysqldb python3-pip python3-psycopg2 python3-pytest python3-pytest-cov python3-tz python3-venv python3-whoosh python3-xapian swig
28+
sudo apt-get install -y libgpgme-dev default-mysql-client-core postgresql-client python3-docutils python3-gpg python3-jwt python3-markdown 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 "GRANT ALL ON rounduptest.* TO rounduptest@'127.0.0.1' IDENTIFIED BY \"rounduptest\";"
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+
# 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
40+
41+
- run:
42+
name: run tests
43+
command: |
44+
py.test-3 -v test/ --cov=roundup
45+
environment:
46+
MYSQL_HOST: 127.0.0.1
47+
48+
- run:
49+
name: run coverage
50+
command: |
51+
python3-coverage html -i
52+
53+
- store_artifacts:
54+
path: htmlcov
55+
destination: roundup-ubuntu
56+
57+
debian:
58+
docker:
59+
- image: circleci/buildpack-deps:buster
60+
61+
- image: circleci/postgres:11-alpine-ram
62+
environment:
63+
POSTGRES_USER: postgres
64+
POSTGRES_DB: circle_test
65+
66+
- image: circleci/mariadb:10.3-ram
67+
environment:
68+
MYSQL_ALLOW_EMPTY_PASSWORD=true
69+
MYSQL_ROOT_HOST=%
70+
71+
resource_class: small
72+
73+
working_directory: ~/repo
74+
75+
steps:
76+
- checkout
2477

2578
- run:
26-
name: install dependencies
79+
name: install packages
2780
command: |
28-
python3 -m venv venv
29-
. venv/bin/activate
30-
pip3 install codecov
81+
sudo apt-get update
82+
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
3183
3284
- run:
3385
name: setup databases
3486
command: |
35-
psql -d postgresql://root@localhost/circle_test -c "CREATE ROLE rounduptest WITH CREATEDB LOGIN PASSWORD 'rounduptest';"
87+
psql -d postgresql://postgres@localhost/circle_test -c "CREATE ROLE rounduptest WITH CREATEDB LOGIN PASSWORD 'rounduptest';"
3688
mysql -h 127.0.0.1 -u root -e "GRANT ALL ON rounduptest.* TO rounduptest@'127.0.0.1' IDENTIFIED BY \"rounduptest\";"
3789
# patch host to 127.0.0.1 to force TCP connection to MySQL
3890
sed -i -e 's/\(config[.]RDBMS_HOST =\) "localhost"/\1 "127.0.0.1"/' test/db_test_base.py
@@ -43,12 +95,22 @@ jobs:
4395
- run:
4496
name: run tests
4597
command: |
46-
. venv/bin/activate
4798
py.test-3 -v test/ --cov=roundup
4899
environment:
49100
MYSQL_HOST: 127.0.0.1
50101

51102
- run:
52103
name: run coverage
53104
command: |
54-
codecov
105+
python3-coverage html -i
106+
107+
- store_artifacts:
108+
path: htmlcov
109+
destination: roundup-debian
110+
111+
workflows:
112+
version: 2
113+
test_all:
114+
jobs:
115+
- ubuntu
116+
- debian

0 commit comments

Comments
 (0)