gax-java
gax-java copied to clipboard
Unable to test end to end configuration options
Code that glues ClientSettings to the ClientContext is generated by gapic generator making it difficult to test that configuration options make it to the transport layer.
Can we generate a test client where we can mock out the transport for testing purposes?
Can we run gapic-generator on showcase within this repo so we can test against the showcase client?
I'm not sure if showcase supports (testing config options) or if that is something that we can implement it.
@miraleung , any thoughts?
@chingor13 Could you please provide more detail, ideally with a client lib such as dataproc so we can go over concrete examples? This would help us better understand where the codegen gap lies, and the motivating use case.
Note that we will likely skip adding this to gapic-generator, and just add it directly to gapic-generator-java as the Gapic class generation logic will be coming soon.
@summer-ji-eng is adding a feature to override the quotaProjectId (x-goog-user-project) header. Within this repo, we can test that the builders are building the settings object (using FakeClientSettings). However, there is no FakeClient so we cannot instantiate a client and provide a testing Transport to ensure that the ClientContext is respecting the options we're configuring (and in the correct order).
Ideally, we can have these tests live in the gax repo as it's really testing gax, but it needs a generated client.