Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into html-emails
- Loading branch information
Showing
275 changed files
with
4,949 additions
and
5,517 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,146 @@ | ||
version: 2 | ||
defaults: | ||
init_environemnt: &init_environment | ||
run: | | ||
# SOLR config | ||
cp ~/project/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml | ||
service jetty9 restart || true # erroring out but does seem to work | ||
# Database Creation | ||
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_POSTGRES_USER} WITH PASSWORD '${CKAN_POSTGRES_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;" | ||
createdb --encoding=utf-8 --host=ckan-postgres --username=ckan --owner=${CKAN_POSTGRES_USER} ${CKAN_POSTGRES_DB} | ||
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_DATASTORE_POSTGRES_READ_USER} WITH PASSWORD '${CKAN_DATASTORE_POSTGRES_READ_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;" | ||
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_DATASTORE_POSTGRES_WRITE_USER} WITH PASSWORD '${CKAN_DATASTORE_POSTGRES_WRITE_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;" | ||
createdb --encoding=utf-8 --host=ckan-postgres --username=ckan --owner=${CKAN_DATASTORE_POSTGRES_WRITE_USER} ${CKAN_DATASTORE_POSTGRES_DB} | ||
# Database Initialization | ||
ckan -c test-core-circle-ci.ini datastore set-permissions | psql --host=ckan-postgres --username=ckan | ||
ckan -c test-core-circle-ci.ini db init | ||
install_deps: &install_deps | ||
run: | | ||
# OS Dependencies | ||
apt update | ||
case $CIRCLE_NODE_INDEX in | ||
$NODE_TESTS_CONTAINER) | ||
curl -sL https://deb.nodesource.com/setup_10.x | bash - | ||
apt install -y nodejs | ||
npm install mocha-phantomjs@3.5.0 phantomjs@~1.9.1 | ||
;; | ||
esac | ||
apt install -y postgresql-client solr-jetty openjdk-8-jdk | ||
run_tests: &run_tests | ||
# Tests Backend, split across containers by segments | ||
run: | | ||
mkdir -p ~/junit | ||
case $CIRCLE_NODE_INDEX in | ||
0) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 1 | ||
;; | ||
1) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 2 | ||
;; | ||
2) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 3 | ||
;; | ||
3) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 4 | ||
;; | ||
esac | ||
# Tests Frontend, only in one container | ||
start_test_server: &start_test_server | ||
run: | ||
command: | | ||
case $CIRCLE_NODE_INDEX in | ||
$NODE_TESTS_CONTAINER) ckan -c test-core-circle-ci.ini run | ||
;; | ||
esac | ||
background: true | ||
run_front_tests: &run_front_tests | ||
run: | ||
command: | | ||
case $CIRCLE_NODE_INDEX in | ||
$NODE_TESTS_CONTAINER) | ||
sleep 5 | ||
/root/project/node_modules/mocha-phantomjs/bin/mocha-phantomjs \ | ||
http://localhost:5000/base/test/index.html | ||
;; | ||
esac | ||
ckan_env: &ckan_env | ||
environment: | ||
CKAN_DATASTORE_POSTGRES_DB: datastore_test | ||
CKAN_DATASTORE_POSTGRES_READ_USER: datastore_read | ||
CKAN_DATASTORE_POSTGRES_READ_PWD: pass | ||
CKAN_DATASTORE_POSTGRES_WRITE_USER: datastore_write | ||
CKAN_DATASTORE_POSTGRES_WRITE_PWD: pass | ||
CKAN_POSTGRES_DB: ckan_test | ||
CKAN_POSTGRES_USER: ckan_default | ||
CKAN_POSTGRES_PWD: pass | ||
PGPASSWORD: ckan | ||
NODE_TESTS_CONTAINER: 2 | ||
PYTEST_COMMON_OPTIONS: -v --ckan-ini=test-core-circle-ci.ini --cov=ckan --cov=ckanext --junitxml=/root/junit/junit.xml --test-group-count 4 --test-group-random-seed 1 | ||
pg_image: &pg_image | ||
image: postgres:10 | ||
environment: | ||
POSTGRES_USER: ckan | ||
POSTGRES_PASSWORD: ckan | ||
name: ckan-postgres | ||
|
||
redis_image: &redis_image | ||
image: redis:3 | ||
name: ckan-redis | ||
jobs: | ||
test: | ||
test-python-2: | ||
docker: | ||
- image: python:2-stretch | ||
environment: | ||
CKAN_DATASTORE_POSTGRES_DB: datastore_test | ||
CKAN_DATASTORE_POSTGRES_READ_USER: datastore_read | ||
CKAN_DATASTORE_POSTGRES_READ_PWD: pass | ||
CKAN_DATASTORE_POSTGRES_WRITE_USER: datastore_write | ||
CKAN_DATASTORE_POSTGRES_WRITE_PWD: pass | ||
CKAN_POSTGRES_DB: ckan_test | ||
CKAN_POSTGRES_USER: ckan_default | ||
CKAN_POSTGRES_PWD: pass | ||
PGPASSWORD: ckan | ||
NODE_TESTS_CONTAINER: 2 | ||
PYTEST_COMMON_OPTIONS: -v --ckan-ini=test-core-circle-ci.ini --cov=ckan --cov=ckanext --junitxml=/root/junit/junit.xml --test-group-count 4 --test-group-random-seed 1 | ||
- image: postgres:10 | ||
environment: | ||
POSTGRES_USER: ckan | ||
POSTGRES_PASSWORD: ckan | ||
name: ckan-postgres | ||
- image: redis:3 | ||
name: ckan-redis | ||
<<: *ckan_env | ||
- <<: *pg_image | ||
- <<: *redis_image | ||
|
||
parallelism: 4 | ||
|
||
steps: | ||
- checkout | ||
|
||
- <<: *install_deps | ||
- run: | | ||
# OS Dependencies | ||
apt update | ||
case $CIRCLE_NODE_INDEX in | ||
$NODE_TESTS_CONTAINER) | ||
curl -sL https://deb.nodesource.com/setup_10.x | bash - | ||
apt install -y nodejs | ||
npm install mocha-phantomjs@3.5.0 phantomjs@~1.9.1 | ||
;; | ||
esac | ||
apt install -y postgresql-client solr-jetty openjdk-8-jdk | ||
# Python Dependencies | ||
pip install -r requirement-setuptools.txt | ||
pip install -r requirements-py2.txt | ||
pip install -r dev-requirements.txt | ||
python setup.py develop | ||
- <<: *init_environment | ||
- <<: *run_tests | ||
- store_test_results: | ||
path: ~/junit | ||
- <<: *start_test_server | ||
- <<: *run_front_tests | ||
test-python-3: | ||
docker: | ||
- image: python:3-stretch | ||
<<: *ckan_env | ||
- <<: *pg_image | ||
- <<: *redis_image | ||
|
||
# SOLR config | ||
cp ~/project/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml | ||
service jetty9 restart || true # erroring out but does seem to work | ||
parallelism: 4 | ||
|
||
# Database Creation | ||
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_POSTGRES_USER} WITH PASSWORD '${CKAN_POSTGRES_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;" | ||
createdb --encoding=utf-8 --host=ckan-postgres --username=ckan --owner=${CKAN_POSTGRES_USER} ${CKAN_POSTGRES_DB} | ||
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_DATASTORE_POSTGRES_READ_USER} WITH PASSWORD '${CKAN_DATASTORE_POSTGRES_READ_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;" | ||
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_DATASTORE_POSTGRES_WRITE_USER} WITH PASSWORD '${CKAN_DATASTORE_POSTGRES_WRITE_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;" | ||
createdb --encoding=utf-8 --host=ckan-postgres --username=ckan --owner=${CKAN_DATASTORE_POSTGRES_WRITE_USER} ${CKAN_DATASTORE_POSTGRES_DB} | ||
steps: | ||
- checkout | ||
|
||
# Database Initialization | ||
paster datastore -c test-core-circle-ci.ini set-permissions | psql --host=ckan-postgres --username=ckan | ||
paster db init -c test-core-circle-ci.ini | ||
- <<: *install_deps | ||
- run: | | ||
# Python Dependencies | ||
pip install -r requirement-setuptools.txt | ||
pip install -r requirements.txt | ||
pip install -r dev-requirements.txt | ||
python setup.py develop | ||
- <<: *init_environment | ||
|
||
# Tests Backend, split across containers by segments | ||
- run: | | ||
mkdir -p ~/junit | ||
case $CIRCLE_NODE_INDEX in | ||
0) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 1 | ||
;; | ||
1) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 2 | ||
;; | ||
2) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 3 | ||
;; | ||
3) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 4 | ||
;; | ||
esac | ||
- <<: *run_tests | ||
- store_test_results: | ||
path: ~/junit | ||
|
||
# Tests Frontend, only in one container | ||
- run: | ||
command: | | ||
case $CIRCLE_NODE_INDEX in | ||
$NODE_TESTS_CONTAINER) paster serve test-core-circle-ci.ini | ||
;; | ||
esac | ||
background: true | ||
- run: | ||
command: | | ||
case $CIRCLE_NODE_INDEX in | ||
$NODE_TESTS_CONTAINER) | ||
sleep 5 | ||
/root/project/node_modules/mocha-phantomjs/bin/mocha-phantomjs \ | ||
http://localhost:5000/base/test/index.html | ||
;; | ||
esac | ||
- <<: *start_test_server | ||
- <<: *run_front_tests | ||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- test | ||
- test-python-2 | ||
- test-python-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.