minitest-optional_retry 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c3ed2d33627c272fbe5e2b2d9359ef0d4825825c
4
+ data.tar.gz: 8a973ce5cb7387b48f10d48b5b5e645819a83ad6
5
+ SHA512:
6
+ metadata.gz: c9a9fe480ce8d3ebf0aabf50272dada2dcc2e16d1fe425f41f37d8d5062c020c40cbb10dbd150155539ae8230cfa4678e11948e58adc1f7ff5d95555627f7d10
7
+ data.tar.gz: 9c6cc58b824a395c4e6abc0e3f094933a14cf5f59e30e390ab3ce3366cc839296c6f7d38367128203b131b0484bc752e6f7260d9a8e652bc3217b0251eb339d2
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'rake'
6
+
7
+ gem "codeclimate-test-reporter", group: :test, require: nil
@@ -0,0 +1,31 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minitest-optional_retry (0.0.1)
5
+ minitest (~> 5.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ codeclimate-test-reporter (0.4.8)
11
+ simplecov (>= 0.7.1, < 1.0.0)
12
+ docile (1.1.5)
13
+ json (1.8.3)
14
+ minitest (5.8.3)
15
+ rake (10.4.2)
16
+ simplecov (0.11.1)
17
+ docile (~> 1.1.0)
18
+ json (~> 1.8)
19
+ simplecov-html (~> 0.10.0)
20
+ simplecov-html (0.10.0)
21
+
22
+ PLATFORMS
23
+ ruby
24
+
25
+ DEPENDENCIES
26
+ codeclimate-test-reporter
27
+ minitest-optional_retry!
28
+ rake
29
+
30
+ BUNDLED WITH
31
+ 1.10.6
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2014 Appfolio Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,28 @@
1
+ [![Build Status](https://travis-ci.org/appfolio/minitest-optional_retry.png)](https://travis-ci.org/appfolio/minitest-optional_retry)
2
+ [![Code Climate](https://codeclimate.com/github/appfolio/minitest-optional_retry/badges/gpa.svg)](https://codeclimate.com/github/appfolio/minitest-optional_retry)
3
+ [![Test Coverage](https://codeclimate.com/github/appfolio/minitest-optional_retry/badges/coverage.svg)](https://codeclimate.com/github/appfolio/minitest-optional_retry/coverage)
4
+ [![Gem Version](https://badge.fury.io/rb/minitest-optional_retry.svg)](http://badge.fury.io/rb/minitest-optional_retry)
5
+ # minitest-optional_retry
6
+
7
+ This plugin extends minitest to automatically rerun failed tests up to twice
8
+ more. If a subsequent run passes, the suite as a whole will pass. This is useful
9
+ to recover from flaky tests.
10
+
11
+ ##Usage
12
+
13
+ In your Gemfile:
14
+ `gem 'minitest-optional_retry'`
15
+
16
+ Simpy include the main module in the test classes you want to automatically
17
+ retry e.g.:
18
+
19
+ ```
20
+ require 'minitest-optional_retry'
21
+ class ArticleTest < ActiveSupport::TestCase
22
+ extend Minitest::OptionalRetry
23
+ end
24
+ ```
25
+
26
+ ##Notes
27
+ If a test ends up failing all 3 of its runs, the reported failure will be the
28
+ failure of the first run.
@@ -0,0 +1,23 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ begin
5
+ Bundler.setup(:default, :development)
6
+ rescue Bundler::BundlerError => e
7
+ $stderr.puts e.message
8
+ $stderr.puts 'Run `bundle install` to install missing gems'
9
+ exit e.status_code
10
+ end
11
+
12
+ require 'rake'
13
+ require 'rake/testtask'
14
+
15
+ namespace :test do
16
+ Rake::TestTask.new(:all) do |test|
17
+ test.libs << 'lib' << 'test'
18
+ test.pattern = 'test/**/*_test.rb'
19
+ test.verbose = true
20
+ end
21
+ end
22
+
23
+ task :default => 'test:all'
@@ -0,0 +1 @@
1
+ require 'minitest/optional_retry'
@@ -0,0 +1,15 @@
1
+ require 'minitest/autorun'
2
+
3
+ module Minitest
4
+ module OptionalRetry
5
+ def run_one_method(klass, method_name, reporter)
6
+ report_result = nil
7
+ 3.times do
8
+ result = Minitest.run_one_method(klass, method_name)
9
+ report_result ||= result
10
+ (report_result = result) and break if result.passed?
11
+ end
12
+ reporter.record(report_result)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ module Minitest
2
+ module OptionalRetry
3
+ VERSION = '0.0.2'.freeze
4
+ end
5
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'minitest/optional_retry/version'
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = 'minitest-optional_retry'
8
+ s.version = Minitest::OptionalRetry::VERSION
9
+ s.platform = Gem::Platform::RUBY
10
+ s.authors = ['AppFolio']
11
+ s.email = 'dev@appfolio.com'
12
+ s.description = 'Rerun failing minitest tests.'
13
+ s.summary = s.description
14
+ s.homepage = 'http://github.com/appfolio/minitest-optional_retry'
15
+ s.licenses = ['MIT']
16
+
17
+ s.files = Dir['**/*'].reject{ |f| f[%r{^pkg/}] || f[%r{^test/}] }
18
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ s.require_paths = ['lib']
20
+ s.add_dependency('minitest', ['~> 5.0'])
21
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: minitest-optional_retry
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - AppFolio
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ description: Rerun failing minitest tests.
28
+ email: dev@appfolio.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - Gemfile
34
+ - Gemfile.lock
35
+ - LICENSE
36
+ - README.md
37
+ - Rakefile
38
+ - lib/minitest-optional_retry.rb
39
+ - lib/minitest/optional_retry.rb
40
+ - lib/minitest/optional_retry/version.rb
41
+ - minitest-optional_retry.gemspec
42
+ homepage: http://github.com/appfolio/minitest-optional_retry
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.4.8
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Rerun failing minitest tests.
66
+ test_files: []
67
+ has_rdoc: