-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[dagster-gcp] live tests #26761
base: master
Are you sure you want to change the base?
[dagster-gcp] live tests #26761
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
54adede
to
d619329
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a direct copy paste from azure tests
module: dagster_gcp.gcs.compute_log_manager | ||
class: GCSComputeLogManager | ||
config: | ||
json_credentials_envvar: GCP_LIVE_TEST_CREDENTIALS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are new creds I created for this test suite
subprocess.run( | ||
["dagster", "asset", "materialize", "--select", "my_asset", "-m", "gcp_test_proj.defs"], | ||
check=True, | ||
) | ||
logs_captured_data = check.not_none( | ||
DagsterInstance.get() | ||
.get_event_records( | ||
EventRecordsFilter( | ||
event_type=DagsterEventType.LOGS_CAPTURED, | ||
) | ||
)[0] | ||
.event_log_entry.dagster_event | ||
).logs_captured_data | ||
|
||
assert logs_captured_data.external_stderr_url | ||
assert logs_captured_data.external_stdout_url | ||
stderr = get_content_from_url(logs_captured_data.external_stderr_url) | ||
stdout = get_content_from_url(logs_captured_data.external_stdout_url) | ||
assert stdout.count("Printing without context") == 10 | ||
assert stderr.count("Logging using context") == 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is all mostly the same as azure
|
||
def _parse_gcs_url_into_uri(url: str) -> str: | ||
return url.removeprefix( | ||
"https://console.cloud.google.com/storage/browser/_details/computelogmanager-tests/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the url format can't be directly downloaded; so we need to do some gross munging to pull out the downloadable log key.
We actually hard code a similar string in the compute log manager itself, we should turn that into a constant and use it in both places ideally.
|
||
|
||
def get_bucket_client(credentials: Mapping) -> gcs.Bucket: | ||
return gcs.Client.from_service_account_info(credentials).get_bucket("computelogmanager-tests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is pulled straight from the compute log manager implementation
a4f8c2e
to
02f06c7
Compare
d619329
to
8021849
Compare
8021849
to
9449650
Compare
Summary & Motivation
Similar to what we introduced for azure, introduce live testing for gcp. Starting with the compute log manager.
Just like the azure tests, this runs on branches which touch dagster-gcp, as well as on the oss nightly pipeline.
Most of the files here are a relative copy-paste job from the azure tests. There is some new functionality, and I've added comments pointing to where that lives.
How I Tested These Changes
New tests pass.