Closed onthespotqa closed 7 years ago
Hi @onthespotqa
Thanks for report. I'll try to check this issue.
@gongo thanks.
i was looking into this myself and i don't know enough about how the formatter works to fix. But it looks like the difference between this and other failures is that it doesn't know how to handle RSpec's MultipleExceptionError.
Hi @onthespotqa
My reply was very very late š . I will fix this bug in version 0.6.0. Please wait until release.
@gongo great thanks.
Hi @onthespotqa
Very*5 late š I've released 0.6.0.pre.beta.5 that corrected this problem. Please try this .
@gongo i still get an error.
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.5/lib/turnip_formatter/renderer/html/index.rb:44:in rescue in block in scenarios_html': undefined method
render' for #
latest version of this gem.
turnip (3.0.0.pre.beta.5)
Hi @onthespotqa
Sorry š GH-86
I fixed this error and released 0.6.0.pre.beta.6. Please try š
This error has been fixed.
However it does not look like the formatter supports rspec's Failure Aggregation functionality (https://www.relishapp.com/rspec/rspec-core/docs/expectation-framework-integration/aggregating-failures). I'm not sure if this functionality is supposed to be supported. If i have this flag set i get the following exception
Runtime Error
undefined method map' for nil:NilClass Runtime Error Backtrace C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.6/lib/turnip_formatter/renderer/html/scenario.rb:13:in
steps_html'
(erb):20:in render' C:/Ruby22-x64/lib/ruby/2.2.0/erb.rb:863:in
eval'
C:/Ruby22-x64/lib/ruby/2.2.0/erb.rb:863:in result' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.6/lib/turnip_formatter/renderer/html/base.rb:42:in
render'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.6/lib/turnip_formatter/renderer/html/index.rb:43:in block in scenarios_html' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.6/lib/turnip_formatter/renderer/html/index.rb:41:in
map'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.6/lib/turnip_formatter/renderer/html/index.rb:41:in scenarios_html' (erb):68:in
render'
C:/Ruby22-x64/lib/ruby/2.2.0/erb.rb:863:in eval' C:/Ruby22-x64/lib/ruby/2.2.0/erb.rb:863:in
result'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.6/lib/turnip_formatter/renderer/html/base.rb:42:in render' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.6/lib/rspec/core/formatters/turnip_formatter.rb:57:in
output_html'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/turnip_formatter-0.6.0.pre.beta.6/lib/rspec/core/formatters/turnip_formatter.rb:36:in dump_summary' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:189:in
block in notify'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:188:in each' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:188:in
notify'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:167:in block in finish' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:175:in
close_after'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:156:in finish' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:79:in
report'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:117:in run_specs' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:93:in
run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in run' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in
invoke'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/exe/rspec:4:in `
@onthespotqa Thanks to stacktrace report.
Hmm.. there is no error with failure aggregation in my environment š¤ I will investigate it šŖ
@gongo do you want the output that i have for this from the rspec documentation format?
@onthespotqa
I appreciate it š
here's an example
2) [Is_TransactionID_Used_As_UserID = True] Do Not Use TransactionID as a User Identifier [Cause Merge] New TrackingID, Transaction_ID Already Associated with a Subject_Lookup Given The ReplaceTransactionID is not Set -> Given The Account Setting "Is_TransactionID_Used_As_UserID" is Set to "True" -> And I Poke the Session Manager Component Caches -> Given The Following Users: -> Given Tracking_ID "TK1" -> When I Send a Target Event Call with a Transaction_ID in Subject_Lookup -> Then The Subject_ID Associated with "TN1" is Used to Identify My Session in Session Manager -> Then My Session Times Out -> Then My Tracking ID is assigned to The Subject_ID for "TN1" Got 2 failures:
2.1) Failure/Error: expect(@info.subject_id.downcase).to eq @subject_id.downcase
expected: "07f18024-f420-4a14-b8f0-dc2378d6593f"
got: "8e9e2bf8-867b-4e5c-8e91-14432b20000f"
(compared using ==)
# ./spec/support/steps/session_info/subject_id_steps.rb:51:in `block in <top (required)>'
# ./spec/transaction_id/use_transaction_id_true.feature:23:in `run_step'
# ./spec/transaction_id/use_transaction_id_true.feature:17:in `block (4 levels) in run_feature'
# ./spec/transaction_id/use_transaction_id_true.feature:16:in `each'
# ./spec/transaction_id/use_transaction_id_true.feature:16:in `block (3 levels) in run_feature'
2.2) Failure/Error: expect(subject_id.downcase).to eq transaction_subject_id.downcase
expected: "07f18024-f420-4a14-b8f0-dc2378d6593f"
got: "8e9e2bf8-867b-4e5c-8e91-14432b20000f"
(compared using ==)
# ./spec/support/steps/subjects/subject_lookup_steps.rb:59:in `block in <top (required)>'
# ./spec/transaction_id/use_transaction_id_true.feature:25:in `run_step'
# ./spec/transaction_id/use_transaction_id_true.feature:17:in `block (4 levels) in run_feature'
# ./spec/transaction_id/use_transaction_id_true.feature:16:in `each'
# ./spec/transaction_id/use_transaction_id_true.feature:16:in `block (3 levels) in run_feature'
Thanks for example!
@onthespotqa
Could you tell me for ruby and gems version?
$ ruby -v
(output)
$ bundle list | grep rspec | sort
(output)
ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32]
rspec (3.4.0)
rspec (3.4.0)
Please other (rspec-*
) gems (rspec-core
, rspec-expectations
, ...)
rspec (3.4.0) rspec-core (~> 3.4.0) rspec-expectations (~> 3.4.0) rspec-mocks (~> 3.4.0) rspec-core (3.4.4) rspec-support (~> 3.4.0) rspec-expectations (3.4.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.4.0) rspec-mocks (3.4.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.4.0) rspec-retry (0.5.3) rspec-core (> 3.3, < 3.6) rspec-support (3.4.1)
Sorry, I want to see bundle list
output:
example:
$ bundle list | grep rspec | sort
* rspec (3.4.0)
* rspec-core (3.4.4)
* rspec-expectations (3.4.0)
* rspec-mocks (3.4.1)
* rspec-support (3.4.1)
Thanks !
Umm.. There is no error with failure aggregation in my environment yet (macOS, Windows 7) Would you please let me know the definition of following line and surroundings? (pseudo code OK)
spec/support/steps/session_info/subject_id_steps.rb:51
spec/support/steps/subjects/subject_lookup_steps.rb:59
step 'xxx' do
# ...
aggregate_failures "yyy" do
# ...
expect(@info.subject_id.downcase).to eq @subject_id.downcase
end
end
spec/support/steps/subjects/subject_lookup_steps.rb:59 step "My Tracking ID is assigned to The Subject_ID for :identifier" do |identifier| sleep 5 transaction_subject_id = find_subject_id(identifier) subject_id = INSIGHT[:subject_lookup].where(:user_id => @visitor_id).get(:subject_id) expect(subject_id.downcase).to eq transaction_subject_id.downcase end spec/support/steps/session_info/subject_id_steps.rb:51 step "The Subject_ID Associated with :identifier is Used to Identify My Session in Session Manager" do |identifier| @info = call_session_info(@application_id, @visitor_id) @subject_id = find_subject_id(identifier) expect(@info.subject_id.downcase).to eq @subject_id.downcase end
@onthespotqa Thanks!!
Just to confirm. Do you write code like the following in spec_helper.rb
?
config.define_derived_metadata do |meta|
meta[:aggregate_failures] = true
end
yes.
OK ! I understood the cause of the error. I will start to fix it. šŖ
Hi @onthespotqa
I fixed this error and released 0.6.0.pre.beta.7 (maybe..). Please try š
I believe this has been fixed. I haven't run into this error in my many runs. If i run into issues i'll file another issue.
The issue can be closed.
Thanks !!
So I've had tests fail due to Watir Not Being able to find an element, that has caused some cascading failures in my before/after hooks.
Below is an example of the failure:
3.1) Failure/Error: @site.create_strategy.vhs_select.select_value @vhs_id
When the report tries to generate it creates the following error and the report fails to generate: C:/Ruby200/lib/ruby/gems/2.0.0/gems/turnip_formatter-0.5.0/lib/turnip_formatter/scenario/failure.rb:36:in'
failed_line_number': undefined method
find' for nil:NilClass (NoMethodError) from C:/Ruby200/lib/ruby/gems/2.0.0/gems/turnip_formatter-0.5.0/lib/turnip_formatter/scenario/failure.rb:25:invalidation' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/turnip_formatter-0.5.0/lib/turnip_formatter/scenario/base.rb:15:in
initialize' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/turnip_formatter-0.5.0/lib/rspec/core/formatters/turnip_formatter.rb:49:innew' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/turnip_formatter-0.5.0/lib/rspec/core/formatters/turnip_formatter.rb:49:in
example_failed' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:189:inblock in notify' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:188:in
each' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:188:innotify' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:140:in
example_failed' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example.rb:452:infinish' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example.rb:410:in
fail_with_exception' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:550:inblock in run' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:591:in
each' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:591:infor_filtered_examples' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:595:in
block in for_filtered_examples' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:593:ineach' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:593:in
for_filtered_examples' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:550:inrescue in run' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/example_group.rb:556:in
run' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:119:inblock (3 levels) in run_specs' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:119:in
map' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:119:inblock (2 levels) in run_specs' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1680:in
with_suite_hooks' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:118:inblock in run_specs' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/reporter.rb:77:in
report' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:117:inrun_specs' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:93:in
run' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:inrun' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in
invoke' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-3.4.4/exe/rspec:4:in `I'm not sure what the expected behavior is in this case.