Skip to content

Commit

Permalink
update for e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
novaturient95 committed Sep 18, 2024
1 parent 532ff5b commit 82959ea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ input_data: ${{inputs.data_input_table}}
task:
code: ../src/batch_score_oss
type: run_function
entry_script: root.main
entry_script: main
# Enable PRS safe append row configuration that is needed when dealing with large outputs with Unicode characters.
# Using --append_row_safe_output true
program_arguments: >-
Expand Down
13 changes: 8 additions & 5 deletions assets/batch_score/components/driver/tests/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
from .util import _get_component_name, _set_and_get_component_name_ver, create_copy


BATCH_SCORE_COMPONENT_YAML_NAME = "batch_score_oss"


# Marks all tests in this directory as e2e tests
@pytest.fixture(autouse=True, params=[pytest.param(None, marks=pytest.mark.e2e)])
def mark_as_e2e_test():
Expand Down Expand Up @@ -129,25 +132,25 @@ def register_components(main_worker_lock, asset_version):
if not _is_main_worker(main_worker_lock):
return

_register_component("batch_score", asset_version)
_register_component(BATCH_SCORE_COMPONENT_YAML_NAME, asset_version)


@pytest.fixture(scope="session")
def batch_score_yml_component(asset_version):
"""Return the component name batch_score.yml."""
return _get_component_metadata("batch_score.yml", asset_version)
return _get_component_metadata(f"{BATCH_SCORE_COMPONENT_YAML_NAME}.yml", asset_version)


@pytest.fixture(scope="session")
def llm_batch_score_yml_component(asset_version):
"""Return the component version for batch_score_llm.yml."""
return _get_component_metadata("batch_score", asset_version)
return _get_component_metadata(BATCH_SCORE_COMPONENT_YAML_NAME, asset_version)


def _register_component(component_yml_name, asset_version):
# Copy component to a temporary file to not muddle dev environments
batch_score_component_filepath = os.path.join(
pytest.source_dir, "assets", "managed_batch_inference", "components", component_yml_name, "spec.yaml"
pytest.source_dir, component_yml_name, "spec.yaml"
)
create_copy(batch_score_component_filepath, pytest.copied_batch_score_component_filepath)

Expand All @@ -169,6 +172,6 @@ def _register_component(component_yml_name, asset_version):

def _get_component_metadata(component_yml_name, asset_version):
batch_score_component_filepath = os.path.join(
pytest.source_dir, "assets", "managed_batch_inference", "components", component_yml_name, "spec.yaml"
pytest.source_dir, component_yml_name, "spec.yaml"
)
return _get_component_name(batch_score_component_filepath), asset_version
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
import os

import pytest
from pathlib import Path
from pydantic.utils import deep_update

from .util import _submit_job_and_monitor_till_completion, set_component

# Common configuration
source_dir = os.getcwd()
gated_llm_pipeline_filepath = os.path.join(source_dir,
"assets", "managed_batch_inference", "components", "tests", "batch_score",
"e2e", "prs_pipeline_templates", "base_llm.yml")
source_dir = Path(__file__).parent
gated_llm_pipeline_filepath = os.path.join(source_dir, "prs_pipeline_templates", "base_llm.yml")

JOB_NAME = "gated_batch_score_llm" # Should be equivalent to base_llm.yml's job name
YAML_COMPONENT = {"jobs": {JOB_NAME: {"component": None}}} # Placeholder for component name set below.
Expand Down Expand Up @@ -54,7 +53,7 @@


@pytest.mark.smoke
@pytest.mark.e2e
# @pytest.mark.e2e
@pytest.mark.timeout(20 * 60)
def test_gated_serverless_endpoint_batch_score_completion(llm_batch_score_yml_component):
"""Test gate for batch score serverless endpoints completion models."""
Expand Down

0 comments on commit 82959ea

Please sign in to comment.