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

test: skip source-faker tests on Python 3.12 (do not merge) #609

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
310 changes: 157 additions & 153 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ version = "0.0.0"
enable = true

[tool.poetry.dependencies]
python = ">=3.10,<3.12"
python = ">=3.10,<3.13"

airbyte-api = "^0.52.1"
airbyte-cdk = "^6.28.0"
Expand Down
6 changes: 6 additions & 0 deletions tests/integration_tests/cloud/test_cloud_workspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

from __future__ import annotations

import sys
import pytest
import airbyte as ab
from airbyte.cloud import CloudWorkspace
from airbyte.cloud.connections import CloudConnection
Expand All @@ -25,6 +27,10 @@ def test_deploy_destination(
cloud_workspace.permanently_delete_destination(cloud_destination)


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_deploy_source(
cloud_workspace: CloudWorkspace,
) -> None:
Expand Down
8 changes: 8 additions & 0 deletions tests/integration_tests/test_all_cache_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ def add_venv_bin_to_path(monkeypatch):


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_faker_seed_a() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
source = get_source(
Expand All @@ -79,6 +83,10 @@ def source_faker_seed_a() -> ab.Source:


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_faker_seed_b() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
source = get_source(
Expand Down
13 changes: 13 additions & 0 deletions tests/integration_tests/test_config_change_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from __future__ import annotations

import sys
import pytest
from typing import Any
from unittest.mock import patch
Expand Down Expand Up @@ -35,6 +36,10 @@ def new_duckdb_destination() -> Destination:


@pytest.fixture
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def new_source_faker() -> Source:
return get_source(
"source-faker",
Expand All @@ -49,6 +54,10 @@ def new_source_faker() -> Source:
)


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_source_config_callback(
new_duckdb_destination: Destination,
new_source_faker: Source,
Expand Down Expand Up @@ -76,6 +85,10 @@ def test_source_config_callback(
mock_config_change_callback.assert_called_once_with(updated_config)


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_destination_config_callback(
new_duckdb_destination: Destination,
new_source_faker: Source,
Expand Down
9 changes: 9 additions & 0 deletions tests/integration_tests/test_docker_executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from __future__ import annotations

import sys
import tempfile
from collections.abc import Generator
from pathlib import Path
Expand All @@ -30,6 +31,10 @@


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_docker_faker_seed_a() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
source = ab.get_source(
Expand All @@ -46,6 +51,10 @@ def source_docker_faker_seed_a() -> ab.Source:


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_docker_faker_seed_b() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
source = ab.get_source(
Expand Down
12 changes: 12 additions & 0 deletions tests/integration_tests/test_duckdb_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def add_venv_bin_to_path(monkeypatch):
monkeypatch.setenv("PATH", new_path)


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def setup_source_faker() -> ab.Source:
"""Test the source-faker setup."""
source = ab.get_source(
Expand All @@ -62,11 +66,19 @@ def setup_source_faker() -> ab.Source:


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_faker() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
return setup_source_faker()


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_setup_source_faker() -> None:
"""Test that fixture logic works as expected."""
source = setup_source_faker()
Expand Down
36 changes: 36 additions & 0 deletions tests/integration_tests/test_source_faker_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ def add_venv_bin_to_path(monkeypatch):


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_faker_seed_a() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
source = ab.get_source(
Expand All @@ -69,6 +73,10 @@ def source_faker_seed_a() -> ab.Source:


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_faker_seed_b() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
source = ab.get_source(
Expand Down Expand Up @@ -109,6 +117,10 @@ def all_cache_types(
]


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_faker_pks(
source_faker_seed_a: ab.Source,
duckdb_cache: DuckDBCache,
Expand All @@ -130,6 +142,10 @@ def test_faker_pks(


@pytest.mark.slow
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_replace_strategy(
source_faker_seed_a: ab.Source,
all_cache_types: list[CacheBase],
Expand All @@ -147,6 +163,10 @@ def test_replace_strategy(


@pytest.mark.slow
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_append_strategy(
source_faker_seed_a: ab.Source,
all_cache_types: list[CacheBase],
Expand All @@ -168,6 +188,10 @@ def test_append_strategy(

@pytest.mark.slow
@pytest.mark.parametrize("strategy", ["merge", "auto"])
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_merge_strategy(
strategy: str,
source_faker_seed_a: ab.Source,
Expand Down Expand Up @@ -205,6 +229,10 @@ def test_merge_strategy(
assert len(list(result.cache.streams["purchases"])) == FAKER_SCALE_B


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_incremental_sync(
source_faker_seed_a: ab.Source,
source_faker_seed_b: ab.Source,
Expand Down Expand Up @@ -236,10 +264,18 @@ def test_incremental_sync(
assert len(list(result2.cache.streams["purchases"])) == FAKER_SCALE_A


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_config_spec(source_faker_seed_a: ab.Source) -> None:
assert source_faker_seed_a.config_spec


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_example_config_file(source_faker_seed_a: ab.Source) -> None:
with tempfile.NamedTemporaryFile(mode="w+", delete=False) as temp:
source_faker_seed_a.print_config_spec(
Expand Down
21 changes: 21 additions & 0 deletions tests/integration_tests/test_state_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from __future__ import annotations

import sys
from pathlib import Path

import airbyte as ab
Expand All @@ -28,6 +29,10 @@


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_faker_seed_a() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
source = ab.get_source(
Expand All @@ -43,6 +48,10 @@ def source_faker_seed_a() -> ab.Source:


@pytest.fixture(scope="function") # Each test gets a fresh source-faker instance.
@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def source_faker_seed_b() -> ab.Source:
"""Fixture to return a source-faker connector instance."""
source = ab.get_source(
Expand All @@ -57,6 +66,10 @@ def source_faker_seed_b() -> ab.Source:
return source


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_incremental_state_cache_persistence(
source_faker_seed_a: ab.Source,
source_faker_seed_b: ab.Source,
Expand Down Expand Up @@ -88,6 +101,10 @@ def test_incremental_state_cache_persistence(
assert state_provider.get_stream_state("purchases")


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_incremental_state_prefix_isolation(
source_faker_seed_a: ab.Source,
source_faker_seed_b: ab.Source,
Expand Down Expand Up @@ -166,6 +183,10 @@ def e2e_test_destination() -> ab.Destination:
)


@pytest.mark.skipif(
sys.version_info >= (3, 12),
reason="source-faker is not yet compatible with Python 3.12",
)
def test_destination_state(
source_faker_seed_a: ab.Source,
e2e_test_destination: ab.Destination,
Expand Down
Loading