Skip to content

Add custom matchers to format cli example errors

What does this MR do and why?

Adds two custom matchers for asserting on Internal Events CLI output. These help with rendering more meaningful errors when an example fails.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Sample failing outputs:

eventually_equal_cli_text:

Screenshot_2024-03-21_at_12.21.30_AM

eventually_includes_cli_text (note that with multiple inputs, we see which one is failing):

Screenshot_2024-03-21_at_12.19.07_AM Screenshot_2024-03-21_at_12.19.22_AM Screenshot_2024-03-21_at_12.19.36_AM

How to set up and validate locally

Add modify the specs so the inputs & outputs aren't expected to match, then run the tests.

bundle exec rspec spec/scripts/internal_events/cli_spec.rb

diff --git a/spec/scripts/internal_events/cli_spec.rb b/spec/scripts/internal_events/cli_spec.rb
index 100198ee5f33..519907ab8d08 100644
--- a/spec/scripts/internal_events/cli_spec.rb
+++ b/spec/scripts/internal_events/cli_spec.rb
@@ -177,6 +177,7 @@ def wait_for_cli_completion
           dev:create:ide
           dev:create:editor_extensions
           dev:create:code_creation
+          SARAH IS AMAZINGGGGGGG
         TEXT
 
         with_cli_thread do

Merge request reports