You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments