spinach-rerun-reporter 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -4
- data/lib/spinach-rerun-reporter/version.rb +1 -1
- data/spinach-rerun-reporter.gemspec +1 -1
- data/tasks/spinach_rerun.rake +53 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87cd126e64c9c375d713c7377cc4ff6113a62a37
|
4
|
+
data.tar.gz: d410ce8618eea1f422d05ac7257e7c48cdcb087d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 786f1129777e20f0a0cd7f334c97083e2ff0e5f6136e811535428993fb722235d53d36760653ed4a0721d9ca59839984c3ae880adde8fec1b7b4914124531f0a
|
7
|
+
data.tar.gz: 6a22c0097bac5048a58691ed835857acaf79cefff626b400f5b0742f73d559aee68b1a1a037d3fc22e641705d03e0191f84024f29a3175a11695e375a7ce08a6
|
data/README.md
CHANGED
@@ -6,10 +6,8 @@ file all failed scenarios in order to re-execute them.
|
|
6
6
|
|
7
7
|
## Status
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
> *Note*: You're reading the documentation for the next release, which should be 0.1.0
|
9
|
+
![Gem](https://img.shields.io/gem/v/spinach-rerun-reporter.svg)
|
10
|
+
![Depfu](https://badges.depfu.com/badges/5dfc158e963346012b4c0fe02786c993/count.svg)
|
13
11
|
|
14
12
|
|
15
13
|
## Installation
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
|
|
19
19
|
## GEM
|
20
20
|
#
|
21
21
|
s.require_paths = %w[lib]
|
22
|
-
s.files = `git ls-files -z -- lib/* LICENSE README.md spinach-rerun-reporter.gemspec`.split("\x0")
|
22
|
+
s.files = `git ls-files -z -- lib/* tasks/* LICENSE README.md spinach-rerun-reporter.gemspec`.split("\x0")
|
23
23
|
s.extra_rdoc_files = %w[README.md LICENSE]
|
24
24
|
s.required_ruby_version = '> 2.0'
|
25
25
|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# This file is based on https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/spinach.rake
|
2
|
+
# Authored by Kamil Trzcinski <ayufan@ayufan.eu>
|
3
|
+
require 'colorize'
|
4
|
+
|
5
|
+
namespace :spinach do
|
6
|
+
desc 'run spinach tests with rerun reporter'
|
7
|
+
task :rerun do
|
8
|
+
run_spinach_tests
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def tags
|
13
|
+
ENV['SPINACH_RERUN_TAGS']
|
14
|
+
end
|
15
|
+
|
16
|
+
def rerun_file
|
17
|
+
ENV['SPINACH_RERUN_FILE'] || 'tmp/spinach-rerun.txt'
|
18
|
+
end
|
19
|
+
|
20
|
+
def retry_count
|
21
|
+
ENV['SPINACH_RERUN_RETRY_COUNT'] ? ENV['SPINACH_RERUN_RETRY_COUNT'].to_i : 3
|
22
|
+
end
|
23
|
+
|
24
|
+
def prepend_cmd
|
25
|
+
ENV['SPINACH_RERUN_PREPEND_CMD'] || nil
|
26
|
+
end
|
27
|
+
|
28
|
+
def run_command(cmd)
|
29
|
+
env = {'RAILS_ENV' => 'test', 'SPINACH_RERUN_FILE' => rerun_file}
|
30
|
+
system(env, *cmd.compact)
|
31
|
+
end
|
32
|
+
|
33
|
+
def run_spinach(args)
|
34
|
+
run_command([prepend_cmd] + %w[spinach -r rerun] + args)
|
35
|
+
end
|
36
|
+
|
37
|
+
def run_spinach_tests
|
38
|
+
success = run_spinach(tags ? %W[--tags #{tags}] : [nil])
|
39
|
+
|
40
|
+
retry_count.times do
|
41
|
+
break if success
|
42
|
+
break unless File.exist?(rerun_file)
|
43
|
+
|
44
|
+
tests = File.foreach(rerun_file).map(&:chomp)
|
45
|
+
puts ''
|
46
|
+
puts "Spinach tests for #{tags}: Retrying tests... #{tests}".red
|
47
|
+
puts ''
|
48
|
+
sleep(3)
|
49
|
+
success = run_spinach(tests)
|
50
|
+
end
|
51
|
+
|
52
|
+
raise("spinach tests for #{tags} failed!".red) unless success
|
53
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spinach-rerun-reporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spinach
|
@@ -47,6 +47,7 @@ files:
|
|
47
47
|
- lib/spinach-rerun-reporter/version.rb
|
48
48
|
- lib/spinach/reporter/rerun.rb
|
49
49
|
- spinach-rerun-reporter.gemspec
|
50
|
+
- tasks/spinach_rerun.rake
|
50
51
|
homepage: https://github.com/javierav/spinach-rerun-reporter
|
51
52
|
licenses:
|
52
53
|
- MIT
|