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

Another small fix of system tests #138

Open
wants to merge 1 commit 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
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
DAG_ID = "dataproc_batch_ps"
PROJECT_ID = os.environ.get("SYSTEM_TESTS_GCP_PROJECT") or DEFAULT_GCP_SYSTEM_TEST_PROJECT_ID
BUCKET_NAME = f"bucket_{DAG_ID}_{ENV_ID}".replace("-", "_")
REGION = "europe-north1"
REGION = "us-east4"
CLUSTER_NAME_BASE = f"cluster-{DAG_ID}".replace("_", "-")
CLUSTER_NAME_FULL = CLUSTER_NAME_BASE + f"-{ENV_ID}".replace("_", "-")
CLUSTER_NAME = CLUSTER_NAME_BASE if len(CLUSTER_NAME_FULL) >= 33 else CLUSTER_NAME_FULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
CLUSTER_NAME_BASE = f"{DAG_ID}".replace("_", "-")
CLUSTER_NAME_FULL = CLUSTER_NAME_BASE + f"-{ENV_ID}".replace("_", "-")
CLUSTER_NAME = CLUSTER_NAME_BASE if len(CLUSTER_NAME_FULL) >= 33 else CLUSTER_NAME_FULL
REGION = "europe-north1"
REGION = "us-east4"

# Cluster definition
CLUSTER_CONFIG = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
CLUSTER_NAME_BASE = f"cluster-{DAG_ID}".replace("_", "-")
CLUSTER_NAME_FULL = CLUSTER_NAME_BASE + f"-{ENV_ID}".replace("_", "-")
CLUSTER_NAME = CLUSTER_NAME_BASE if len(CLUSTER_NAME_FULL) >= 33 else CLUSTER_NAME_FULL
REGION = "europe-north1"
REGION = "us-east4"


# Cluster definition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
environment={
"tempLocation": f"gs://{BUCKET_NAME}/tmp",
},
location="us-central1",
location="us-east4",
append_job_name=False,
trigger_rule=TriggerRule.ALL_DONE,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
VIDEO_DATA_CONFIG = [
{
"import_schema_uri": schema.dataset.ioformat.video.classification,
"gcs_source": {"uris": [f"gs://{RESOURCE_DATA_BUCKET}/vertex-ai/datasets/video-dataset.csv"]},
"gcs_source": {"uris": [f"gs://{RESOURCE_DATA_BUCKET}/automl/datasets/video/classification.csv"]},
},
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,13 @@ def delete_connection(connection_id: str) -> None:

# This test needs watcher in order to properly mark success/failure
# when "tearDown" task with trigger rule is part of the DAG
list(dag.tasks) >> watcher()

# Excluding sensor because we expect it to fail due to cancelled operation
[
task
for task in dag.tasks
if task.task_id not in ["insert_conversion", "update_conversion", "delete_connection"]
] >> watcher()

from tests_common.test_utils.system_tests import get_test_run # noqa: E402

Expand Down
5 changes: 3 additions & 2 deletions scripts/ci/pre_commit/check_system_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
errors: list[str] = []

WATCHER_APPEND_INSTRUCTION = "list(dag.tasks) >> watcher()"
WATCHER_APPEND_INSTRUCTION_SHORT = " >> watcher()"

PYTEST_FUNCTION = """
from tests_common.test_utils.system_tests import get_test_run # noqa: E402
Expand All @@ -52,13 +53,13 @@
def _check_file(file: Path):
content = file.read_text()
if "from tests_common.test_utils.watcher import watcher" in content:
index = content.find(WATCHER_APPEND_INSTRUCTION)
index = content.find(WATCHER_APPEND_INSTRUCTION_SHORT)
if index == -1:
errors.append(
f"[red]The example {file} imports tests_common.test_utils.watcher "
f"but does not use it properly![/]\n\n"
"[yellow]Make sure you have:[/]\n\n"
f" {WATCHER_APPEND_INSTRUCTION}\n\n"
f" {WATCHER_APPEND_INSTRUCTION_SHORT}\n\n"
"[yellow]as the last instruction in your example DAG.[/]\n"
)
else:
Expand Down
Loading