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

Add minitest backtrace filter #457

Merged
merged 1 commit into from
Sep 5, 2023
Merged

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Sep 1, 2023

Closes #456

README.md Outdated

```ruby
# test/test_helper.rb
require "spoom/minitest/backtrace_filter"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(wondering where this should be a manual require or not)

@andyw8 andyw8 force-pushed the andyw8/add-minitest-backtrace-filter branch from 8abfb97 to 5ee258a Compare September 1, 2023 17:21

module Spoom
module BacktraceFilter
class Minitest < ::Minitest::BacktraceFilter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had Spoom::Minitest::BacktraceFilter but that causes typecheck problems with tests in the Spoom namespace that inherit from Minitest::Test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: rename the file to match the updated naming

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change the tests to inherit from ::Minitest::Test if you prefer the other name 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this way is ok, have renamed the file to match.

@andyw8 andyw8 marked this pull request as ready for review September 1, 2023 17:24
@andyw8 andyw8 requested a review from a team as a code owner September 1, 2023 17:24
lib/spoom.rb Outdated
@@ -18,4 +18,5 @@ class Error < StandardError; end
require "spoom/deadcode"
require "spoom/sorbet"
require "spoom/cli"
require "spoom/minitest/backtrace_filter"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make this require manual and not included in the default require.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@andyw8 andyw8 force-pushed the andyw8/add-minitest-backtrace-filter branch 2 times, most recently from 6719295 to 79987ce Compare September 1, 2023 18:13
@andyw8
Copy link
Contributor Author

andyw8 commented Sep 1, 2023

Here's a Ruby LSP branch using this, for verification:

https://github.com/Shopify/ruby-lsp/pull/965/files

Note that we need to add an entry to require.rb for the typecheck to pass... are we ok with that? (I can mention in the README).

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, but I'll let Alex decide if he prefers the default require

@andyw8 andyw8 force-pushed the andyw8/add-minitest-backtrace-filter branch from 79987ce to 0c0163e Compare September 5, 2023 14:22
@andyw8 andyw8 enabled auto-merge September 5, 2023 14:22
@andyw8 andyw8 merged commit 67d4b38 into main Sep 5, 2023
@andyw8 andyw8 deleted the andyw8/add-minitest-backtrace-filter branch September 5, 2023 14:29
@andyw8 andyw8 added the enhancement New feature or request label Sep 14, 2023
@shopify-shipit shopify-shipit bot temporarily deployed to production September 15, 2023 18:53 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minitest backtrace filter
3 participants