masukomi/rtest

[v2] capture compilation errors

masukomi opened this issue · 1 comments

as you can see in the attached screenshot, rspec is capturing and formatting compilation errors (and noting "no examples found" as a result) but they aren't passed to the example_failed endpoint because it's not a failed example

We can get this in the message method

RSpec::Core::Formatters.register self,
                                   :example_failed,
                                   :close,
                                   :message
# ...

  def message(notification)
    notification.message 
    # has an error string 
    # with "Failure/Error: ..." and maybe "NameError" and a backtrace
    # (see screenshot) so, yet another custom string to parse. 
  end

UNFORTUNATELY
this kinda breaks the whole "there's a number you can reference to run it again" and probably breaks failure display.

I think the formatter is going to need to subclass Failure as Message to handle the completely different data structure.

I think rtest is going to have to subclass Failure as Message for a similar reason and....maybe also FailurePrinter ?

maybe the number is 0 ?

CleanShot 2022-07-05 at 15 34 31@2x

fixed with commit 9b82660 and 15d6066 and 4bcb728

result looks like this:
CleanShot 2022-07-05 at 17 27 11@2x