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

Fix tests #1198

Closed
wants to merge 4 commits into from
Closed

Fix tests #1198

wants to merge 4 commits into from

Commits on Jun 24, 2022

  1. Fix test docker

    The Dockerfile did not work as is, because the dependencies in
    requirements.txt are newer than the stretch-image with its python v3.5
    can support/run. Use stable debian with the lts nodejs instead, plus
    had to add some libs to make the wheel build succeed.
    jsonschema v4 breaks things, so its version needs to be pinned until
    bravado is fixed [0].
    
    [0] https://github.com/Yelp/bravado-core/pull/385/files#r731674447
    corubba committed Jun 24, 2022
    Configuration menu
    Copy the full SHA
    db53e4b View commit details
    Browse the repository at this point in the history
  2. Fix tests

    Increased the version of pytest to make it work with py 3.10 [0].
    The GET calls no longer return list but the object itself, fixed the
    tests and assertions to account for that. The tests did not account for
    the later added `allow_user_remove_domain` setting. And there were
    issues with missing and non-stopped patchers/mocks.
    
    Now all tests are at least passing.
    
    [0] pytest-dev/pytest#8540
    corubba committed Jun 24, 2022
    Configuration menu
    Copy the full SHA
    83bbb57 View commit details
    Browse the repository at this point in the history
  3. Fix broken code

    PR #1089 is the culprit, as was already predicted in the review.
    corubba committed Jun 24, 2022
    Configuration menu
    Copy the full SHA
    be4745a View commit details
    Browse the repository at this point in the history
  4. Cleanup

    The `unit/apikey` directory is removed because it does not contain any
    tests. Same for `unit/test_decorators.py`.
    The `fixture` module is renamed to the special-name `conftest` [0] so
    they are available in all tests without the need to import them. With
    that in place, I removed all now unneeded or previously already unused
    imports from the tests.
    Also removed that wierd `sys.path` bit from `unit/zone/test_admin_apikey.py`,
    no idea what that was originally intended for.
    
    [0] https://docs.pytest.org/en/6.2.x/fixture.html#conftest-py-sharing-fixtures-across-multiple-files
    corubba committed Jun 24, 2022
    Configuration menu
    Copy the full SHA
    9fde6c6 View commit details
    Browse the repository at this point in the history