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

Use cfg_attr to ignore expensive tests #6032

Merged
merged 10 commits into from
Jan 13, 2022
Merged

Use cfg_attr to ignore expensive tests #6032

merged 10 commits into from
Jan 13, 2022

Commits on Jan 10, 2022

  1. Use cfg_attr to ignore expensive tests

    Rather than using `cfg` to not compile expensive tests, use `cfg_attr`
    to conditionally mark such tests as ignored.  In other words, instead
    of writing:
    
        #[cfg(feature = "expensive_tests")]
        #[test]
        fn test_clear_old_data_too_many_heights() {
            // ...
        }
    
    write:
    
        #[test]
        #[cfg_attr(not(feature = "expensive_tests"), ignore)]
        fn test_clear_old_data_too_many_heights() {
            // ...
        }
    
    With this change, expensive tests will always be built which means
    that i) any code changes breaking them will be caught by CI (rather
    than having to wait for a nightly run) and ii) code used by expensive
    tests only is no longer unused when `expensive_tests` feature is not
    enabled (which means fewer `#[cfg(feature = "expensive_tests")]`
    directives sprinkled throughout code).
    
    Since we no longer mark whole modules as compiled only if the feature
    is enabled, this change also means that each individual test needs to
    be marked individually (rather than being able to mark whole module).
    This makes it more obvious which tests are expensive and which aren’t
    (since the marking is right at the test definition site) and
    simplifies `check_nightly.py` script.
    
    Issue: #4490
    mina86 committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    c9faa37 View commit details
    Browse the repository at this point in the history
  2. yapf

    mina86 committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    e6f482f View commit details
    Browse the repository at this point in the history
  3. fmt

    mina86 committed Jan 10, 2022
    Configuration menu
    Copy the full SHA
    7dd75bf View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2022

  1. Configuration menu
    Copy the full SHA
    33d06dd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    262a619 View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2022

  1. doc

    mina86 committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    3d7ec46 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3a16455 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d38ea41 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cedff6b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    558ff4d View commit details
    Browse the repository at this point in the history