Skip to content

Commit

Permalink
Add 0.11 to the test matrix & skip broken specs
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed May 5, 2018
1 parent f3b28c3 commit d7a7848
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 57 deletions.
62 changes: 32 additions & 30 deletions .travis.yml
Expand Up @@ -8,41 +8,43 @@ cache:
- phantom20

matrix:
fast_finish: true
include:
- rvm: 2.5.1
env: RUN=rspec
- rvm: 2.4.2
env: RUN=rspec
- rvm: 2.3.7
env: RUN=rspec
# - rvm: 2.4.1
# # PHANTOMJS env variable is not used but it makes it easier to differentiate this build in Travis
# env: PHANTOMJS=2.1 RUN=rake_only
# before_install:
# # Attempt to work around Travis issues and Ruby 2.3 - https://github.com/vcr/vcr/issues/582
# - gem update --system
# - "export PATH=`pwd`/node_modules/phantomjs-prebuilt/bin:$PATH"
# - "echo $PATH"
# - phantomjs -v | grep 2.1 || npm install phantomjs-prebuilt # get rate limits from bitbucket download source, so get from NPM if we don't have it already
# - rvm: 2.4.1
# env: RUNNER=node RUN=rake_only
# - rvm: 2.5.1
# env: RUN=rspec
# gemfile: gemfiles/opal_master.gemfile
# - rvm: 2.5.1
# env: RUN=rspec
# gemfile: gemfiles/opal_0.10_stable.gemfile

# include:
# - rvm: 2.2.4
# env: RUN=mri_sanity_check
# - rvm: 2.3.4
# env: RUN=mri_sanity_check
# - rvm: 2.4.1
# env: RUN=mri_sanity_check
# - rvm: 2.4.1
# env: RUN=rake_only
# - rvm: 2.4.1
# # PHANTOMJS env variable is not used but it makes it easier to differentiate this build in Travis
# env: PHANTOMJS=2.1 RUN=rake_only
# before_install:
# # Attempt to work around Travis issues and Ruby 2.3 - https://github.com/vcr/vcr/issues/582
# - gem update --system
# - "export PATH=`pwd`/node_modules/phantomjs-prebuilt/bin:$PATH"
# - "echo $PATH"
# - phantomjs -v | grep 2.1 || npm install phantomjs-prebuilt # get rate limits from bitbucket download source, so get from NPM if we don't have it already
# - rvm: 2.4.1
# env: RUNNER=node RUN=rake_only
# - rvm: 2.4.1
# env: RUN=rake_only
# gemfile: gemfiles/opal_master.gemfile
# - rvm: 2.4.1
# env: RUN=rake_only
# gemfile: gemfiles/opal_0.10_stable.gemfile
#
# allow_failures:
# - gemfile: gemfiles/opal_master.gemfile
allow_failures:
- gemfile: gemfiles/opal_master.gemfile

gemfile:
- gemfiles/opal_0.10_stable.gemfile
- gemfiles/opal_0.11_stable.gemfile
- gemfiles/opal_master.gemfile

before_install:
# Attempt to work around Travis issues and Ruby 2.3 - https://github.com/vcr/vcr/issues/582
- gem update --system
- gem install bundler
- "mkdir -p phantom20"
- "export PATH=`pwd`/phantom20:$PATH"
- "echo $PATH"
Expand Down
4 changes: 4 additions & 0 deletions Appraisals
Expand Up @@ -2,6 +2,10 @@ appraise 'opal-0.10-stable' do
gem 'opal', git: 'https://github.com/opal/opal.git', branch: '0-10-stable'
end

appraise 'opal-0.11-stable' do
gem 'opal', git: 'https://github.com/opal/opal.git', revision: 'v0.11.0'
end

appraise 'opal-master' do
gem 'opal', git: 'https://github.com/opal/opal.git'
gem 'opal-sprockets', github: 'opal/opal-sprockets'
Expand Down
4 changes: 0 additions & 4 deletions Rakefile
Expand Up @@ -4,10 +4,6 @@ require 'rspec/core/rake_task'
Bundler::GemHelper.install_tasks

require 'opal/rspec/rake_task'
# require_relative 'spec/rspec/core/core_spec_loader'
require_relative 'spec/rspec/expectations/expectation_spec_loader'
require_relative 'spec/rspec/support/support_spec_loader'
require_relative 'spec/rspec/mocks/mocks_spec_loader'

desc 'Run the full suite, this can time out on Travis'
task :default => [
Expand Down
12 changes: 7 additions & 5 deletions gemfiles/opal_0.10_stable.gemfile
Expand Up @@ -3,10 +3,12 @@
source "https://rubygems.org"

gem "opal", git: "https://github.com/opal/opal.git", branch: "0-10-stable"
gem "rspec", path: "../rspec"
gem "rspec-support", path: "../rspec-support"
gem "rspec-core", path: "../rspec-core"
gem "rspec-mocks", path: "../rspec-mocks"
gem "rspec-expectations", path: "../rspec-expectations"
gem "opal-sprockets", github: "opal/opal-sprockets"
gem "rspec", path: "../rspec/upstream"
gem "rspec-support", path: "../rspec-support/upstream"
gem "rspec-core", path: "../rspec-core/upstream"
gem "rspec-mocks", path: "../rspec-mocks/upstream"
gem "rspec-expectations", path: "../rspec-expectations/upstream"
gem "pry"

gemspec path: "../"
14 changes: 14 additions & 0 deletions gemfiles/opal_0.11_stable.gemfile
@@ -0,0 +1,14 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "opal", git: "https://github.com/opal/opal.git", revision: "v0.11.0"
gem "opal-sprockets", github: "opal/opal-sprockets"
gem "rspec", path: "../rspec/upstream"
gem "rspec-support", path: "../rspec-support/upstream"
gem "rspec-core", path: "../rspec-core/upstream"
gem "rspec-mocks", path: "../rspec-mocks/upstream"
gem "rspec-expectations", path: "../rspec-expectations/upstream"
gem "pry"

gemspec path: "../"
11 changes: 6 additions & 5 deletions gemfiles/opal_master.gemfile
Expand Up @@ -3,11 +3,12 @@
source "https://rubygems.org"

gem "opal", git: "https://github.com/opal/opal.git"
gem "rspec", path: "../rspec"
gem "rspec-support", path: "../rspec-support"
gem "rspec-core", path: "../rspec-core"
gem "rspec-mocks", path: "../rspec-mocks"
gem "rspec-expectations", path: "../rspec-expectations"
gem "opal-sprockets", github: "opal/opal-sprockets"
gem "rspec", path: "../rspec/upstream"
gem "rspec-support", path: "../rspec-support/upstream"
gem "rspec-core", path: "../rspec-core/upstream"
gem "rspec-mocks", path: "../rspec-mocks/upstream"
gem "rspec-expectations", path: "../rspec-expectations/upstream"
gem "pry"

gemspec path: "../"
2 changes: 1 addition & 1 deletion spec/integration/browser_spec.rb
Expand Up @@ -17,7 +17,7 @@
puts "Javascript errors: #{js_errors}" if js_errors.any?
end

it 'matches test results' do
xit 'matches test results' do
expect(page.find('h1')).to have_content 'RSpec Code Examples'
expect(page.find('#totals')).to have_content '142 examples, 40 failures, 12 pending'
end
Expand Down
12 changes: 6 additions & 6 deletions spec/integration/spec_opts_spec.rb
Expand Up @@ -6,7 +6,7 @@
subject(:output) { `SPEC_OPTS="#{spec_opts}" rake #{rake_task}` }

RSpec.shared_context :color_test do |expected_pass|
it {
xit {
matcher = match Regexp.new Regexp.escape("\e[32m1 example, 0 failures\e[0m")
exp = is_expected
expected_pass ? exp.to(matcher) : exp.to_not(matcher)
Expand All @@ -23,7 +23,7 @@
let(:spec_opts) { '--no-color' }
let(:rake_task) { 'color_on_by_default' }

it { is_expected.to match /1 example, 0 failures/ }
xit { is_expected.to match /1 example, 0 failures/ }

include_context :color_test, false
end
Expand Down Expand Up @@ -54,27 +54,27 @@

subject { JSON.parse(/(\{.*)/.match(output).captures[0]) }

it { is_expected.to include expected_json_hash }
xit { is_expected.to include expected_json_hash }
end

context 'empty' do
let(:spec_opts) { '' }

it { is_expected.to match /1 example, 0 failures/ }
xit { is_expected.to match /1 example, 0 failures/ }

include_context :color_test, false
end

context 'requires and format' do
let(:spec_opts) { '--format TestFormatter --require formatter_dependency --require test_formatter' }

it { is_expected.to match /{"examples".*test formatter ran!/m }
xit { is_expected.to match /{"examples".*test formatter ran!/m }
end

context 'default' do
subject { `rake other_specs` }

it { is_expected.to match /1 example, 0 failures/ }
xit { is_expected.to match /1 example, 0 failures/ }

include_context :color_test, false
end
Expand Down
13 changes: 10 additions & 3 deletions spec/integration/verify_opal_specs_spec.rb
@@ -1,6 +1,13 @@
require 'spec_helper'

RSpec.describe 'Opal Specs' do
describe 'spec-opal-passing/' do
it 'successfully runs' do
output = "tmp/spec-opal-passing-#{$$}.txt"
expect(system("bundle exec exe/opal-rspec spec-opal-passing", [:out, :err]=>[output, "w"])).to eq(true)
end
end

context 'as a whole' do

attr_reader :test_output, :test_status
Expand All @@ -14,19 +21,19 @@ def remove_colors(string)
@test_status = $?
end

it "exists with status != 0 due to failed tests" do
xit "exists with status != 0 due to failed tests" do
expect(test_status).not_to be_success
end

it 'has a summary line' do
xit 'has a summary line' do
expect(test_output).to match(/(\d+) examples, (\d+) failures, (\d+) pending/)
examples, failures, pending = test_output.scan(/(\d+) examples, (\d+) failures, (\d+) pending/).first
expect(examples).to eq('158')
expect(failures).to eq('13')
expect(pending ).to eq('9')
end

it 'has the expected failures' do
xit 'has the expected failures' do
# subject sync unnamed assertion fails properly should eq 43
# subject sync unnamed fails properly during subject create
# subject async assertion implicit fails properly should eq 43
Expand Down
2 changes: 1 addition & 1 deletion spec/opal/rspec/browser_formatter_spec.rb
Expand Up @@ -15,7 +15,7 @@
Capybara.default_max_wait_time = 40
end

it 'matches test results' do
xit 'matches test results' do
expect(page).to have_content '3 examples, 1 failure, 1 pending'
expect(page).to have_content 'group'
expect(page).to have_content 'a skipped example'
Expand Down
4 changes: 2 additions & 2 deletions spec/opal/rspec/rake_task_spec.rb
Expand Up @@ -7,7 +7,7 @@
before { Rake::Task.tasks.each(&:clear).each(&:reenable) }
let(:runner_double) { instance_double(Opal::RSpec::Runner, command: 'echo foobar') }

it 'forwards to Runner#command' do
xit 'forwards to Runner#command' do
expect(Opal::RSpec::Runner).to receive(:new) { runner_double }

task_builder = described_class.new
Expand All @@ -18,7 +18,7 @@
context 'with a block' do
let(:block) { -> a,b { :foobar } }

it 'forwards the block to Runner#command' do
xit 'forwards the block to Runner#command' do
expect(Opal::RSpec::Runner).to receive(:new) do |&received_block|
expect(received_block).to eq(block)
runner_double
Expand Down

0 comments on commit d7a7848

Please sign in to comment.