diff --git a/tox.ini b/tox.ini index 6a54b437098..7db91c03669 100644 --- a/tox.ini +++ b/tox.ini @@ -21,6 +21,7 @@ envlist = syft.test.security syft.test.unit syft.test.scenario + stack.test.scenario.sync.k8s syft.test.notebook syft.test.notebook.scenario syft.test.notebook.scenario.sync @@ -1564,3 +1565,46 @@ commands_post = bash -c "CLUSTER_NAME=${DATASITE_CLUSTER_NAME} tox -e dev.k8s.destroy || true" bash -c 'rm -f ${MIGRATION_DATA_DIR}/migration.blob' bash -c 'rm -f ${MIGRATION_DATA_DIR}/migration.yaml' + + +[testenv:stack.test.scenario.sync.k8s] +description = Big Query Scenario Tests with Syncing (Level 0)over k8s +deps = + -e{toxinidir}/packages/syft[dev,data_science] + pytest-asyncio + pytest-timeout + anyio + unsync +changedir = {toxinidir}/tests/scenarios +allowlist_externals = + tox + bash +setenv = + CLUSTER_NAME_HIGH = {env:CLUSTER_NAME_HIGH:bigquery-high} + CLUSTER_NAME_LOW = {env:CLUSTER_NAME_LOW:bigquery-low} + CLUSTER_HTTP_PORT_HIGH={env:CLUSTER_HTTP_PORT_HIGH:8080} + CLUSTER_HTTP_PORT_LOW={env:CLUSTER_HTTP_PORT_LOW:8081} +commands = + # destroy high and low side big query clusters + bash -c "echo Running highlow with ORCHESTRA_DEPLOYMENT_TYPE=$ORCHESTRA_DEPLOYMENT_TYPE DEV_MODE=$DEV_MODE TEST_NOTEBOOK_PATHS=$TEST_NOTEBOOK_PATHS; date" + bash -c 'CLUSTER_NAME_HIGH=${CLUSTER_NAME_HIGH} CLUSTER_NAME_LOW=${CLUSTER_NAME_LOW} tox -e dev.k8s.destroy.datasite.highlow' + bash -c "k3d registry delete k3d-registry.localhost || true" + bash -c "docker volume rm k3d-${CLUSTER_NAME_HIGH}-images --force || true" + bash -c "docker volume rm k3d-${CLUSTER_NAME_LOW}-images --force || true" + + # Now create high and low side big query clusters + bash -c '\ + export CLUSTER_NAME_HIGH=${CLUSTER_NAME_HIGH} \ + CLUSTER_NAME_LOW=${CLUSTER_NAME_LOW} \ + CLUSTER_PORT_HIGH=${CLUSTER_PORT_HIGH} \ + CLUSTER_PORT_LOW=${CLUSTER_PORT_LOW} && \ + tox -e dev.k8s.launch.datasite.highlow' + + # Run level 0 tests with k8s + pytest -s --disable-warnings bigquery/level_0_test.py + + # Clean up again + bash -c 'CLUSTER_NAME_HIGH=${CLUSTER_NAME_HIGH} CLUSTER_NAME_LOW=${CLUSTER_NAME_LOW} tox -e dev.k8s.destroy.datasite.highlow' + bash -c "k3d registry delete k3d-registry.localhost || true" + bash -c "docker volume rm k3d-${CLUSTER_NAME_HIGH}-images --force || true" + bash -c "docker volume rm k3d-${CLUSTER_NAME_LOW}-images --force || true"