-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an "environment" key to EcsRunLauncher / EcsContainerContext that…
… sets env vars (#8243) Summary: Lets you pass in a set of key-value pairs to be injected into the container.
- Loading branch information
Showing
18 changed files
with
259 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
python_modules/dagster/dagster_tests/core_tests/test_utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import pytest | ||
|
||
from dagster.core.test_utils import environ | ||
from dagster.core.utils import parse_env_var | ||
|
||
|
||
def test_parse_env_var_no_equals(): | ||
|
||
env_var = "FOO_ENV_VAR" | ||
|
||
with pytest.raises( | ||
Exception, match="Tried to load environment variable FOO_ENV_VAR, but it was not set" | ||
): | ||
parse_env_var(env_var) | ||
|
||
with environ({"FOO_ENV_VAR": "BAR_VALUE"}): | ||
assert parse_env_var(env_var) == ("FOO_ENV_VAR", "BAR_VALUE") | ||
|
||
|
||
def test_parse_env_var_equals(): | ||
env_var = "FOO_ENV_VAR=BAR_VALUE" | ||
assert parse_env_var(env_var) == ("FOO_ENV_VAR", "BAR_VALUE") | ||
|
||
|
||
def test_parse_env_var_containing_equals(): | ||
env_var = "FOO_ENV_VAR=HERE_COMES_THE_EQUALS=THERE_IT_WENT" | ||
|
||
assert parse_env_var(env_var) == ("FOO_ENV_VAR", "HERE_COMES_THE_EQUALS=THERE_IT_WENT") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.