gax-java icon indicating copy to clipboard operation
gax-java copied to clipboard

Unable to test end to end configuration options

Open chingor13 opened this issue 5 years ago • 4 comments

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?

chingor13 avatar Jun 18 '20 19:06 chingor13

Can we run gapic-generator on showcase within this repo so we can test against the showcase client?

chingor13 avatar Jun 26 '20 18:06 chingor13

I'm not sure if showcase supports (testing config options) or if that is something that we can implement it.

@miraleung , any thoughts?

hkdevandla avatar Jul 06 '20 19:07 hkdevandla

@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.

miraleung avatar Jul 06 '20 20:07 miraleung

@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.

chingor13 avatar Jul 06 '20 21:07 chingor13