Skip to content

Commit 9e66ed1

Browse files
authored
Re enable more not e2e xfail test cases (#6947)
* Exclude tests for the deprecated tfx/orchestration/experimental/core module from experimental orchestration. * Include additional testdata files in the package build. * Add module-level pytest cleanup functions for proto classes. * Update doc tests to clean up docs before execution.
1 parent c770a51 commit 9e66ed1

19 files changed

+36
-109
lines changed

MANIFEST.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@ include tfx/proto/*.proto
1414
recursive-include tfx/orchestration/kubeflow/v2/testdata *
1515

1616
recursive-include tfx/components/testdata *
17+
recursive-include tfx/orchestration/kubeflow/v2/testdata *
1718

18-
include tfx/examples/imdb/data/
19+
include tfx/examples/imdb/data/*
20+
include tfx/orchestration/beam/testdata/*
21+
include tfx/orchestration/kubeflow/v2/container/testdata/*

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Repository = "https://github.com/tensorflow/tfx"
4040
addopts = "--import-mode=importlib"
4141
testpaths = "tfx"
4242
python_files = "*_test.py"
43-
norecursedirs = ["custom_components", ".*", "*.egg"]
43+
norecursedirs = ["custom_components", ".*", "*.egg", "tfx/orchestration/experimental/core"]
4444
markers = [
4545
"e2e: end-to-end tests which are slow and require more dependencies (deselect with '-m \"not end_to_end\"')",
4646
"serial: mark tests that should not run in parallel",

tfx/dsl/placeholder/proto_placeholder_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
import base64
1717
import functools
18+
import importlib
1819
import os
20+
import pytest
1921
from typing import Any, Optional, TypeVar, Union
2022

2123
import tensorflow as tf
@@ -34,6 +36,13 @@
3436
from google.protobuf import text_format
3537
from ml_metadata.proto import metadata_store_pb2
3638

39+
40+
41+
@pytest.fixture(autouse=True,scope="module")
42+
def cleanup():
43+
yield
44+
importlib.reload(pipeline_pb2)
45+
3746
_ExecutionInvocation = functools.partial(
3847
ph.make_proto, execution_invocation_pb2.ExecutionInvocation()
3948
)

tfx/examples/penguin/experimental/sklearn_predict_extractor_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ def setUp(self):
6969
self._makeExample(age=5.0, language=0.0, label=0),
7070
]
7171

72-
@pytest.mark.xfail(run=False, reason="PR 6889 This test fails and needs to be fixed. "
73-
"If this test passes, please remove this mark.", strict=True)
72+
@pytest.mark.xfail(run=False, reason="This is based on experimental implementation,"
73+
"and the test fails.", strict=True)
7474
def testMakeSklearnPredictExtractor(self):
7575
"""Tests that predictions are made from extracts for a single model."""
7676
feature_extractor = tfma.extractors.FeaturesExtractor(self._eval_config)
@@ -98,8 +98,8 @@ def check_result(actual):
9898

9999
util.assert_that(predict_extracts, check_result)
100100

101-
@pytest.mark.xfail(run=False, reason="PR 6889 This test fails and needs to be fixed. "
102-
"If this test passes, please remove this mark.", strict=True)
101+
@pytest.mark.xfail(run=False, reason="This is based on experimental implementation,"
102+
"and the test fails.", strict=True)
103103
def testMakeSklearnPredictExtractorWithMultiModels(self):
104104
"""Tests that predictions are made from extracts for multiple models."""
105105
eval_config = tfma.EvalConfig(model_specs=[

tfx/examples/ranking/struct2tensor_parsing_utils_test.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717

18-
import pytest
1918
import itertools
2019
import unittest
2120

@@ -172,15 +171,11 @@
172171
]
173172

174173

175-
@pytest.mark.xfail(run=False, reason="PR 6889 This class contains tests that fail and needs to be fixed. "
176-
"If all tests pass, please remove this mark.")
177174
@unittest.skipIf(struct2tensor_parsing_utils is None,
178175
'Cannot import required modules. This can happen when'
179176
' struct2tensor is not available.')
180177
class ELWCDecoderTest(tf.test.TestCase):
181178

182-
#@pytest.mark.xfail(run=False, reason="PR 6889 This test fails and needs to be fixed. "
183-
#"If this test passes, please remove this mark.", strict=True)
184179
def testAllDTypes(self):
185180
context_features = [
186181
struct2tensor_parsing_utils.Feature('ctx.int', tf.int64),

tfx/orchestration/beam/beam_dag_runner_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"""Tests for tfx.orchestration.portable.beam_dag_runner."""
1515

1616

17-
import pytest
1817
import os
1918
from typing import Optional
2019

@@ -172,8 +171,6 @@ def _run_node(self):
172171
_executed_components.append(self._node_id)
173172

174173

175-
@pytest.mark.xfail(run=False, reason="PR 6889 This class contains tests that fail and needs to be fixed. "
176-
"If all tests pass, please remove this mark.")
177174
class BeamDagRunnerTest(test_case_utils.TfxTest):
178175

179176
def setUp(self):

tfx/orchestration/data_types_utils_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
"""Tests for tfx.orchestration.data_types_utils."""
1515

1616

17+
import importlib
18+
import pytest
1719
from absl.testing import parameterized
1820
from tfx import types
1921
from tfx.orchestration import data_types_utils
@@ -32,6 +34,12 @@
3234
_DEFAULT_ARTIFACT_TYPE_NAME = 'Examples'
3335

3436

37+
@pytest.fixture(scope="module", autouse=True)
38+
def cleanup():
39+
yield
40+
importlib.reload(struct_pb2)
41+
42+
3543
def _create_artifact(uri: str) -> types.Artifact:
3644
artifact = types.Artifact(
3745
metadata_store_pb2.ArtifactType(name=_DEFAULT_ARTIFACT_TYPE_NAME))

tfx/orchestration/kubeflow/v2/container/kubeflow_v2_entrypoint_utils_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717

18-
import pytest
1918
import os
2019
from kfp.pipeline_spec import pipeline_spec_pb2 as pipeline_pb2
2120
import tensorflow as tf
@@ -68,8 +67,6 @@
6867
}
6968

7069

71-
@pytest.mark.xfail(run=False, reason="PR 6889 This class contains tests that fail and needs to be fixed. "
72-
"If all tests pass, please remove this mark.")
7370
class KubeflowV2EntrypointUtilsTest(tf.test.TestCase):
7471

7572
def setUp(self):

tfx/orchestration/kubeflow/v2/container/kubeflow_v2_run_executor_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"""Tests for kubeflow_v2_run_executor.py."""
1515

1616

17-
import pytest
1817
import json
1918
import os
2019
from typing import Any, Mapping, Sequence
@@ -100,8 +99,6 @@ def Do(self, input_dict: Mapping[str, Sequence[artifact.Artifact]],
10099
_EXEC_PROPERTIES = {"key_1": "value_1", "key_2": 536870911}
101100

102101

103-
@pytest.mark.xfail(run=False, reason="PR 6889 This class contains tests that fail and needs to be fixed. "
104-
"If all tests pass, please remove this mark.")
105102
class KubeflowV2RunExecutorTest(
106103
test_case_utils.TfxTest, parameterized.TestCase
107104
):

tfx/orchestration/kubeflow/v2/file_based_example_gen/driver_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515

1616

17-
import pytest
1817
import json
1918
import os
2019

@@ -93,8 +92,6 @@ def _load_test_file(filename: str):
9392
).read()
9493

9594

96-
@pytest.mark.xfail(run=False, reason="PR 6889 This class contains tests that fail and needs to be fixed. "
97-
"If all tests pass, please remove this mark.")
9895
class RunDriverTest(test_case_utils.TfxTest, parameterized.TestCase):
9996

10097
def setUp(self):

0 commit comments

Comments
 (0)