Skip to content

Commit d05bfb9

Browse files
authored
Merge pull request #38 from semaphoreci-demos/mk/test-result-setup
Enables test result
2 parents ad21de7 + 7940e99 commit d05bfb9

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

.rspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
--require spec_helper --format documentation
2+
--format RspecJunitFormatter
3+
--out junit.xml

.semaphore/semaphore.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ blocks:
5353
- name: RSpec - controller tests
5454
commands:
5555
- bundle exec rspec spec/controllers
56+
epilogue:
57+
always:
58+
commands:
59+
- test-results publish junit.xml
5660
- name: Integration tests
5761
dependencies:
5862
- Unit tests
@@ -71,3 +75,7 @@ blocks:
7175
- sem-service start postgres
7276
- 'bundle exec rake db:setup'
7377
- bundle exec rspec spec/features
78+
epilogue:
79+
always:
80+
commands:
81+
- test-results publish junit.xml

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ group :development, :test do
4848

4949
# be able to demonstrate mysql config on Semaphore
5050
gem 'mysql2', '~> 0.5.2'
51+
gem "rspec_junit_formatter"
5152
end
5253

5354
group :development do
@@ -59,6 +60,5 @@ group :development do
5960
gem 'spring-watcher-listen', '~> 2.0.0'
6061
end
6162

62-
6363
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
6464
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ GEM
174174
rspec-mocks (~> 3.10)
175175
rspec-support (~> 3.10)
176176
rspec-support (3.10.2)
177+
rspec_junit_formatter (0.4.1)
178+
rspec-core (>= 2, < 4, != 2.12.0)
177179
rubocop (1.13.0)
178180
parallel (~> 1.10)
179181
parser (>= 3.0.0.0)
@@ -261,6 +263,7 @@ DEPENDENCIES
261263
puma (~> 3.12)
262264
rails (~> 6.0.1)
263265
rspec-rails
266+
rspec_junit_formatter
264267
rubocop
265268
rubocop-rails
266269
rubocop-rspec

spec/controllers/home_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'rails_helper'
1+
require "rails_helper"
22

33
RSpec.describe HomeController do
44
describe "GET index" do

0 commit comments

Comments
 (0)