Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the notification exception to annotate the file/line where it occured #75

Open
runephilosof-abtion opened this issue Sep 16, 2024 · 3 comments · May be fixed by #76
Open

Use the notification exception to annotate the file/line where it occured #75

runephilosof-abtion opened this issue Sep 16, 2024 · 3 comments · May be fixed by #76

Comments

@runephilosof-abtion
Copy link

Instead of only annotating the spec file, also annotate where the exception happened.

Maybe make it configurable which annotations you want.

@StefSchenkelaars
Copy link
Contributor

Just to clarify, this would only be in case of an exception right? Because if you have a simple test like expect(true).to equal false, you don't have a location other than the spec file.

StefSchenkelaars added a commit to StefSchenkelaars/rspec-github that referenced this issue Sep 16, 2024
This is just a test commit as the final version should be configurable.
Instead this can be used for early testing.

Closes Drieam#75
StefSchenkelaars added a commit to StefSchenkelaars/rspec-github that referenced this issue Sep 16, 2024
This is just a test commit as the final version should be configurable.
Instead this can be used for early testing.

Closes Drieam#75
@StefSchenkelaars StefSchenkelaars linked a pull request Sep 16, 2024 that will close this issue
@StefSchenkelaars
Copy link
Contributor

@runephilosof-abtion Have a look at #76. Please test this branch and see if this is what you expect. If this is indeed ok, I can work on making it production ready with configuration etc.

StefSchenkelaars added a commit to StefSchenkelaars/rspec-github that referenced this issue Sep 16, 2024
This is just a test commit as the final version should be configurable.
Instead this can be used for early testing.

Closes Drieam#75
@runephilosof-abtion
Copy link
Author

It should use the same filtering of files that --format progress does, so that only application file are reported.

Example:

Failures:

  1) ErrorsController GET #internal_server_error renders 422 status page
     Failure/Error: format.html { render status: :internl_server_error }
     
     ArgumentError:
       Unrecognized status code :internl_server_error
     # ./app/controllers/errors_controller.rb:18:in `block (2 levels) in internal_server_error'
     # ./app/controllers/errors_controller.rb:17:in `internal_server_error'
     # ./spec/controllers/errors_controller_spec.rb:28:in `block (3 levels) in <top (required)>'

PR #76 gives this output:

::error file=/root/.asdf/installs/ruby/3.3.3/lib/ruby/gems/3.3.0/gems/rack-3.1.7/lib/rack/utils.rb,line=591::ErrorsController GET #internal_server_error renders 422 status page%0A%0AFailure/Error: format.html { render status: :internl_server_error }%0A%0AArgumentError:%0A  Unrecognized status code :internl_server_error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants