Skip to content
Permalink
Browse files

More consistent circle ci env (#3732)

* Remove unnecessary env on Circle CI

This was a workaround for a bundler bug that should no longer be
happening.

* Run tests through bundler

* Pass SIMPLECOV env to docker specs

To more exactly simulate CircleCI environment.

* Remove npm caching
  • Loading branch information...
deivid-rodriguez authored and mrcasals committed Jul 3, 2018
1 parent ed4ae3d commit 93cc67a8e13b577164fbc218e19a0581a417e1f9
Showing with 5 additions and 16 deletions.
  1. +3 −15 .circleci/config.yml
  2. +2 −1 d/rspec
@@ -6,7 +6,6 @@ defaults: &defaults
# latest digest by doing `$ docker pull decidim/decidim:latest-test`.
- image: decidim/decidim@sha256:743a212e757a0c0d4cb85cf99251290864b6d02d1a17aa285d342d0bdcff796b
environment:
BUNDLE_GEMFILE: /app/Gemfile
SIMPLECOV: true
DATABASE_USERNAME: postgres
FAIL_FAST: true
@@ -23,10 +22,6 @@ references:
restore_cache:
keys:
- bundler-dependencies-{{ checksum "Gemfile.lock" }}
restore_npm_cache: &restore_npm_cache
restore_cache:
keys:
- npm-dependencies-{{ checksum "package-lock.json" }}
install_ruby_dependencies: &install_ruby_dependencies
run:
name: Install ruby dependencies
@@ -40,11 +35,6 @@ references:
key: bundler-dependencies-{{ checksum "Gemfile.lock" }}
paths:
- /usr/local/bundle/
save_npm_cache: &save_npm_cache
save_cache:
key: npm-dependencies-{{ checksum "package-lock.json" }}
paths:
- node_modules
wait_for_db: &wait_for_db
run:
name: Wait for db
@@ -76,7 +66,7 @@ references:
run_rspec: &run_rspec
run:
name: Run RSpec
command: mkdir ~/rspec && cd decidim-$CIRCLE_JOB && rake
command: mkdir ~/rspec && cd decidim-$CIRCLE_JOB && bundle exec rake
format_test_coverage: &format_test_coverage
run:
name: Format CodeClimate test coverage
@@ -93,11 +83,9 @@ jobs:
steps:
- checkout
- *restore_ruby_cache
- *restore_npm_cache
- *install_ruby_dependencies
- *install_npm_dependencies
- *save_ruby_cache
- *save_npm_cache
- *wait_for_db
- run:
name: Generate test app
@@ -217,7 +205,7 @@ jobs:
<<: *defaults
steps:
- *attach_workspace
- *restore_npm_cache
- *install_npm_dependencies
- *restore_ruby_cache
- *wait_for_db
- *create_test_db
@@ -260,7 +248,7 @@ jobs:
<<: *defaults
steps:
- *attach_workspace
- *restore_npm_cache
- *install_npm_dependencies
- run:
name: Run main folder lint & tests
command: npm run test:ci
@@ -1,9 +1,10 @@
#!/bin/bash

fail_fast=${FAIL_FAST:-false}
simplecov=${SIMPLECOV:-true}

args=("$@")

printf -v cmd '%q ' "${args[@]}"

docker-compose run --rm -e "FAIL_FAST=$fail_fast" decidim bash -c "bin/rspec $cmd"
docker-compose run --rm -e "FAIL_FAST=$fail_fast" -e "SIMPLECOV=$simplecov" decidim bash -c "bin/rspec $cmd"

0 comments on commit 93cc67a

Please sign in to comment.
You can’t perform that action at this time.