-
Notifications
You must be signed in to change notification settings - Fork 93
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
docs(samples): add samples for CMMR phase 2 #672
docs(samples): add samples for CMMR phase 2 #672
Conversation
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
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.
LGTM
I did not add an explicit approval as it's not ready for merge yet.
samples/samples/snippets.py
Outdated
base_config = spanner_client.instance_admin_api.get_instance_config( | ||
name="{}/instanceConfigs/{}".format(spanner_client.project_name, base_instance_config)) | ||
replicas = [] | ||
for replica in base_config.replicas: |
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.
nit: Add a comment that it is required that the custom configuration contains all the replicas of the base config + at least one optional replica. That makes it clearer to the user why we are doing this.
samples/samples/snippets_test.py
Outdated
def test_update_instance_config(capsys, user_managed_instance_config_id): | ||
snippets.update_instance_config(user_managed_instance_config_id) | ||
out, _ = capsys.readouterr() | ||
assert "custom-updated-sample-config" in out |
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.
nit: Add something like 'Updated ...' to the assert here, so it's easier to see that this really verifies that the function succeeded.
samples/samples/snippets_test.py
Outdated
def test_create_instance_config(capsys, user_managed_instance_config_id): | ||
snippets.create_instance_config("base-config", user_managed_instance_config_id) | ||
out, _ = capsys.readouterr() | ||
assert "custom-sample-config" in out |
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.
nit: Add something like 'Created ...' to the assert here, so it's easier to see that this really verifies that the function succeeded.
a03c43b
to
7f7af44
Compare
c0d1b48
to
b116734
Compare
b116734
to
6f4f268
Compare
Tests and samples for user-managed instance configurations
BEGIN_COMMIT_OVERRIDE
docs(samples): add samples for CMMR phase 2
END_COMMIT_OVERRIDE