semaphore_cucumber_booster_config 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6b8d33fd48eb00a96b749acb32585a5bd05de1c
|
4
|
+
data.tar.gz: 3baab4ab00648226e77fb3101cca6a0a6b0ed6e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 009a659093db987b2bca44e8f536d052b0ca8945d3c1bdc2afd8fd35d21842ce4afbb4ad9699c99a2836238a21505eff0d726b6ab5896377f364e1a2639384e8
|
7
|
+
data.tar.gz: 545195e8bec821d38bb74fc6dc55a7cafe35e3ecb1d6c87a2092b74de55e32bcd26fec43bee837a5ed2fc006343c32f40420428ec2c7f67fac52fd3acff0da23
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# Cucumber Booster Config
|
2
2
|
|
3
|
-
[![Build
|
4
|
-
Status](https://semaphoreci.com/api/v1/projects/b5ad1293-4dd1-425d-8c00-b42ceca09c75/527737/badge.svg)](https://semaphoreci.com/renderedtext/cucumber_booster_config)
|
3
|
+
[![Build Status](https://semaphoreci.com/api/v1/projects/b5ad1293-4dd1-425d-8c00-b42ceca09c75/527737/badge.svg)](https://semaphoreci.com/renderedtext/cucumber_booster_config)
|
5
4
|
|
6
5
|
Injects additional configuration for Cucumber so that it outputs JSON suitable
|
7
6
|
for auto-parallelism without affecting stdout.
|
@@ -11,10 +10,10 @@ for auto-parallelism without affecting stdout.
|
|
11
10
|
Add this line to your application's Gemfile:
|
12
11
|
|
13
12
|
```ruby
|
14
|
-
gem "
|
13
|
+
gem "semaphore_cucumber_booster_config"
|
15
14
|
```
|
16
15
|
|
17
|
-
## Usage
|
16
|
+
## Usage from the CLI
|
18
17
|
|
19
18
|
```
|
20
19
|
$ cucumber-booster-config help inject
|
@@ -46,20 +45,34 @@ default: --format pretty features --profile semaphoreci
|
|
46
45
|
---
|
47
46
|
```
|
48
47
|
|
48
|
+
## Usage from other scripts
|
49
|
+
|
50
|
+
You can invoke the injector script programaticaly too:
|
51
|
+
|
52
|
+
``` ruby
|
53
|
+
current_path = Dir.pwd
|
54
|
+
output_report_path = "/tmp/cucumber_report.json"
|
55
|
+
|
56
|
+
CucumberBoosterConfig::Injection.new(current_path, output_report_path).run
|
57
|
+
```
|
58
|
+
|
49
59
|
## Development
|
50
60
|
|
51
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
61
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
62
|
+
`bundle exec rspec` to run the tests. You can also run `bin/console` for an
|
63
|
+
interactive prompt that will allow you to experiment.
|
52
64
|
|
53
65
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
54
66
|
|
55
67
|
### How to release a new version
|
56
68
|
|
57
|
-
|
58
|
-
|
69
|
+
Bump version number in `lib/cucumber_booster_config/version.rb`, commit and
|
70
|
+
push your changes.
|
59
71
|
|
60
|
-
Semaphore is currently configured to push new versions to
|
61
|
-
If version hasn't changed,
|
72
|
+
Semaphore is currently configured to push new versions to Rubygems.
|
73
|
+
If version hasn't changed, Rubygems will simply ignore the update.
|
62
74
|
|
63
75
|
## Contributing
|
64
76
|
|
65
|
-
Bug reports and pull requests are welcome on GitHub at
|
77
|
+
Bug reports and pull requests are welcome on GitHub at
|
78
|
+
https://github.com/renderedtext/cucumber_booster_config.
|
@@ -2,11 +2,16 @@ require "thor"
|
|
2
2
|
|
3
3
|
module CucumberBoosterConfig
|
4
4
|
class CLI < Thor
|
5
|
+
|
5
6
|
desc "inject PATH", "inject Semaphore's Cucumber configuration in project PATH"
|
6
7
|
option :dry_run, :type => :boolean
|
7
8
|
def inject(path)
|
8
9
|
puts "Running in #{path}"
|
9
|
-
|
10
|
+
|
11
|
+
report_path = "cucumber_report.json"
|
12
|
+
|
13
|
+
Injection.new(path, report_path, :dry_run => options[:dry_run]).run
|
10
14
|
end
|
15
|
+
|
11
16
|
end
|
12
17
|
end
|
@@ -2,7 +2,6 @@ module CucumberBoosterConfig
|
|
2
2
|
|
3
3
|
class CucumberFile
|
4
4
|
|
5
|
-
SEMAPHORE_PROFILE = "semaphoreci: --format json --out=~/cucumber_report.json"
|
6
5
|
DEFAULT_PROFILE = "default: --format pretty --profile semaphoreci features"
|
7
6
|
|
8
7
|
def initialize(path, dry_run)
|
@@ -10,7 +9,7 @@ module CucumberBoosterConfig
|
|
10
9
|
@dry_run = dry_run
|
11
10
|
end
|
12
11
|
|
13
|
-
def configure_for_autoparallelism
|
12
|
+
def configure_for_autoparallelism(report_path)
|
14
13
|
load_file_content
|
15
14
|
|
16
15
|
if dry_run?
|
@@ -20,7 +19,7 @@ module CucumberBoosterConfig
|
|
20
19
|
puts "---"
|
21
20
|
end
|
22
21
|
|
23
|
-
define_semaphore_profile
|
22
|
+
define_semaphore_profile(report_path)
|
24
23
|
include_semaphore_profile
|
25
24
|
|
26
25
|
if dry_run?
|
@@ -48,10 +47,11 @@ module CucumberBoosterConfig
|
|
48
47
|
File.open(@path, "w") { |f| @new_lines.each { |line| f.puts line } }
|
49
48
|
end
|
50
49
|
|
51
|
-
def define_semaphore_profile
|
52
|
-
puts "Inserting Semaphore configuration"
|
50
|
+
def define_semaphore_profile(report_path)
|
51
|
+
puts "Inserting Semaphore configuration for json report"
|
52
|
+
puts "Report path: #{report_path}"
|
53
53
|
|
54
|
-
@new_lines << "
|
54
|
+
@new_lines << "semaphoreci: --format json --out=#{report_path}\n"
|
55
55
|
end
|
56
56
|
|
57
57
|
def include_semaphore_profile
|
@@ -9,8 +9,9 @@ module CucumberBoosterConfig
|
|
9
9
|
"config/cucumber.yml"
|
10
10
|
]
|
11
11
|
|
12
|
-
def initialize(path, options = {})
|
12
|
+
def initialize(path, report_path, options = {})
|
13
13
|
@path = path
|
14
|
+
@report_path = report_path
|
14
15
|
@dry_run = options.fetch(:dry_run, false)
|
15
16
|
end
|
16
17
|
|
@@ -29,7 +30,7 @@ module CucumberBoosterConfig
|
|
29
30
|
|
30
31
|
def run
|
31
32
|
find_profile_files.each do |path|
|
32
|
-
CucumberFile.new(path, @dry_run).configure_for_autoparallelism
|
33
|
+
CucumberFile.new(path, @dry_run).configure_for_autoparallelism(@report_path)
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|