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 config to silence ActiveRecord output in tests #27

Merged

Commits on Oct 3, 2024

  1. Add config to silence ActiveRecord output in tests

    Several tests have messages from ActiveRecord that inject into the RSpec
    test output. This removes those notifications to ensure clear test
    result output without the multi-line noise. Some of the messaging comes
    from cdinger#26 (parallel PR), others from cdinger#7.
    
    When the test suite begins, the value of
    `ActiveRecord::Migration.verbose` is captured and then set to `false`.
    After the suite is done running the initial value is reinstated.
    
    Examples of messages silenced:
    ```
    -- create_view("multi_newline_and_semicolon", {:sql_definition=>"      select\n        3 as fancy_c\n      from\n        dual\n"})
       -> 0.0015s
       -> 0 rows
    -- create_view("multiline_internal_indented", {:sql_definition=>"      SELECT\n          1 AS fancy_a,\n          CASE\n              WHEN 1=1 THEN 'Y'\n              ELSE 'N'\n          END AS fancy_b\n      FROM\n          dual\n"})
       -> 0.0011s
       -> 0 rows
    -- create_view("multiline_left_justified", {:sql_definition=>"      select\n      1 as a\n      from\n      dual\n"})
       -> 0.0010s
       -> 0 rows
    .   -> index 'THINGS_ID' on 'THINGS' has been recreated
       -> index 'THINGS_NAME' on 'THINGS' has been recreated
    .   -> index 'THINGS_ID' on 'THINGS' has been recreated
       -> index 'THINGS_NAME' on 'THINGS' is no longer valid and has been dropped.
    ```
    
    Co-authored-by: Davin Lagerroos <dlagerro@umn.edu>
    Co-authored-by: Eric Eklund <eeklund@umn.edu>
    eeklund and dlagerro committed Oct 3, 2024
    Configuration menu
    Copy the full SHA
    69c5078 View commit details
    Browse the repository at this point in the history