diff --git a/.buildkite/dagster-buildkite/dagster_buildkite/steps/dagster.py b/.buildkite/dagster-buildkite/dagster_buildkite/steps/dagster.py --- a/.buildkite/dagster-buildkite/dagster_buildkite/steps/dagster.py +++ b/.buildkite/dagster-buildkite/dagster_buildkite/steps/dagster.py @@ -275,6 +275,7 @@ ModuleBuildSpec( "python_modules/dagster-graphql", tox_env_suffixes=[ + "-not_graphql_context_test_suite", "-in_memory_instance_hosted_user_process_env", "-in_memory_instance_multi_location", "-in_memory_instance_managed_grpc_env", @@ -292,7 +293,7 @@ tox_file="tox_postgres.ini", buildkite_label="dagster-graphql-postgres", tox_env_suffixes=[ - "-not_graphql_context_test_suite", + "-variant", "-postgres_instance_hosted_user_process_env", "-postgres_instance_multi_location", "-postgres_instance_managed_grpc_env", diff --git a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graphql_context_test_suite.py b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graphql_context_test_suite.py --- a/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graphql_context_test_suite.py +++ b/python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_graphql_context_test_suite.py @@ -8,8 +8,11 @@ from .graphql_context_test_suite import GraphQLContextVariant, manage_graphql_context +@pytest.mark.variant @pytest.mark.parametrize("variant", GraphQLContextVariant.all_readonly_variants()) def test_readonly_variants(variant): + # Note: This mark is only run in the `tox_postgres.ini` file and not the default `tox.ini` + # file because 3 of the variants have a postgres dependency assert isinstance(variant, GraphQLContextVariant) with manage_graphql_context(variant) as context: assert isinstance(context.instance.run_launcher, ExplodingRunLauncher) diff --git a/python_modules/dagster-graphql/pytest.ini b/python_modules/dagster-graphql/pytest.ini --- a/python_modules/dagster-graphql/pytest.ini +++ b/python_modules/dagster-graphql/pytest.ini @@ -1,5 +1,6 @@ [pytest] markers = + variant: in_memory_instance: Uses an in-memory instance. sqlite_instance: Uses a sqlite instance. postgres_instance: Uses a postgres instance. diff --git a/python_modules/dagster-graphql/tox.ini b/python_modules/dagster-graphql/tox.ini --- a/python_modules/dagster-graphql/tox.ini +++ b/python_modules/dagster-graphql/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{38,37,36,27}-{unix,windows}-{in_memory_instance_hosted_user_process_env,in_memory_instance_multi_location,sqlite_instance_multi_location,in_memory_instance_managed_grpc_env,sqlite_instance_managed_grpc_env,sqlite_instance_deployed_grpc_env},pylint +envlist = py{38,37,36,27}-{unix,windows}-{not_graphql_context_test_suite,in_memory_instance_hosted_user_process_env,in_memory_instance_multi_location,sqlite_instance_multi_location,in_memory_instance_managed_grpc_env,sqlite_instance_managed_grpc_env,sqlite_instance_deployed_grpc_env},pylint [testenv] @@ -15,6 +15,7 @@ !windows: /bin/bash -c '! pip list --exclude-editable | grep -e dagster -e dagit' coverage erase echo -e "--- \033[0;32m:pytest: Running tox tests\033[0m" + not_graphql_context_test_suite: pytest -m "not graphql_context_test_suite and not variant" -vv --junitxml=dagster_graphql_test_results.xml --cov=dagster_graphql --cov-append --cov-report= {posargs} in_memory_instance_hosted_user_process_env: pytest -m "graphql_context_test_suite and in_memory_instance and hosted_user_process_env" -vv --junitxml=dagster_graphql_test_results.xml --cov=dagster_graphql --cov-append --cov-report= {posargs} in_memory_instance_multi_location: pytest -m "graphql_context_test_suite and in_memory_instance and multi_location" -vv --junitxml=dagster_graphql_test_results.xml --cov=dagster_graphql --cov-append --cov-report= {posargs} in_memory_instance_managed_grpc_env: pytest -m "graphql_context_test_suite and in_memory_instance and managed_grpc_env" -vv --junitxml=dagster_graphql_test_results.xml --cov=dagster_graphql --cov-append --cov-report= {posargs} diff --git a/python_modules/dagster-graphql/tox_postgres.ini b/python_modules/dagster-graphql/tox_postgres.ini --- a/python_modules/dagster-graphql/tox_postgres.ini +++ b/python_modules/dagster-graphql/tox_postgres.ini @@ -14,7 +14,6 @@ commands = !windows: /bin/bash -c '! pip list --exclude-editable | grep -e dagster -e dagit' echo -e "--- \033[0;32m:pytest: Running tox tests\033[0m" - not_graphql_context_test_suite: pytest -m "not graphql_context_test_suite" -vv --junitxml=dagster_graphql_test_results.xml --cov=dagster_graphql --cov-append --cov-report= {posargs} postgres_instance_hosted_user_process_env: pytest -m "graphql_context_test_suite and postgres_instance and hosted_user_process_env" -vv --junitxml=dagster_graphql_test_results.xml --cov=dagster_graphql --cov-append --cov-report= {posargs} postgres_instance_multi_location: pytest -m "graphql_context_test_suite and postgres_instance and multi_location" -vv --junitxml=dagster_graphql_test_results.xml --cov=dagster_graphql --cov-append --cov-report= {posargs} postgres_instance_managed_grpc_env: pytest -m "graphql_context_test_suite and postgres_instance and managed_grpc_env" -vv --junitxml=dagster_graphql_test_results.xml --cov=dagster_graphql --cov-append --cov-report= {posargs}