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

Change test suite web server (gunicorn) launch to a proper pytest fixture #3002

Merged
merged 5 commits into from
Sep 24, 2024

Commits on Sep 20, 2024

  1. Make gunicorn a session fixture

    Instead of always start/stopping gunicorn at the start/end of an
    integration test session, this makes it a session fixture that tests can
    depend on directly.
    
    The new fixture is defined at the top-level `conftest.py` in order for
    it to be reusable by any part of the test suite.
    lunkwill42 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    e6d1fab View commit details
    Browse the repository at this point in the history
  2. Move test session bootstrap to top-level conftest

    This should be more or less common to all test suites.
    lunkwill42 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    1ff362c View commit details
    Browse the repository at this point in the history
  3. Make webcrawler depend on gunicorn fixture

    This includes removing the unused environment variable TARGETURL, as
    the URL is more or less decided by the gunicorn fixture and not by
    some force external to pytest.
    
    Also cleans up unused imports, and import order of some imports, because
    why not?
    lunkwill42 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    7d52fc2 View commit details
    Browse the repository at this point in the history
  4. Make base_url fixture a proxy for gunicorn

    Most, if not all, the functional tests need a base URL for the web
    server and already depend on the base_url fixture.  The URL is no
    longer received from the environment, but from the gunicorn fixture,
    so this simply makes the base_url fixture a proxy for the gunicorn
    fixture.
    lunkwill42 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    1c4c2f7 View commit details
    Browse the repository at this point in the history
  5. Use urljoin for proper URL joining

    The old code would break down if the base url did not contain a
    trailing slash.  Using `urljoin` should be more robust than joining
    URL strings ourselves.
    lunkwill42 committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    74427b1 View commit details
    Browse the repository at this point in the history