Skip to content

Commit 94a0d59

Browse files
committed
Silence test output for expected exceptions
SolidQueue has excellent built-in error reporting. While this is fantastic for SQ users, it is less than ideal for testing SolidQueue because any test that deliberately uses or triggers an exception produces voluminous error reporting. This error reporting is hugely valuable when the exception is not expected, but distracting and of limited value for expected use-cases, especially when the test confirms the correct outcomes via assertions. This commit adds: * A generic test-specific Exception class: ExpectedTestError This allows testing for specific exceptions while retaining all error reporting infrastructure for unexpected exceptions. * Two helper methods for silencing on_thread_error output These methods accept an Exception or Array(Exception) and simply does not call the output mechanism if the exception passed to on_thread_error matches. This way, any unexpected error during test still reports in a highly visible manner while the exceptions being tested are validated via assertions. * Replaces the stock on_thread_error with one that ignores ExpectedTextError. Updated several tests from using the ruby stock RuntimeError to ExpectedTestError. * Configures tests to run with YJIT enabled This is to test under likely production deployment configuration, not for performance reasons. Note: With the very recent reporting on M4's crashing on Mac's with YJIT enabled, we might want to either defer this change or add a conditional to opt in until the problem is resolved.
1 parent 4f29fc8 commit 94a0d59

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ GEM
130130
rake (13.2.1)
131131
rdoc (6.8.1)
132132
psych (>= 4.0.0)
133+
rdoc (6.6.3.1)
134+
psych (>= 4.0.0)
133135
regexp_parser (2.9.2)
134136
reline (0.5.12)
135137
io-console (~> 0.5)

0 commit comments

Comments
 (0)