-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from LD4P/travis
setup travis-ci to run
- Loading branch information
Showing
13 changed files
with
146 additions
and
294 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
language: ruby | ||
sudo: required | ||
dist: trusty | ||
|
||
addons: | ||
chrome: stable | ||
cache: | ||
bundler: true | ||
|
||
before_install: | ||
- gem update --system | ||
- gem install bundler | ||
- google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 http://localhost & | ||
|
||
rvm: | ||
- 2.4.6 | ||
- 2.5.5 | ||
- 2.6.3 | ||
|
||
env: | ||
global: | ||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true | ||
- ENGINE_CART_RAILS_OPTIONS='--skip-git --skip-bundle --skip-listen --skip-spring --skip-yarn --skip-keeps --skip-action-cable --skip-coffee --skip-puma --skip-test' | ||
# Travis should check every minor version in a range of supported versions, because | ||
# rails does not follow sem-ver conventions, see http://guides.rubyonrails.org/maintenance_policy.html | ||
# It should be sufficient to test only the latest of the patch versions for a minor version, they | ||
# should be compatible across patch versions (only bug fixes are released in patch versions). | ||
matrix: | ||
- "RAILS_VERSION=5.1.7" | ||
- "RAILS_VERSION=5.2.3" | ||
|
||
services: | ||
- redis-server | ||
before_script: | ||
- jdk_switcher use oraclejdk8 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,47 @@ | ||
# frozen_string_literal: true | ||
require 'spec_helper' | ||
|
||
RSpec.describe QaServer do | ||
# rubocop:disable RSpec/MessageChain | ||
let(:timezone_name) { 'Eastern Time (US & Canada)' } | ||
describe '.current_time' do | ||
before do | ||
allow(QaServer).to receive_message_chain(:config, :preferred_time_zone_name).and_return('Eastern Time (US & Canada)') | ||
allow(Time).to receive(:now).and_return(DateTime.parse('2019-12-11 05:00:00 -0500')) | ||
allow(described_class).to receive_message_chain(:config, :preferred_time_zone_name).and_return(timezone_name) | ||
allow(Time).to receive(:now).and_return(DateTime.parse('2019-12-11 05:00:00 -0500').in_time_zone(timezone_name)) | ||
end | ||
|
||
it 'returns the time in the preferred time zone' do | ||
puts 'Running QaServer.current_time spec' | ||
expect(described_class.current_time.zone).to eq 'EST' | ||
end | ||
end | ||
|
||
|
||
describe '.monitoring_expires_at' do | ||
before do | ||
allow(QaServer).to receive_message_chain(:config, :hour_offset_to_run_monitoring_tests).and_return(3) | ||
allow(described_class).to receive_message_chain(:config, :hour_offset_to_run_monitoring_tests).and_return(3) | ||
end | ||
|
||
context 'when current hour is after offset time' do | ||
before do | ||
allow(QaServer).to receive(:current_time).and_return(DateTime.parse('2019-12-11 05:00:00 -0500')) | ||
allow(described_class).to receive(:current_time).and_return(DateTime.parse('2019-12-11 05:00:00 -0500').in_time_zone(timezone_name)) | ||
end | ||
|
||
it 'returns expiration on current date at offset time' do | ||
expect(described_class.monitoring_expires_at).to eq DateTime.parse('2019-12-11 03:00:00 -0500') | ||
puts 'Running QaServer.monitoring_expires_at when current hour is after offset time spec' | ||
expect(described_class.monitoring_expires_at).to eq DateTime.parse('2019-12-11 03:00:00 -0500').in_time_zone(timezone_name) | ||
end | ||
end | ||
|
||
context 'when current hour is before offset time' do | ||
before do | ||
allow(QaServer).to receive(:current_time).and_return(DateTime.parse('2019-12-11 01:00:00 -0500')) | ||
allow(described_class).to receive(:current_time).and_return(DateTime.parse('2019-12-11 01:00:00 -0500').in_time_zone(timezone_name)) | ||
end | ||
|
||
it 'returns expiration on previous date at offset time' do | ||
expect(described_class.monitoring_expires_at).to eq DateTime.parse('2019-12-10 03:00:00 -0500') | ||
puts 'Running QaServer.monitoring_expires_at when current hour is before offset time spec' | ||
expect(described_class.monitoring_expires_at).to eq DateTime.parse('2019-12-10 03:00:00 -0500').in_time_zone(timezone_name) | ||
end | ||
end | ||
end | ||
# rubocop:enable RSpec/MessageChain | ||
end |
Oops, something went wrong.