Skip to content

pytest import fails if kubeconfig has invalid OIDC token #5505

@avnig05

Description

@avnig05

Running:
make test tests=src/toil/test/sort/sortTest.py::SortTest::testSort
or
python -m pytest src/toil/test/sort/sortTest.py::SortTest::testSort -vv

fails during import of src/toil/test/conftest.py because src/toil/test/__init__.py calls _is_kubernetes_installed_and_configured(), which calls kubernetes.config.load_kube_config().

Error:
E oauthlib.oauth2.rfc6749.errors.CustomOAuth2Error: ("invalid_token" E error_description="token not found" E )

I likely have a staled/revoked OIDC token in ~/.kube/config (kubectl/kubeconfig present, but creds not valid).
Expected behavior is that this is treated as “kubernetes not usable” and Kubernetes tests are skipped, instead of failing pytest import.

┆Issue is synchronized with this Jira Story
┆Issue Number: TOIL-1829

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions