Skip to content

Commit badff58

Browse files
authored
Remove db_tests from openlineage provider (#52239)
Part of #52020 Still some tests left.
1 parent cf0e404 commit badff58

File tree

8 files changed

+3
-19
lines changed

8 files changed

+3
-19
lines changed

providers/openlineage/tests/unit/openlineage/extractors/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
if TYPE_CHECKING:
4040
from openlineage.client.facet_v2 import RunFacet
41-
pytestmark = pytest.mark.db_test
41+
4242

4343
INPUTS = [Dataset(namespace="database://host:port", name="inputtable")]
4444
OUTPUTS = [Dataset(namespace="database://host:port", name="inputtable")]

providers/openlineage/tests/unit/openlineage/extractors/test_bash.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from datetime import datetime
2222
from unittest.mock import patch
2323

24-
import pytest
2524
from openlineage.client.facet_v2 import source_code_job
2625

2726
from airflow import DAG
@@ -30,8 +29,6 @@
3029

3130
from tests_common.test_utils.compat import BashOperator
3231

33-
pytestmark = pytest.mark.db_test
34-
3532
with DAG(
3633
dag_id="test_dummy_dag",
3734
description="Test dummy DAG",

providers/openlineage/tests/unit/openlineage/extractors/test_manager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ def get_openlineage_facets_on_start(self):
324324
assert metadata.outputs == []
325325

326326

327-
@pytest.mark.db_test
328327
@pytest.mark.skipif(
329328
AIRFLOW_V_3_0_PLUS,
330329
reason="Test for hook level lineage in Airflow < 3.0",

providers/openlineage/tests/unit/openlineage/extractors/test_python.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from datetime import datetime
2424
from unittest.mock import patch
2525

26-
import pytest
2726
from openlineage.client.facet_v2 import source_code_job
2827

2928
from airflow import DAG
@@ -32,8 +31,6 @@
3231

3332
from tests_common.test_utils.compat import BashOperator, PythonOperator
3433

35-
pytestmark = pytest.mark.db_test
36-
3734
dag = DAG(
3835
dag_id="test_dummy_dag",
3936
description="Test dummy DAG",

providers/openlineage/tests/unit/openlineage/plugins/test_adapter.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
from tests_common.test_utils.markers import skip_if_force_lowest_dependencies_marker
6060
from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS
6161

62-
pytestmark = pytest.mark.db_test
63-
6462

6563
@pytest.mark.parametrize(
6664
"env_vars, expected_logging",

providers/openlineage/tests/unit/openlineage/plugins/test_execution.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ def setup_job(self, task_name, run_id):
110110

111111
return job_runner.task_runner.return_code(timeout=60)
112112

113-
@pytest.mark.db_test
114113
@conf_vars({("openlineage", "transport"): f'{{"type": "file", "log_file_path": "{listener_path}"}}'})
115114
def test_not_stalled_task_emits_proper_lineage(self):
116115
task_name = "execute_no_stall"
@@ -122,7 +121,6 @@ def test_not_stalled_task_emits_proper_lineage(self):
122121
assert has_value_in_events(events, ["inputs", "name"], "on-start")
123122
assert has_value_in_events(events, ["inputs", "name"], "on-complete")
124123

125-
@pytest.mark.db_test
126124
@conf_vars({("openlineage", "transport"): f'{{"type": "file", "log_file_path": "{listener_path}"}}'})
127125
def test_not_stalled_failing_task_emits_proper_lineage(self):
128126
task_name = "execute_fail"
@@ -139,7 +137,6 @@ def test_not_stalled_failing_task_emits_proper_lineage(self):
139137
("openlineage", "execution_timeout"): "15",
140138
}
141139
)
142-
@pytest.mark.db_test
143140
def test_short_stalled_task_emits_proper_lineage(self):
144141
self.setup_job("execute_short_stall", "test_short_stalled_task_emits_proper_lineage")
145142
events = get_sorted_events(tmp_dir)
@@ -152,7 +149,6 @@ def test_short_stalled_task_emits_proper_lineage(self):
152149
("openlineage", "execution_timeout"): "3",
153150
}
154151
)
155-
@pytest.mark.db_test
156152
def test_short_stalled_task_extraction_with_low_execution_is_killed_by_ol_timeout(self):
157153
self.setup_job(
158154
"execute_short_stall",
@@ -163,7 +159,6 @@ def test_short_stalled_task_extraction_with_low_execution_is_killed_by_ol_timeou
163159
assert not has_value_in_events(events, ["inputs", "name"], "on-complete")
164160

165161
@conf_vars({("openlineage", "transport"): f'{{"type": "file", "log_file_path": "{listener_path}"}}'})
166-
@pytest.mark.db_test
167162
def test_mid_stalled_task_is_killed_by_ol_timeout(self):
168163
self.setup_job("execute_mid_stall", "test_mid_stalled_task_is_killed_by_openlineage")
169164
events = get_sorted_events(tmp_dir)
@@ -177,7 +172,6 @@ def test_mid_stalled_task_is_killed_by_ol_timeout(self):
177172
("core", "task_success_overtime"): "3",
178173
}
179174
)
180-
@pytest.mark.db_test
181175
def test_success_overtime_kills_tasks(self):
182176
# This test checks whether LocalTaskJobRunner kills OL listener which take
183177
# longer time than permitted by core.task_success_overtime setting

providers/openlineage/tests/unit/openlineage/plugins/test_listener.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
from tests_common.test_utils.db import clear_db_runs
4646
from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS
4747

48-
pytestmark = pytest.mark.db_test
49-
5048
EXPECTED_TRY_NUMBER_1 = 1
5149

5250
TRY_NUMBER_BEFORE_EXECUTION = 0
@@ -757,6 +755,7 @@ def test_listener_on_dag_run_state_changes_configure_process_pool_size(
757755
mock_executor.assert_called_once_with(max_workers=expected, initializer=mock.ANY)
758756
mock_executor.return_value.submit.assert_called_once()
759757

758+
@pytest.mark.db_test
760759
@pytest.mark.parametrize(
761760
("method", "dag_run_state"),
762761
[
@@ -1574,6 +1573,7 @@ def test_listener_on_dag_run_state_changes_configure_process_pool_size(
15741573
mock_executor.assert_called_once_with(max_workers=expected, initializer=mock.ANY)
15751574
mock_executor.return_value.submit.assert_called_once()
15761575

1576+
@pytest.mark.db_test
15771577
@pytest.mark.parametrize(
15781578
("method", "dag_run_state"),
15791579
[

providers/openlineage/tests/unit/openlineage/utils/test_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,6 @@ def test_dagrun_info_af3(mocked_dag_versions):
14361436

14371437

14381438
@pytest.mark.skipif(AIRFLOW_V_3_0_PLUS, reason="Airflow 2 test")
1439-
@pytest.mark.db_test
14401439
def test_dagrun_info_af2():
14411440
date = datetime.datetime(2024, 6, 1, tzinfo=datetime.timezone.utc)
14421441
dag = DAG(

0 commit comments

Comments
 (0)