From 702fad9be2625826f3e7c1cad3c2ceefbb420ac9 Mon Sep 17 00:00:00 2001 From: Colton Loftus <70598503+C-Loftus@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:51:39 -0500 Subject: [PATCH] fix tty --- main.py | 2 +- userCode/test/test_e2e.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 8cc6fdec..c145c271 100644 --- a/main.py +++ b/main.py @@ -112,7 +112,7 @@ def test(): containerName = containerName.strip() # Container name sometimes has extra \n # If we are in CI/CD we need to skip the interactive / terminal flags - if sys.stdin.isatty(): + if not sys.stdin.isatty(): run_subprocess(f"docker exec {containerName} pytest") else: run_subprocess(f"docker exec -it {containerName} pytest") diff --git a/userCode/test/test_e2e.py b/userCode/test/test_e2e.py index 3e760c3f..7bb26375 100644 --- a/userCode/test/test_e2e.py +++ b/userCode/test/test_e2e.py @@ -2,9 +2,20 @@ import userCode.main as main +from dagster import AssetsDefinition, AssetSpec, SourceAsset + + def test_materialize_configs(): + assets = load_assets_from_modules([main]) + # It is possible to load certain asset types that cannot be passed into + # Materialize so we filter them to avoid a pyright type error + filtered_assets = [ + asset + for asset in assets + if isinstance(asset, (AssetsDefinition, AssetSpec, SourceAsset)) + ] result = materialize( - assets=load_assets_from_modules([main]), # type: ignore + assets=filtered_assets, selection=["nabu_config", "gleaner_config", "docker_client_environment"], ) assert result.success