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

Fix conditional execution on populate schema action #998

Merged
merged 2 commits into from
Jan 26, 2024
Merged
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 @@ -16,13 +16,12 @@ on:
env:
# Unclear on how to make 'Reload Test Data in SQL Engines' a constant here as it does not work here.
PYTHON_VERSION: "3.8"
ADDITIONAL_PYTEST_OPTIONS: "--log-cli-level info"

jobs:
snowflake-populate:
environment: DW_INTEGRATION_TESTS
if: >
github.event.action == 'workflow_dispatch'
|| (github.event.action == 'labeled' && github.event.label.name == 'Reload Test Data in SQL Engines')
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'Reload Test Data in SQL Engines' }}
name: Snowflake
runs-on: ubuntu-latest
steps:
Expand All @@ -36,14 +35,13 @@ jobs:
mf_sql_engine_url: ${{ secrets.MF_SNOWFLAKE_URL }}
mf_sql_engine_password: ${{ secrets.MF_SNOWFLAKE_PWD }}
parallelism: 1
additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }}
make-target: "populate-persistent-source-schema-snowflake"

redshift-populate:
environment: DW_INTEGRATION_TESTS
name: Redshift
if: >
github.event.action == 'workflow_dispatch'
|| (github.event.action == 'labeled' && github.event.label.name == 'Reload Test Data in SQL Engines')
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'Reload Test Data in SQL Engines' }}
runs-on: ubuntu-latest
steps:
- name: Check-out the repo
Expand All @@ -56,14 +54,13 @@ jobs:
mf_sql_engine_url: ${{ secrets.MF_REDSHIFT_URL }}
mf_sql_engine_password: ${{ secrets.MF_REDSHIFT_PWD }}
parallelism: 1
additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }}
make-target: "populate-persistent-source-schema-redshift"

bigquery-populate:
environment: DW_INTEGRATION_TESTS
name: BigQuery
if: >
github.event.action == 'workflow_dispatch'
|| (github.event.action == 'labeled' && github.event.label.name == 'Reload Test Data in SQL Engines')
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'Reload Test Data in SQL Engines' }}
runs-on: ubuntu-latest
steps:
- name: Check-out the repo
Expand All @@ -76,14 +73,13 @@ jobs:
MF_SQL_ENGINE_URL: ${{ secrets.MF_BIGQUERY_URL }}
MF_SQL_ENGINE_PASSWORD: ${{ secrets.MF_BIGQUERY_PWD }}
parallelism: 1
additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }}
make-target: "populate-persistent-source-schema-bigquery"

databricks-populate:
environment: DW_INTEGRATION_TESTS
name: Databricks SQL Warehouse
if: >
github.event.action == 'workflow_dispatch'
|| (github.event.action == 'labeled' && github.event.label.name == 'Reload Test Data in SQL Engines')
if: ${{ github.event.action != 'labeled' || github.event.label.name == 'Reload Test Data in SQL Engines' }}
runs-on: ubuntu-latest
steps:
- name: Check-out the repo
Expand All @@ -96,6 +92,7 @@ jobs:
mf_sql_engine_url: ${{ secrets.MF_DATABRICKS_URL }}
mf_sql_engine_password: ${{ secrets.MF_DATABRICKS_PWD }}
parallelism: 1
additional-pytest-options: ${{ env.ADDITIONAL_PYTEST_OPTIONS }}
make-target: "populate-persistent-source-schema-databricks"

remove-label:
Expand Down
2 changes: 1 addition & 1 deletion metricflow/test/populate_persistent_source_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def populate_schemas(test_configuration: MetricFlowTestConfiguration) -> None:
os.environ["MF_TEST_ADAPTER_TYPE"] = engine_name
hatch_env = f"{engine_name}-env"
run_command(
f"hatch -v run {hatch_env}:pytest -vv --use-persistent-source-schema "
f"hatch -v run {hatch_env}:pytest -vv --log-cli-level info --use-persistent-source-schema "
"metricflow/test/source_schema_tools.py::populate_source_schema"
)
else:
Expand Down
Loading