Skip to content
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

Spanner: Add routing header to method metadata (via synth). #7600

Closed
wants to merge 1 commit into from

Conversation

yoshi-automation
Copy link
Contributor

This PR was generated using Autosynth. 🌈

Here's the log from Synthtool:

synthtool > Executing /tmpfs/src/git/autosynth/working_repo/spanner/synth.py.
synthtool > Ensuring dependencies.
synthtool > Pulling artman image.
latest: Pulling from googleapis/artman
Digest: sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e
Status: Image is up to date for googleapis/artman:latest
synthtool > Cloning googleapis.
synthtool > Running generator for google/spanner/artman_spanner.yaml.
synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1.
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/v1/mutation.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1/google/cloud/spanner_v1/proto/mutation.proto
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/v1/spanner.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1/google/cloud/spanner_v1/proto/spanner.proto
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/v1/type.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1/google/cloud/spanner_v1/proto/type.proto
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/v1/keys.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1/google/cloud/spanner_v1/proto/keys.proto
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/v1/result_set.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1/google/cloud/spanner_v1/proto/result_set.proto
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/v1/transaction.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1/google/cloud/spanner_v1/proto/transaction.proto
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/v1/query_plan.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1/google/cloud/spanner_v1/proto/query_plan.proto
synthtool > Placed proto files into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-v1/google/cloud/spanner_v1/proto.
synthtool > Replaced '# limitations under the License.\n\nimport google.api_core.grpc_helpers\n' in google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py.
synthtool > Replaced 'from google.cloud.spanner_v1.proto import spanner_pb2_grpc\n' in google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py.
synthtool > Replaced '(\\s+)return google.api_core.grpc_helpers.create_channel\\(\n' in google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py.
synthtool > Replaced 'from google.cloud import spanner_v1' in tests/unit/gapic/v1/test_spanner_client_v1.py.
synthtool > Running generator for google/spanner/admin/instance/artman_spanner_admin_instance.yaml.
synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-admin-instance-v1.
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/admin/instance/v1/spanner_instance_admin.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-admin-instance-v1/google/cloud/spanner_admin_instance_v1/proto/spanner_instance_admin.proto
synthtool > Placed proto files into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-admin-instance-v1/google/cloud/spanner_admin_instance_v1/proto.
synthtool > Replaced "'google-cloud-spanner-admin-instance'" in google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py.
synthtool > Replaced 'from google\\.cloud\\.spanner\\.admin\\.instance_v1.proto' in google/cloud/spanner_admin_instance_v1/proto/spanner_instance_admin_pb2_grpc.py.
synthtool > Replaced '====*' in google/cloud/spanner_v1/proto/transaction_pb2.py.
synthtool > Replaced '----*' in google/cloud/spanner_v1/proto/transaction_pb2.py.
synthtool > Replaced '~~~~*' in google/cloud/spanner_v1/proto/transaction_pb2.py.
synthtool > Running generator for google/spanner/admin/database/artman_spanner_admin_database.yaml.
synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-admin-database-v1.
synthtool > Copy: /home/kbuilder/.cache/synthtool/googleapis/google/spanner/admin/database/v1/spanner_database_admin.proto to /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-admin-database-v1/google/cloud/spanner_admin_database_v1/proto/spanner_database_admin.proto
synthtool > Placed proto files into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/spanner-admin-database-v1/google/cloud/spanner_admin_database_v1/proto.
synthtool > Replaced "'google-cloud-spanner-admin-database'" in google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py.
synthtool > Replaced 'from google\\.cloud\\.spanner\\.admin\\.database_v1.proto' in google/cloud/spanner_admin_database_v1/proto/spanner_database_admin_pb2_grpc.py.
.coveragerc
.flake8
MANIFEST.in
noxfile.py.j2
setup.cfg
synthtool > Replaced 'include README.rst LICENSE\n' in MANIFEST.in.
Running session blacken
Creating virtualenv using python3.6 in /tmpfs/src/git/autosynth/working_repo/spanner/.nox/blacken
pip install --upgrade black
black google tests docs
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_database_v1/gapic/enums.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client_config.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_instance_v1/gapic/enums.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_database_v1/proto/spanner_database_admin_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client_config.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_instance_v1/proto/spanner_instance_admin_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/gapic/enums.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_database_v1/proto/spanner_database_admin_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/gapic/spanner_client_config.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/keys_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/keys_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/mutation_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/gapic/spanner_client.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/query_plan_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/mutation_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/result_set_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/query_plan_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_admin_instance_v1/proto/spanner_instance_admin_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/result_set_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/transaction_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/spanner_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/type_pb2_grpc.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/type_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/transaction_pb2.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/tests/unit/gapic/v1/test_database_admin_client_v1.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/tests/unit/gapic/v1/test_instance_admin_client_v1.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/tests/unit/gapic/v1/test_spanner_client_v1.py
reformatted /tmpfs/src/git/autosynth/working_repo/spanner/google/cloud/spanner_v1/proto/spanner_pb2.py
All done! ✨ 🍰 ✨
33 files reformatted, 53 files left unchanged.
Session blacken was successful.
synthtool > Cleaned up 2 temporary directories.
synthtool > Wrote metadata to synth.metadata.

@yoshi-automation yoshi-automation added the api: spanner Issues related to the Spanner API. label Mar 28, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 28, 2019
@busunkim96 busunkim96 changed the title [CHANGE ME] Re-generated spanner to pick up changes in the API or client library generator. Spanner: Add routing header to method metadata (via synth). Mar 28, 2019
@tseaver tseaver added the codegen label Apr 1, 2019
@busunkim96 busunkim96 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 1, 2019
@busunkim96
Copy link
Contributor

Unit tests are broken.

_______________ TestClient.test_list_instance_configs_w_options ________________
self = <tests.unit.test_client.TestClient testMethod=test_list_instance_configs_w_options>
    def test_list_instance_configs_w_options(self):
        from google.cloud.spanner_admin_instance_v1.gapic import instance_admin_client
        from google.cloud.spanner_admin_instance_v1.proto import (
            spanner_instance_admin_pb2,
        )
        api = instance_admin_client.InstanceAdminClient(mock.Mock())
        credentials = _make_credentials()
        client = self._make_one(project=self.PROJECT, credentials=credentials)
        client._instance_admin_api = api
        instance_config_pbs = spanner_instance_admin_pb2.ListInstanceConfigsResponse(
            instance_configs=[
                spanner_instance_admin_pb2.InstanceConfig(
                    name=self.CONFIGURATION_NAME, display_name=self.DISPLAY_NAME
                )
            ]
        )
        lic_api = api._inner_api_calls["list_instance_configs"] = mock.Mock(
            return_value=instance_config_pbs
        )
        token = "token"
        page_size = 42
        list(client.list_instance_configs(page_token=token, page_size=42))
        lic_api.assert_called_once_with(
            spanner_instance_admin_pb2.ListInstanceConfigsRequest(
                parent=self.PATH, page_size=page_size, page_token=token
            ),
            metadata=[("google-cloud-resource-prefix", client.project_name)],
            retry=mock.ANY,
>           timeout=mock.ANY,
        )
tests/unit/test_client.py:247:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.nox/unit-3-7/lib/python3.7/site-packages/mock/mock.py:948: in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
.nox/unit-3-7/lib/python3.7/site-packages/mock/mock.py:937: in assert_called_with
    six.raise_from(AssertionError(_error_message(cause)), cause)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = None, from_value = None
>   ???
E   AssertionError: Expected call: mock(parent: "projects/PROJECT"
E   page_size: 42
E   page_token: "token"
E   , metadata=[('google-cloud-resource-prefix', 'projects/PROJECT')], retry=<ANY>, timeout=<ANY>)
E   Actual call: mock(parent: "projects/PROJECT"
E   page_size: 42
E   page_token: "token"
E   , metadata=[('google-cloud-resource-prefix', 'projects/PROJECT'), ('x-goog-request-params', 'parent=projects/PROJECT')], retry=<object object at 0x7f9bf9ae8b60>, timeout=<object object at 0x7f9bf9ae8b60>)
<string>:3: AssertionError

@busunkim96
Copy link
Contributor

busunkim96 commented Apr 2, 2019

@tseaver @crwilcox Are the Spanner unit tests handwritten or generated?

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 4, 2019
@tseaver tseaver added needs work This is a pull request that needs a little love. and removed 🚨 This issue needs some love. labels Apr 17, 2019
@tseaver
Copy link
Contributor

tseaver commented Apr 17, 2019

@busunkim96

Are the Spanner unit tests handwritten or generated?

Handwritten, except for the GAPIC-related ones in tests/unit/gapic/v1.

@tseaver
Copy link
Contributor

tseaver commented Apr 18, 2019

Superseded by #7750.

@tseaver tseaver closed this Apr 18, 2019
@tseaver tseaver deleted the autosynth-spanner branch April 18, 2019 19:40
tseaver added a commit that referenced this pull request Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. cla: yes This human has signed the Contributor License Agreement. codegen do not merge Indicates a pull request not ready for merge, due to either quality or timing. needs work This is a pull request that needs a little love.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants