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

Prevent unexpected network calls in tests #16903

Commits on Mar 19, 2024

  1. spec_helper: add check for unexpected network calls

    Any test that is not tagged as :needs_network and that makes
    a call to an unapproved method in the `Utils::Curl` module
    will raise an error unless that method gets mocked somehow.
    
    tests: add exceptions for tests that use curl to download local files
    
    These are acceptable ways to use curl in local, non-network tests.
    For those edge cases we allow you to bypass the check with :needs_utils_curl.
    apainintheneck committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    b66097f View commit details
    Browse the repository at this point in the history
  2. tests: fix tests that make unexpected network calls

    These were found with the Utils::Curl check and just turning
    off the network on my computer and running the entire test suite.
    apainintheneck committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    ad35db4 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2024

  1. spec_helper: add :no_api test scope

    This sets the HOMEBREW_NO_INSTALL_FROM_API environment variable
    to prevent the selected tests from using the API. We will need
    this as we transition to having the API be enabled by default
    when running the tests but it's also nice as a sanity check
    with the :needs_utils_curl scope in a few places.
    apainintheneck committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    74aea8e View commit details
    Browse the repository at this point in the history