Skip to content

Revert bin/test changes#925

Open
Morriar wants to merge 1 commit into
mainfrom
at-bin-test
Open

Revert bin/test changes#925
Morriar wants to merge 1 commit into
mainfrom
at-bin-test

Conversation

@Morriar
Copy link
Copy Markdown
Contributor

@Morriar Morriar commented May 25, 2026

The original bin/test script got replaced in #850 to use the Minitest 6 runner.

It works however, the ergonomics of the previous script were better as you could easily provide a subset of the tests to run using globs: bin/test test/spoom/sorbet/translate/**/*.rb.

cc @paracycle

The original bin/test script got replaced in #850
to use the Minitest 6 runner.

It works however, the ergonomics of the previous script were better as you
could easily provide a subset of the tests to run using globs: `bin/test test/spoom/sorbet/**/*.rb`.

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar requested a review from a team as a code owner May 25, 2026 15:42
@paracycle
Copy link
Copy Markdown
Member

Hmm, are you sure that the new runner doesn't support globs? Could your shell be doing the expansion?

@paracycle
Copy link
Copy Markdown
Member

Seems to work for me:

bin/test test/spoom/sorbet/**/*.rb
Started with run options --seed 61639

Spoom::Sorbet::SigilsTest
  test_strictness_first_valid_return                              PASS (0.00s)
  test_file_strictness_with_invalid_sigil                         PASS (0.09s)
  test_update_sigil_to_use_valid_strictness                       PASS (0.00s)
  test_file_strictness_with_valid_sigil                           PASS (0.09s)
  test_strictness_invalid_string                                  PASS (0.00s)
  test_file_strictness_with_iso_content                           PASS (0.10s)
  test_strictness_no_sigil_returns_nil                            PASS (0.00s)
  test_update_sigil_first_of_multiple                             PASS (0.00s)
  test_sigil_empty_returns_sigil_without_strictness               PASS (0.00s)
  test_change_sigil_in_file_with_iso_content                      PASS (0.11s)
  test_strictness_return_expected                                 PASS (0.00s)
  test_change_sigil_in_file_false_to_true                         PASS (0.10s)
  test_strictness_first_invalid_return                            PASS (0.00s)
  test_valid_strictness_false                                     PASS (0.00s)
  test_file_strictness_returns_nil_if_file_is_dir                 PASS (0.00s)
  test_change_sigil_in_files_with_iso_content                     PASS (0.09s)
  test_change_sigil_in_files_false_to_true                        PASS (0.09s)
  test_update_sigil_to_use_invalid_strictness                     PASS (0.00s)
  test_valid_strictness_returns_true                              PASS (0.00s)
  test_change_sigil_in_file_with_default_internal_encoding        PASS (0.10s)
  test_contains_valid_sigil                                       PASS (0.00s)
  test_file_strictness_returns_nil_if_file_not_found              PASS (0.00s)
  test_sigil_returns_the_sigil_from_a_strictness_string           PASS (0.00s)

Spoom::Sorbet::Translate::StripSorbetSigsTest
  test_strip_sorbet_sigs_sigs                                     PASS (0.00s)
  test_strip_sorbet_sigs_no_sigs                                  PASS (0.00s)
  test_strip_sorbet_sigs_empty                                    PASS (0.00s)

Spoom::Sorbet::Translate::RBSCommentsToSorbetSigsTest
  test_translate_to_rbi_empty                                     PASS (0.00s)
  test_translate_to_rbi_selects_right_comments                    PASS (0.00s)
  test_contains_rbs_syntax_returns_true_for_supported_typed_sigils PASS (0.00s)
  test_translate_to_rbi_attr_sigs_with_annotations                PASS (0.00s)
  test_translate_type_alias_as_leading_comment_on_class           PASS (0.00s)
  test_translate_to_rbi_attr_sigs                                 PASS (0.00s)
  test_translate_to_rbi_no_sigs                                   PASS (0.00s)
  test_rewrite_does_not_call_new_for_files_without_rbs_syntax     PASS (0.00s)
  test_translate_to_rbi_max_line_length                           PASS (0.00s)
  test_translate_to_rbi_method_sigs                               PASS (0.00s)
  test_translate_non_rbs_comment_as_leading_comment_on_class      PASS (0.00s)
  test_translate_to_rbi_helpers                                   PASS (0.00s)
  test_translate_broken_type_alias_continuation                   PASS (0.00s)
  test_translate_to_rbi_method_sigs_without_runtime               PASS (0.00s)
  test_translate_to_rbi_method_sigs_with_override_annotations     PASS (0.00s)
  test_translate_to_rbi_skips_sigs_with_errors                    PASS (0.00s)
  test_translate_to_rbi_ignores_yard_comments                     PASS (0.00s)
  test_translate_to_rbi_singleton_method_sigs                     PASS (0.00s)
  test_translate_to_rbi_top_level_sig                             PASS (0.00s)
  test_translate_to_rbi_method_added_is_always_without_runtime    PASS (0.00s)
  test_contains_rbs_syntax_returns_true_for_supported_rbs_annotations PASS (0.00s)
  test_contains_rbs_syntax_returns_true_for_rbs_comments          PASS (0.00s)
  test_translate_to_rbi_multiline_sigs                            PASS (0.00s)
  test_translate_to_rbi_generics                                  PASS (0.00s)
  test_contains_rbs_syntax_returns_true_for_multiline_rbs_comments PASS (0.00s)
  test_translate_to_rbi_defs_within_send                          PASS (0.00s)
  test_translate_to_rbi_does_not_insert_t_helpers_for_random_annotations PASS (0.00s)
  test_translate_to_rbi_method_sigs_with_annotations              PASS (0.00s)
  test_translate_type_alias_that_does_not_exist                   PASS (0.00s)
  test_contains_rbs_syntax_returns_false_for_unrelated_yard_tags  PASS (0.00s)
  test_translate_to_rbi_attr_sigs_without_runtime                 PASS (0.00s)
  test_translate_type_alias_with_generics                         PASS (0.00s)
  test_contains_rbs_syntax_returns_false_for_files_without_rbs_syntax PASS (0.00s)
  test_translate_type_alias_with_union                            PASS (0.00s)
  test_translate_to_rbi_in_block                                  PASS (0.00s)
  test_translate_to_rbi_helpers_with_right_order                  PASS (0.00s)
  test_translate_type_alias                                       PASS (0.00s)
  test_translate_type_alias_with_complex_type                     PASS (0.00s)
  test_translate_to_rbi_attr_sigs_raises_on_writer_with_multiple_names PASS (0.00s)
  test_contains_rbs_syntax_returns_false_for_files_without_typed_sigil PASS (0.00s)
  test_translate_type_alias_in_class                              PASS (0.00s)
  test_contains_rbs_syntax_returns_true_when_typed_sigil_is_after_other_magic_comments PASS (0.00s)

Spoom::Sorbet::ConfigTest
  test_parses_empty_config_strings                                PASS (0.00s)
  test_parses_bool_option_truthy_values                           PASS (0.00s)
  test_parses_a_config_string_with_paths                          PASS (0.00s)
  test_parses_a_config_string_with_other_options                  PASS (0.00s)
  test_parses_a_config_file_with_errors                           PASS (0.00s)
  test_parses_bool_option_falsy_values                            PASS (0.00s)
  test_options_string_empty                                       PASS (0.00s)
  test_parses_a_config_string_with_mixed_options_comments_and_empty_lines PASS (0.00s)
  test_parses_no_stdlib_equals_false                              PASS (0.00s)
  test_parses_a_config_string_with_ignore_options                 PASS (0.00s)
  test_parses_a_config_string_with_dir_options                    PASS (0.00s)
  test_parses_a_config_string_with_bool_option                    PASS (0.00s)
  test_parses_bool_option_value_defaults_to_true                  PASS (0.00s)
  test_parses_no_stdlib_equals_true                               PASS (0.00s)
  test_parses_a_real_config_string                                PASS (0.00s)
  test_options_string_with_options                                PASS (0.00s)
  test_parses_a_config_string_with_file_options                   PASS (0.00s)
  test_parses_a_config_string_with_mixed_options                  PASS (0.00s)
  test_parses_a_simple_config_string                              PASS (0.00s)

Spoom::Sorbet::Translate::SorbetAssertionsToRBSCommentsTest
  test_translate_bind                                             PASS (0.00s)
  test_inserts_cast_before_comments                               PASS (0.00s)
  test_translate_assigns_global_variables                         PASS (0.00s)
  test_translate_assigns_class_variables                          PASS (0.00s)
  test_translate_assigns_instance_variables                       PASS (0.00s)
  test_translate_supports_encoding                                PASS (0.00s)
  test_doesnt_translate_in_expressions                            PASS (0.00s)
  test_doesnt_translate_cast_in_parentheses                       PASS (0.00s)
  test_translate_cast_in_cases                                    PASS (0.00s)
  test_translate_assigns_constants                                PASS (0.00s)
  test_translate_cast_in_oneliners                                PASS (0.00s)
  test_translate_assigns_local_variables                          PASS (0.00s)
  test_translate_ignore_non_assertions                            PASS (0.00s)
  test_translate_casts                                            PASS (0.00s)
  test_translate_assigns_with_indented_values                     PASS (0.00s)
  test_translate_assigns_constant_paths                           PASS (0.00s)
  test_translate_unsafe                                           PASS (0.00s)
  test_does_not_translate_assigns_with_dangling_conditionals      PASS (0.00s)
  test_translate_assigns_ignore_heredoc_values                    PASS (0.00s)
  test_translate_multi_assigns                                    PASS (0.00s)
  test_does_not_translate_assertions_already_with_annotations     PASS (0.00s)
  test_translate_with_trailing_comments                           PASS (0.00s)
  test_translate_cast_in_nested_values                            PASS (0.00s)
  test_translate_assigns_ignore_nested_assigns                    PASS (0.00s)
  test_translate_cast                                             PASS (0.00s)
  test_does_not_translate_assigns_with_parentheses                PASS (0.00s)
  test_translate_options                                          PASS (0.00s)
  test_translate_assigns_does_not_match_bare_strings_has_heredoc  PASS (0.00s)
  test_translate_must                                             PASS (0.00s)
  test_does_not_translate_assertions_already_with_comments        PASS (0.00s)
  test_doesnt_translate_cast_in_string_interpolation              PASS (0.00s)
  test_translate_only_first_level_assertions_at_the_end_of_the_line PASS (0.00s)
  test_doesnt_translate_in_ternary_expressions                    PASS (0.00s)

Spoom::Sorbet::Metrics::CodeMetricsVisitorTest
  test_collects_metrics_about_calls                               PASS (0.00s)
  test_collects_metrics_about_RBS_assertions                      PASS (0.00s)
  test_collects_base_metrics                                      PASS (0.00s)
  test_collects_metrics_about_generics                            PASS (0.00s)
  test_collects_metrics_about_sigs                                PASS (0.00s)

Spoom::Sorbet::ErrorsTest
  test_parses_no_file                                             PASS (0.00s)
  test_parses_no_errors                                           PASS (0.00s)
  test_parses_errors_with_multiple_blank_lines                    PASS (0.00s)
  test_parses_a_not_enough_arguments_error                        PASS (0.00s)
  test_parses_multiple_errors                                     PASS (0.00s)
  test_complex_error_line_matching                                PASS (0.00s)
  test_parses_errors_with_custom_error_url_base                   PASS (0.00s)
  test_parses_a_token_error                                       PASS (0.00s)
  test_parses_a_redefinition_error                                PASS (0.00s)
  test_parses_no_config                                           PASS (0.00s)
  test_parses_a_method_missing_error                              PASS (0.00s)
  test_parses_empty_string                                        PASS (0.00s)
  test_sort_errors                                                PASS (0.00s)
  test_parses_errors_with_debug_string                            PASS (0.00s)
  test_parses_no_errors_with_debug_string                         PASS (0.00s)

Spoom::Sorbet::Translate::SorbetSigsToRBSCommentsTest
  test_translate_to_rbs_method_sigs_with_override_annotations     PASS (0.00s)
  test_translate_to_rbs_helpers                                   PASS (0.00s)
  test_translate_to_rbs_with_nested_all_param                     PASS (0.00s)
  test_translate_to_rbs_in_block                                  PASS (0.00s)
  test_translate_to_rbs_method_sigs_without_runtime               PASS (0.00s)
  test_translate_to_rbs_helpers_do_not_remove_extend_helpers_if_no_helper_was_removed PASS (0.00s)
  test_translate_to_rbs_multline_for_long_sigs                    PASS (0.00s)
  test_translate_to_rbs_singleton_method_sigs                     PASS (0.00s)
  test_translate_to_rbs_method_sigs                               PASS (0.00s)
  test_translate_to_rbs_attr_sigs                                 PASS (0.00s)
  test_translate_to_rbs_no_sigs                                   PASS (0.00s)
  test_translate_method_sigs_to_rbs_without_positional_names      PASS (0.00s)
  test_translate_to_rbs_method_sigs_with_overridable_annotation_indented PASS (0.00s)
  test_translate_to_rbs_with_nested_any_param                     PASS (0.00s)
  test_translate_to_rbs_empty                                     PASS (0.00s)
  test_translate_to_rbs_attr_sigs_without_runtime                 PASS (0.00s)
  test_translate_to_rbs_attr_sigs_with_annotations                PASS (0.00s)
  test_translate_to_rbs_top_level_sig                             PASS (0.00s)
  test_translate_to_rbs_with_nested_nilable_param                 PASS (0.00s)
  test_translate_to_rbs_abstract_methods                          PASS (0.00s)
  test_translate_to_rbs_defs_within_send                          PASS (0.00s)
  test_translate_to_rbs_generics                                  PASS (0.00s)
  test_translate_to_rbs_method_sigs_with_annotations              PASS (0.00s)

Spoom::Sorbet::Metrics::MetricsFileParserTest
  test_parses_metrics_error                                       PASS (0.00s)
  test_parses_metrics_and_removes_prefix                          PASS (0.00s)
  test_parses_metrics                                             PASS (0.00s)

Finished in 0.78483s
166 tests, 351 assertions, 0 failures, 0 errors, 0 skips

@Morriar
Copy link
Copy Markdown
Contributor Author

Morriar commented May 25, 2026

Interesting, try with bin/test test/spoom/sorbet/translate/**/*.rb for example it will run all the tests. Looks like the behavior differs between the bin and the runner when trying to match a non-existent subdirectory.

@paracycle
Copy link
Copy Markdown
Member

Interesting, try with bin/test test/spoom/sorbet/translate/**/*.rb for example it will run all the tests. Looks like the behavior differs between the bin and the runner when trying to match a non-existent subdirectory.

That also seems to work for me:

ufuk ~/s/g/S/spoom on  main [ v4.0.2]                                                                                      20:18bin/test test/spoom/sorbet/translate/**/*.rb
Started with run options --seed 47387

Spoom::Sorbet::Translate::SorbetSigsToRBSCommentsTest
  test_translate_to_rbs_attr_sigs_with_annotations                PASS (0.00s)
  test_translate_to_rbs_method_sigs_without_runtime               PASS (0.00s)
  test_translate_to_rbs_method_sigs_with_overridable_annotation_indented PASS (0.00s)
  test_translate_to_rbs_no_sigs                                   PASS (0.00s)
  test_translate_to_rbs_with_nested_nilable_param                 PASS (0.00s)
  test_translate_to_rbs_abstract_methods                          PASS (0.00s)
  test_translate_to_rbs_method_sigs_with_annotations              PASS (0.00s)
  test_translate_to_rbs_helpers_do_not_remove_extend_helpers_if_no_helper_was_removed PASS (0.00s)
  test_translate_to_rbs_top_level_sig                             PASS (0.00s)
  test_translate_to_rbs_with_nested_any_param                     PASS (0.00s)
  test_translate_to_rbs_with_nested_all_param                     PASS (0.00s)
  test_translate_to_rbs_in_block                                  PASS (0.00s)
  test_translate_to_rbs_multline_for_long_sigs                    PASS (0.00s)
  test_translate_to_rbs_helpers                                   PASS (0.00s)
  test_translate_to_rbs_generics                                  PASS (0.00s)
  test_translate_to_rbs_singleton_method_sigs                     PASS (0.00s)
  test_translate_to_rbs_empty                                     PASS (0.00s)
  test_translate_to_rbs_method_sigs_with_override_annotations     PASS (0.00s)
  test_translate_to_rbs_defs_within_send                          PASS (0.00s)
  test_translate_to_rbs_method_sigs                               PASS (0.00s)
  test_translate_method_sigs_to_rbs_without_positional_names      PASS (0.00s)
  test_translate_to_rbs_attr_sigs_without_runtime                 PASS (0.00s)
  test_translate_to_rbs_attr_sigs                                 PASS (0.00s)

Spoom::Sorbet::Translate::StripSorbetSigsTest
  test_strip_sorbet_sigs_no_sigs                                  PASS (0.00s)
  test_strip_sorbet_sigs_empty                                    PASS (0.00s)
  test_strip_sorbet_sigs_sigs                                     PASS (0.00s)

Spoom::Sorbet::Translate::RBSCommentsToSorbetSigsTest
  test_translate_to_rbi_singleton_method_sigs                     PASS (0.00s)
  test_contains_rbs_syntax_returns_true_when_typed_sigil_is_after_other_magic_comments PASS (0.00s)
  test_translate_to_rbi_attr_sigs_with_annotations                PASS (0.00s)
  test_translate_type_alias_that_does_not_exist                   PASS (0.00s)
  test_translate_to_rbi_method_sigs                               PASS (0.00s)
  test_translate_to_rbi_method_sigs_without_runtime               PASS (0.00s)
  test_translate_to_rbi_in_block                                  PASS (0.00s)
  test_translate_to_rbi_selects_right_comments                    PASS (0.00s)
  test_contains_rbs_syntax_returns_true_for_multiline_rbs_comments PASS (0.00s)
  test_translate_to_rbi_method_sigs_with_annotations              PASS (0.00s)
  test_translate_type_alias_with_union                            PASS (0.00s)
  test_translate_to_rbi_no_sigs                                   PASS (0.00s)
  test_translate_to_rbi_method_sigs_with_override_annotations     PASS (0.00s)
  test_translate_to_rbi_defs_within_send                          PASS (0.00s)
  test_translate_to_rbi_helpers_with_right_order                  PASS (0.00s)
  test_translate_to_rbi_ignores_yard_comments                     PASS (0.00s)
  test_translate_to_rbi_helpers                                   PASS (0.00s)
  test_translate_to_rbi_method_added_is_always_without_runtime    PASS (0.00s)
  test_translate_to_rbi_empty                                     PASS (0.00s)
  test_contains_rbs_syntax_returns_false_for_unrelated_yard_tags  PASS (0.00s)
  test_translate_type_alias                                       PASS (0.00s)
  test_translate_broken_type_alias_continuation                   PASS (0.00s)
  test_translate_to_rbi_skips_sigs_with_errors                    PASS (0.00s)
  test_translate_to_rbi_generics                                  PASS (0.00s)
  test_contains_rbs_syntax_returns_false_for_files_without_typed_sigil PASS (0.00s)
  test_translate_to_rbi_max_line_length                           PASS (0.00s)
  test_translate_to_rbi_attr_sigs_raises_on_writer_with_multiple_names PASS (0.00s)
  test_translate_to_rbi_does_not_insert_t_helpers_for_random_annotations PASS (0.00s)
  test_translate_type_alias_with_generics                         PASS (0.00s)
  test_translate_type_alias_as_leading_comment_on_class           PASS (0.00s)
  test_translate_type_alias_with_complex_type                     PASS (0.00s)
  test_translate_non_rbs_comment_as_leading_comment_on_class      PASS (0.00s)
  test_translate_to_rbi_multiline_sigs                            PASS (0.00s)
  test_rewrite_does_not_call_new_for_files_without_rbs_syntax     PASS (0.00s)
  test_contains_rbs_syntax_returns_true_for_supported_rbs_annotations PASS (0.00s)
  test_contains_rbs_syntax_returns_true_for_supported_typed_sigils PASS (0.00s)
  test_translate_to_rbi_attr_sigs_without_runtime                 PASS (0.00s)
  test_translate_type_alias_in_class                              PASS (0.00s)
  test_translate_to_rbi_attr_sigs                                 PASS (0.00s)
  test_contains_rbs_syntax_returns_false_for_files_without_rbs_syntax PASS (0.00s)
  test_contains_rbs_syntax_returns_true_for_rbs_comments          PASS (0.00s)
  test_translate_to_rbi_top_level_sig                             PASS (0.00s)

Spoom::Sorbet::Translate::SorbetAssertionsToRBSCommentsTest
  test_translate_assigns_with_indented_values                     PASS (0.00s)
  test_does_not_translate_assigns_with_parentheses                PASS (0.00s)
  test_translate_supports_encoding                                PASS (0.00s)
  test_translate_cast                                             PASS (0.00s)
  test_translate_assigns_ignore_nested_assigns                    PASS (0.00s)
  test_translate_ignore_non_assertions                            PASS (0.00s)
  test_translate_assigns_global_variables                         PASS (0.00s)
  test_translate_assigns_local_variables                          PASS (0.00s)
  test_translate_cast_in_nested_values                            PASS (0.00s)
  test_translate_assigns_class_variables                          PASS (0.00s)
  test_translate_casts                                            PASS (0.00s)
  test_translate_cast_in_cases                                    PASS (0.00s)
  test_does_not_translate_assigns_with_dangling_conditionals      PASS (0.00s)
  test_does_not_translate_assertions_already_with_comments        PASS (0.00s)
  test_doesnt_translate_in_ternary_expressions                    PASS (0.00s)
  test_translate_bind                                             PASS (0.00s)
  test_translate_assigns_does_not_match_bare_strings_has_heredoc  PASS (0.00s)
  test_translate_assigns_instance_variables                       PASS (0.00s)
  test_translate_with_trailing_comments                           PASS (0.00s)
  test_translate_must                                             PASS (0.00s)
  test_translate_unsafe                                           PASS (0.00s)
  test_translate_assigns_constant_paths                           PASS (0.00s)
  test_translate_multi_assigns                                    PASS (0.00s)
  test_inserts_cast_before_comments                               PASS (0.00s)
  test_translate_cast_in_oneliners                                PASS (0.00s)
  test_translate_only_first_level_assertions_at_the_end_of_the_line PASS (0.00s)
  test_doesnt_translate_in_expressions                            PASS (0.00s)
  test_translate_assigns_ignore_heredoc_values                    PASS (0.00s)
  test_doesnt_translate_cast_in_string_interpolation              PASS (0.00s)
  test_translate_assigns_constants                                PASS (0.00s)
  test_translate_options                                          PASS (0.00s)
  test_does_not_translate_assertions_already_with_annotations     PASS (0.00s)
  test_doesnt_translate_cast_in_parentheses                       PASS (0.00s)

Finished in 0.01241s
101 tests, 120 assertions, 0 failures, 0 errors, 0 skips

@paracycle
Copy link
Copy Markdown
Member

But, yeah, a non-existent folder has different behaviour:

bin/test test/spoom/sorbet/translate1/**/*.rb
Started with run options --seed 31630

Spoom::Deadcode::Plugins::ActiveSupportTest
  test_ignore_test_class_definition                               PASS (0.07s)
  test_ignore_minitest_setup_and_teardown_with_symbols            PASS (0.03s)
...

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 this pull request may close these issues.

2 participants