Skip to content

Commit b83caeb

Browse files
andrcunsbaev
authored andcommitted
rft rake tasks and add test coverage (via #24)
1 parent 8ba5d75 commit b83caeb

File tree

23 files changed

+301
-171
lines changed

23 files changed

+301
-171
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Build
22

33
on:
44
pull_request:
@@ -15,6 +15,7 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@master
18+
1819
- name: Set up Ruby 2.6
1920
uses: actions/setup-ruby@v1
2021
with:
@@ -29,4 +30,10 @@ jobs:
2930
run: bundle exec rake rubocop
3031

3132
- name: Test
32-
run: bundle exec rake test
33+
run: bundle exec rake test_with_coverage
34+
env:
35+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
36+
CI: true
37+
CI_NAME: github-ci
38+
CI_PULL_REQUEST: ${{ github.event.number }}
39+
GIT_ID: ${{ github.event.after }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ pkg
1515
reports
1616
.allure
1717
doc
18+
coverage

.simplecov

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# frozen_string_literal: true
2+
3+
return unless ENV["COVERAGE"] && !ENV["COV_MERGE"]
4+
5+
SimpleCov.start do
6+
add_filter ["/spec/", "/fixture/", "/features/"]
7+
minimum_coverage 95
8+
end

Gemfile.lock

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ PATH
1515
json (>= 1.8, < 3)
1616
mime-types (~> 3.3)
1717
require_all (~> 2.0)
18-
rubyzip (>= 1.2, < 3.0)
1918
uuid (~> 2.3)
2019

2120
GEM
@@ -26,6 +25,13 @@ GEM
2625
backports (3.15.0)
2726
builder (3.2.3)
2827
coderay (1.1.2)
28+
colorize (0.8.1)
29+
coveralls (0.8.23)
30+
json (>= 1.8, < 3)
31+
simplecov (~> 0.16.1)
32+
term-ansicolor (~> 1.3)
33+
thor (>= 0.19.4, < 2.0)
34+
tins (~> 1.6)
2935
cucumber (3.1.2)
3036
builder (>= 2.1.2)
3137
cucumber-core (~> 3.2.0)
@@ -43,6 +49,7 @@ GEM
4349
cucumber-tag_expressions (1.1.1)
4450
cucumber-wire (0.0.1)
4551
diff-lcs (1.3)
52+
docile (1.3.2)
4653
gherkin (5.1.0)
4754
htmlentities (4.3.4)
4855
jaro_winkler (1.5.3)
@@ -67,7 +74,7 @@ GEM
6774
rainbow (3.0.0)
6875
rake (13.0.0)
6976
require_all (2.0.0)
70-
reverse_markdown (1.2.0)
77+
reverse_markdown (1.3.0)
7178
nokogiri
7279
rspec (3.8.0)
7380
rspec-core (~> 3.8.0)
@@ -92,7 +99,11 @@ GEM
9299
rubocop-performance (1.5.0)
93100
rubocop (>= 0.71.0)
94101
ruby-progressbar (1.10.1)
95-
rubyzip (2.0.0)
102+
simplecov (0.16.1)
103+
docile (~> 1.1)
104+
json (>= 1.8, < 3)
105+
simplecov-html (~> 0.10.0)
106+
simplecov-html (0.10.2)
96107
solargraph (0.37.2)
97108
backport (~> 1.1)
98109
bundler (>= 1.17.2)
@@ -106,8 +117,11 @@ GEM
106117
tilt (~> 2.0)
107118
yard (~> 0.9)
108119
systemu (2.6.5)
120+
term-ansicolor (1.7.1)
121+
tins (~> 1.0)
109122
thor (0.20.3)
110-
tilt (2.0.9)
123+
tilt (2.0.10)
124+
tins (1.21.1)
111125
unicode-display_width (1.6.0)
112126
uuid (2.3.9)
113127
macaddr (~> 1.0)
@@ -119,11 +133,14 @@ PLATFORMS
119133
DEPENDENCIES
120134
allure-ruby!
121135
bundler (~> 2.0)
136+
colorize (~> 0.8)
137+
coveralls (~> 0.8)
122138
pry (~> 0.12.2)
123139
rake (~> 13.0)
124140
rspec (~> 3.8)
125141
rubocop (~> 0.74)
126142
rubocop-performance (~> 1.4)
143+
simplecov (~> 0.16)
127144
solargraph (~> 0.35)
128145

129146
BUNDLED WITH

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Allure ruby
22

3-
[![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/allure-framework/allure-ruby/master)
3+
[![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/allure-framework/allure-ruby/master)
4+
![Workflow status](https://github.com/allure-framework/allure-ruby/workflows/Build/badge.svg)
5+
[![Coverage Status](https://coveralls.io/repos/github/allure-framework/allure-ruby/badge.svg?branch=master)](https://coveralls.io/github/allure-framework/allure-ruby?branch=master)
46
Ruby testing framework adaptors for generating allure compatible test reports.
57

68
## allure-ruby-commons

Rakefile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# frozen_string_literal: true
22

3-
require_relative "tasks/test"
4-
require_relative "tasks/release"
3+
require_relative "rake/test"
4+
require_relative "rake/release"
55

6-
desc "Run all tests by default"
7-
task default: :test
6+
task default: "all:test"
87

9-
desc "Build gem files for all projects"
8+
desc "Run rubocop for all adaptors"
9+
task rubocop: "all:rubocop"
10+
11+
desc "Run all tests"
12+
task test: "all:test"
13+
14+
desc "Run all tests and generate SimpleCov report"
15+
task test_with_coverage: "all:test_with_coverage"
16+
17+
desc "Clean gem files from pkg folder"
18+
task clean: "all:clean"
19+
20+
desc "Build ruby gems for all adaptors"
1021
task build: "all:build"
1122

12-
desc "Release all gems to rubygems"
13-
task release: "all:push"
23+
desc "Build and push ruby gems to registry for all adaptors"
24+
task release: "all:release"

allure-cucumber/Rakefile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
# frozen_string_literal: true
22

3-
require "rspec/core/rake_task"
4-
require "rubocop/rake_task"
3+
require_relative "../rake/test"
54

6-
RSpec::Core::RakeTask.new(:test, :tag) do |t, args|
7-
args[:tag].tap do |tag|
8-
t.rspec_opts = "--color --require spec_helper --format documentation #{tag ? "--tag #{tag}" : ''}"
9-
end
10-
end
11-
12-
RuboCop::RakeTask.new(:rubocop) do |task|
13-
task.options = %w[--parallel]
14-
end
5+
TestTasks.add_rspec_task
6+
TestTasks.add_rubocop_task

allure-cucumber/spec/spec_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# frozen_string_literal: true
22

33
require "rspec"
4+
require "simplecov"
45
require "cucumber"
56
require "allure-ruby-commons"
67
require "allure-cucumber"
78
require "digest"
89

10+
SimpleCov.command_name("allure-cucumber")
11+
912
RSpec.shared_context("allure mock") do
1013
let(:lifecycle) { spy("lifecycle") }
1114

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# frozen_string_literal: true
2+
3+
describe AllureCucumber do
4+
it "returns cucumber configuration" do
5+
expect(AllureCucumber.configuration).to be(AllureCucumber::CucumberConfig)
6+
end
7+
8+
it "yields cucumber configuration" do
9+
expect { |b| AllureCucumber.configure(&b) }.to yield_with_args(AllureCucumber::CucumberConfig)
10+
end
11+
end

allure-rspec/Rakefile

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
# frozen_string_literal: true
22

3-
require "rspec/core/rake_task"
4-
require "rubocop/rake_task"
3+
require_relative "../rake/test"
54

6-
RSpec::Core::RakeTask.new(:test, :tag) do |t, args|
7-
args[:tag].tap do |tag|
8-
t.rspec_opts = "--color --require spec_helper --format documentation #{tag ? "--tag #{tag}" : ''}"
9-
end
10-
end
11-
12-
RuboCop::RakeTask.new(:rubocop) do |task|
13-
task.options = %w[--parallel]
14-
end
5+
TestTasks.add_rspec_task
6+
TestTasks.add_rubocop_task

0 commit comments

Comments
 (0)