Skip to content

Commit

Permalink
Circle CI (#1593)
Browse files Browse the repository at this point in the history
- Move the code base to CircleCI
- Work on occasionally failing specs
  • Loading branch information
orangewolf authored Aug 29, 2019
1 parent 02566cb commit 236bd5e
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 6 deletions.
69 changes: 69 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
version: 2.1
orbs:
samvera: samvera/circleci-orb@0
jobs:
bundle_lint_test:
parameters:
ruby_version:
type: string
default: 2.5.5
bundler_version:
type: string
default: '2.0.1'
rails_version:
type: string
default: '5.1.6'
solr_config_path:
type: string
fcrepo_version:
type: string
default: '4.7'
solr_port:
type: string
default: '8985'
redis_version:
type: string
default: '4'
docker:
- image: circleci/ruby:<< parameters.ruby_version >>-node-browsers-legacy
- image: ualbertalib/docker-fcrepo4:<< parameters.fcrepo_version>>
environment:
CATALINA_OPTS: "-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
- image: solr:7-alpine
command: bin/solr -cloud -noprompt -f -p <<parameters.solr_port>>
- image: circleci/redis:<<parameters.redis_version>>
- image: circleci/postgres:9.6.2-alpine
parallelism: 4
environment:
RAILS_VERSION: << parameters.rails_version >>
POSTGRES_DB: circle_test
POSTGRES_HOST: 127.0.0.1
POSTGRES_USER: postgres
TEST_DB: circle_test
BUNDLE_PATH: vendor/bundle
COVERALLS_PARALLEL: true
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
RAILS_ENV: test
RACK_ENV: test
FCREPO_TEST_PORT: 8080/fcrepo
SPEC_OPTS: --profile 10 --format RspecJunitFormatter --out /tmp/test-results/rspec.xml --format progress
steps:
- samvera/cached_checkout

- samvera/bundle:
ruby_version: << parameters.ruby_version >>
bundler_version: << parameters.bundler_version >>

- samvera/install_solr_core:
solr_config_path: << parameters.solr_config_path >>
- samvera/rubocop
- run: bundle exec rake db:create db:schema:load zookeeper:upload
- samvera/parallel_rspec
workflows:
ci:
jobs:
- bundle_lint_test:
ruby_version: "2.5.5"
name: "ruby2-5-5"
solr_config_path: 'solr/config'
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
service_name: travis-ci
service_name: circleci
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ group :test do
# rack-test >= 0.71 does not work with older Capybara versions (< 2.17). See #214 for more details
gem 'rack-test', '0.7.0'
gem 'rails-controller-testing'
gem 'rspec_junit_formatter'
gem 'selenium-webdriver'
gem 'webmock'
end
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Hyku, the Hydra-in-a-Box Repository Application

Code:
[![Build Status](https://travis-ci.org/samvera/hyku.svg)](https://travis-ci.org/samvera/hyku)
[![Build Status](https://circleci.com/gh/samvera/hyku.svg?style=svg)](https://circleci.com/gh/samvera/hyku)
[![Coverage Status](https://coveralls.io/repos/samvera/hyku/badge.svg?branch=master&service=github)](https://coveralls.io/github/samvera/hyku?branch=master)
[![Stories in Ready](https://img.shields.io/waffle/label/samvera/hyku/ready.svg)](https://waffle.io/samvera/hyku)

Expand Down
6 changes: 5 additions & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@
end

config.after do
DatabaseCleaner.clean
begin
DatabaseCleaner.clean
rescue NoMethodError
'This can happen which the database is gone, which depends on load order of tests'
end
end
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

# only run aws tests from CI (or w/ `--tag aws`) and only run it on the main repo, since that
# is where the valid aws keys live. TRAVIS_PULL_REQUEST_SLUG is "" when the job is a push job
unless ENV['CI'] &&
unless ENV['TRAVIS'] &&
(ENV['TRAVIS_PULL_REQUEST_SLUG'].match('samvera-labs/hyku') || ENV['TRAVIS_PULL_REQUEST_SLUG'].blank?)
config.filter_run_excluding(aws: true)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/tasks/rake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
end

after(:all) do
Account.find_by(name: 'first').destroy
Account.find_by(name: 'second').destroy
Account.find_by(name: 'first')&.destroy
Account.find_by(name: 'second')&.destroy
end

before do
Expand Down

0 comments on commit 236bd5e

Please sign in to comment.