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

ci: multi-python version docker image for GHA matrix #1002

Conversation

nosahama
Copy link
Contributor

@nosahama nosahama commented Dec 9, 2024

About this change - What it does

Now with the tests running in docker, we add the support to run with multiple python version provided by the github actions matrix.

Note

I suspect that we will have issues with python3.9, a local stacktrace of a startup error faced on python3.9 can be seen below:

ImportError while loading conftest '/opt/karapace/tests/conftest.py'.
tests/conftest.py:6: in <module>
    from karapace.container import KarapaceContainer
src/karapace/container.py:7: in <module>
    from karapace.auth import get_authorizer, HTTPAuthorizer, NoAuthAndAuthz
src/karapace/auth.py:11: in <module>
    from karapace.config import Config, InvalidConfiguration
src/karapace/config.py:30: in <module>
    class Config(BaseSettings):
venv/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py:221: in __new__
    set_model_fields(cls, bases, config_wrapper, ns_resolver)
venv/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py:593: in set_model_fields
    fields, class_vars = collect_model_fields(cls, bases, config_wrapper, ns_resolver, typevars_map=typevars_map)
venv/lib/python3.9/site-packages/pydantic/_internal/_fields.py:112: in collect_model_fields
    type_hints = _typing_extra.get_model_type_hints(cls, ns_resolver=ns_resolver)
venv/lib/python3.9/site-packages/pydantic/_internal/_typing_extra.py:509: in get_model_type_hints
    hints[name] = try_eval_type(value, globalns, localns)
venv/lib/python3.9/site-packages/pydantic/_internal/_typing_extra.py:558: in try_eval_type
    return eval_type_backport(value, globalns, localns), True
venv/lib/python3.9/site-packages/pydantic/_internal/_typing_extra.py:609: in eval_type_backport
    return _eval_type_backport(value, globalns, localns, type_params)
venv/lib/python3.9/site-packages/pydantic/_internal/_typing_extra.py:641: in _eval_type_backport
    raise TypeError(
E   TypeError: Unable to evaluate type annotation 'str | None'. If you are making use of the new typing syntax (unions using `|` since Python 3.10 or builtins subscripting since Python 3.9), you should either replace the use of new syntax with the existing `typing` constructs or install the `eval_type_backport` package.

Even with the eval_type_backport library installed, other things started to fail and also the integration tests started to fail.
Let's monitor the CI and see what comes up.

@nosahama nosahama requested review from a team as code owners December 9, 2024 12:37
@nosahama nosahama changed the base branch from main to jjaakola-aiven-fastapi December 9, 2024 12:37
@nosahama nosahama force-pushed the nosahama/EC-666/docker-tests-multi-python-version branch 10 times, most recently from 97dae0a to 59d3a1a Compare December 9, 2024 16:25
Copy link

github-actions bot commented Dec 9, 2024

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/karapace
  schema_reader.py
  src/karapace/kafka
  consumer.py
Project Total  

This report was generated by python-coverage-comment-action

@nosahama nosahama force-pushed the nosahama/EC-666/docker-tests-multi-python-version branch 3 times, most recently from faed84d to fe0f070 Compare December 10, 2024 12:07
@nosahama nosahama force-pushed the nosahama/EC-666/docker-tests-multi-python-version branch from fe0f070 to fd25e2a Compare December 10, 2024 13:02
@jjaakola-aiven jjaakola-aiven merged commit 1a4095a into jjaakola-aiven-fastapi Dec 10, 2024
10 checks passed
@jjaakola-aiven jjaakola-aiven deleted the nosahama/EC-666/docker-tests-multi-python-version branch December 10, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants