Skip to content

Commit

Permalink
test: enable parallel circleci builds (#435)
Browse files Browse the repository at this point in the history
* test: enable parallel circleci builds

* fix: infer parallelism in circle.yml

* fix: expose circle node index to before-script.sh

* fix: add parallel: true to test overrides in circle.yml
  • Loading branch information
zacharygolba authored Oct 3, 2016
1 parent c8f05ee commit eaeb9eb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
8 changes: 0 additions & 8 deletions .circleci-matrix.yml

This file was deleted.

9 changes: 4 additions & 5 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
test:
override:
- ~/.local/bin/circleci-matrix
- bash -e scripts/circle/before-script.sh:
parallel: true
- npm test && npm run test:codecov:
parallel: true
machine:
node:
version: 6
environment:
NODE_ENV: test
DATABASE_USERNAME: ubuntu
dependencies:
pre:
- mkdir -p ~/.local/bin
- curl -fsSL https://git.io/v2Ifs -o ~/.local/bin/circleci-matrix
- chmod +x ~/.local/bin/circleci-matrix
override:
- bash -e scripts/circle/install.sh
16 changes: 12 additions & 4 deletions scripts/circle/before-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@
DROP_DATABASE="DROP DATABASE IF EXISTS lux_test;"
CREATE_DATABASE="CREATE DATABASE lux_test;"

case "$DATABASE_DRIVER" in
pg )
case $CIRCLE_NODE_INDEX in
0)
export DATABASE_DRIVER="pg"

psql -c "$DROP_DATABASE" -U postgres
psql -c "$CREATE_DATABASE" -U postgres
;;

mysql2 )
1)
export DATABASE_DRIVER="mysql2"

mysql -e "$DROP_DATABASE"
mysql -e "$CREATE_DATABASE"
;;

sqlite3 )
2)
export DATABASE_DRIVER="sqlite3"

rm -rf test/test-app/db/lux_test_test.sqlite
touch test/test-app/db/lux_test_test.sqlite
;;
esac

echo "ENV: DATABASE_DRIVER=$DATABASE_DRIVER"

0 comments on commit eaeb9eb

Please sign in to comment.