Skip to content

Commit

Permalink
Basic exclusions for DB Isolation mode (apache#41079)
Browse files Browse the repository at this point in the history
After creating the full test harness for the DB isolation mode
in apache#41067, and runnning the whole test suite, this is the result
of first pass of exclusions of those tests that are not relevant
for the DB isolation mode.

Related: apache#41067
  • Loading branch information
potiuk authored Jul 28, 2024
1 parent b6ed1a9 commit 81fcc72
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions tests/always/test_example_dags.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def test_should_be_importable(example: str):
assert len(dagbag.dag_ids) >= 1


@pytest.mark.skip_if_database_isolation_mode
@pytest.mark.db_test
@pytest.mark.parametrize("example", example_not_excluded_dags(xfail_db_exception=True))
def test_should_not_do_database_queries(example: str):
Expand Down
2 changes: 1 addition & 1 deletion tests/api_connexion/endpoints/test_config_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from tests.test_utils.api_connexion_utils import assert_401, create_user, delete_user
from tests.test_utils.config import conf_vars

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


MOCK_CONF = {
Expand Down
2 changes: 1 addition & 1 deletion tests/api_connexion/endpoints/test_connection_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from tests.test_utils.db import clear_db_connections
from tests.test_utils.www import _check_last_log

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion tests/api_experimental/auth/backend/test_basic_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from airflow.exceptions import RemovedInAirflow3Warning
from tests.test_utils.db import clear_db_pools

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


class TestBasicAuth:
Expand Down
2 changes: 1 addition & 1 deletion tests/api_experimental/common/test_mark_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

DEV_NULL = "/dev/null"

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/commands/test_dag_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

# TODO: Check if tests needs side effects - locally there's missing DAG

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


class TestCliDags:
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/commands/test_dag_processor_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from airflow.configuration import conf
from tests.test_utils.config import conf_vars

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


class TestDagProcessorCommand:
Expand Down
2 changes: 1 addition & 1 deletion tests/jobs/test_backfill_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
from tests.test_utils.mock_executor import MockExecutor
from tests.test_utils.timetables import cron_timetable

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
)
from airflow.www.extensions.init_appbuilder import init_appbuilder

pytestmark = pytest.mark.skip_if_database_isolation_mode


@pytest.fixture
def appbuilder():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@
if TYPE_CHECKING:
from airflow.auth.managers.base_auth_manager import ResourceMethod

pytestmark = pytest.mark.skipif(not AIRFLOW_V_2_9_PLUS, reason="Test requires Airflow 2.9+")
pytestmark = [
pytest.mark.skipif(not AIRFLOW_V_2_9_PLUS, reason="Test requires Airflow 2.9+"),
pytest.mark.skip_if_database_isolation_mode,
]

mock = Mock()

Expand Down
2 changes: 1 addition & 1 deletion tests/www/api/experimental/test_dag_runs_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from airflow.models.serialized_dag import SerializedDagModel
from airflow.settings import Session

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


class TestDagRunsEndpoint:
Expand Down
2 changes: 1 addition & 1 deletion tests/www/api/experimental/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, os.pardir, os.pardir)
)

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion tests/www/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from tests.test_utils.config import conf_vars
from tests.test_utils.decorators import dont_initialize_flask_app_submodules

pytestmark = pytest.mark.db_test
pytestmark = [pytest.mark.db_test, pytest.mark.skip_if_database_isolation_mode]


class TestApp:
Expand Down

0 comments on commit 81fcc72

Please sign in to comment.