diff --git a/.travis.yml b/.travis.yml index c6ba2f7..fe90cb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,30 @@ +git: + depth: 1 +branches: + only: + - wip_mlt +addons: + chrome: stable +env: + global: + - secure: "d0qFbD7GhsyaLgsulFD5tMMFHyuqAn8LrjC5DVOK6OvHx7T0Z9cjetzxxm+h+Gz5eAUfclS8d5P8iJQGRpVgwF+6EBoyLDAvJTCt7+N0FTTqsJwupQynfr3wtnqTbqQIsgAHB9kmz3WPoPztLbragOiFSZLMAkSOj3qKtpVwpeEmaXZe2r+dafrwWE7uFt+hnnLCxmSznGE+c8habCi+PTwtCmbUDkf4l68Nmvn7+iE11b9RVVRNGLNdfxQo85LL57dN/6midA3pL8djBkokPTjHrchA4mg1z9vR0KjW6iA6HdkSq/EtFRTVrFyJqHwuO0u8WIIQWlxmutEBLNpoTsgqQFxwUhVl3ymy/xZQWHCHCXf/+N+zitV8OWQrqx+vgb81QbHjsi1wGpMbOWODEaSfsLqQTnTeuhlFMmMWM97+PaPorou54x69QAO2wT5ip8NZBSv0l0p3/NS3ShEw2h6JuRmH3NTUH2dN5mMKkwGm3aJQNWOPYc+SNbW6p6+P75rzLisdHkAlV/hqh6K3dOVlau3/4H11mLI2mMEwIxrm+wbhhKfu/gyo6/YV6VoojF1Alqo14P5b9Vmm8V4+sP6m8DPEyi5AQtqXi+Rw+GKeYHPIeGIUY5vs0PzB4lG3eYKh/1bLWHtaXMXVW3fCKQnpYNGl3id/uzmKkRXSajA=" language: ruby rvm: -# - 2.1.10 - - 2.2.6 - - 2.3.3 - 2.4.4 - 2.5.1 - - jruby-9.1.13.0 + - jruby-9.2.0.0 +cache: + bundler: true + directories: + - /home/travis/.rvm/ + - /home/travis/.chromedriver-helper/ +before_install: + - openssl aes-256-cbc -K $encrypted_1be6b4981a28_key -iv $encrypted_1be6b4981a28_iv -in gcs_credentials.json.enc -out gcs_credentials.json -d +before_script: + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - chmod +x ./cc-test-reporter + - ./cc-test-reporter before-build script: "bundle exec rspec spec" +after_script: + - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT diff --git a/Gemfile b/Gemfile index 203543c..8b06729 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,8 @@ group :test do gem 'simplecov', :require => false gem 'selenium-webdriver' gem 'chromedriver-helper' if ENV['CI'] - gem 'capybara-screenshot' + gem 'capybara-screenshot', github: 'mlt/capybara-screenshot', branch: 'gcs' + gem 'google-cloud-storage' if ENV['CI'] end diff --git a/README.md b/README.md index 2f1a8c7..2d5647b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Tabulatr2 (modified) +[![Build Status](https://travis-ci.com/mlt/tabulatr2.svg?branch=wip_mlt)](https://travis-ci.com/mlt/tabulatr2) +[![Maintainability](https://api.codeclimate.com/v1/badges/ba31d13164c4f5c73177/maintainability)](https://codeclimate.com/github/mlt/tabulatr2/maintainability) +[![Test Coverage](https://api.codeclimate.com/v1/badges/ba31d13164c4f5c73177/test_coverage)](https://codeclimate.com/github/mlt/tabulatr2/test_coverage) This is a work-in-progress branch with my (mlt) modifications on top of original tabulatr2 that have not been merged (yet?). This branch is mostly for my own amusement but you may find it useful. diff --git a/gcs_credentials.json.enc b/gcs_credentials.json.enc new file mode 100644 index 0000000..7f43097 Binary files /dev/null and b/gcs_credentials.json.enc differ diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index ab2485f..19fdc93 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -32,6 +32,18 @@ "screenshot_#{example.description.gsub(' ', '-').gsub(/^.*\/spec\//,'')}" end +if ENV['CI'] + Capybara::Screenshot.gcs_configuration = { + credentials: 'gcs_credentials.json', + bucket_name: "jksdhgjkdhgjkd", + } + + Capybara::Screenshot.gcs_object_configuration = { + content_encoding: 'gzip', + acl: 'public_read' + } +end + # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("../support/**/*.rb")].each { |f| require f }