Skip to content

Commit

Permalink
update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
novaturient95 committed Sep 25, 2024
1 parent 7b65dd2 commit a57015a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/batch-score-oss-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
RESOURCE_GROUP: ${{ env.resource_group }}
WORKSPACE_NAME: ${{ env.workspace }}
- name: Run e2e tests
run: python -m pytest --junitxml=${{ env.pytest_report_folder }}/${{ env.pytest_report_file }} ${{ env.testsRootPath }} --strict-markers -v -s -m "smoke" -o log_level=DEBUG -n 8
run: python -m pytest --junitxml=${{ env.pytest_report_folder }}/${{ env.pytest_report_file }} ${{ env.testsRootPath }} --strict-markers -v -s -m "smoke" -o log_level=DEBUG -o log_cli=true -n 8
env:
SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
Expand Down
25 changes: 11 additions & 14 deletions assets/batch_score_oss/components/driver/tests/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@


BATCH_SCORE_COMPONENT_YAML_NAME = "batch_score_oss"
COMPONENT_VERSION = datetime.now().strftime("%m_%d_%Y_%H_%M_%S")


# Marks all tests in this directory as e2e tests
Expand Down Expand Up @@ -67,9 +66,6 @@ def pytest_configure():

pytest.copied_batch_score_component_filepath = os.path.join(tmp_dir, f"spec_copy_{str(uuid.uuid4())}.yml")

# register components
register_components()


def pytest_unconfigure():
"""Tear down pytest configuration."""
Expand All @@ -82,9 +78,10 @@ def pytest_unconfigure():
pass


def register_components():
"""Register components for the tests."""
_register_component(BATCH_SCORE_COMPONENT_YAML_NAME, COMPONENT_VERSION)
@pytest.fixture(scope="session")
def asset_version():
"""Return the asset version for this run."""
return datetime.now().strftime("%m_%d_%Y_%H_%M_%S")


def _register_component(component_yml_name, asset_version):
Expand All @@ -111,13 +108,13 @@ def _register_component(component_yml_name, asset_version):


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


def _get_component_metadata(component_yml_name, asset_version):
batch_score_component_filepath = os.path.join(
pytest.source_dir, component_yml_name, "spec.yaml"
)
return _get_component_name(batch_score_component_filepath), asset_version
def _register_and_return_component_metadata(component_yml_name, asset_version):
return _register_component(component_yml_name, asset_version)

0 comments on commit a57015a

Please sign in to comment.