Skip to content

Commit ba97ffb

Browse files
committed
update baselines
1 parent e27e837 commit ba97ffb

22 files changed

+422
-10
lines changed

baselines/bigquery-storage-esm/esm/test/gapic_big_query_storage_v1beta1.ts.baseline

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,41 @@ describe('v1beta1.BigQueryStorageClient', () => {
738738
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
739739
});
740740

741+
it('invokes readRows without error and gaxServerStreamingRetries enabled', async () => {
742+
const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({gaxServerStreamingRetries: true});
743+
client.initialize();
744+
const request = generateSampleMessage(
745+
new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest()
746+
);
747+
request.readPosition ??= {};
748+
request.readPosition.stream ??= {};
749+
const defaultValue1 =
750+
getTypeDefaultValue('.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest', ['readPosition', 'stream', 'name']);
751+
request.readPosition.stream.name = defaultValue1;
752+
const expectedHeaderRequestParams = `read_position.stream.name=${defaultValue1 ?? '' }`;
753+
const expectedResponse = generateSampleMessage(
754+
new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse()
755+
);
756+
client.innerApiCalls.readRows = stubServerStreamingCall(expectedResponse);
757+
const stream = client.readRows(request);
758+
const promise = new Promise((resolve, reject) => {
759+
stream.on('data', (response: protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) => {
760+
resolve(response);
761+
});
762+
stream.on('error', (err: Error) => {
763+
reject(err);
764+
});
765+
});
766+
const response = await promise;
767+
assert.deepStrictEqual(response, expectedResponse);
768+
const actualRequest = (client.innerApiCalls.readRows as SinonStub)
769+
.getCall(0).args[0];
770+
assert.deepStrictEqual(actualRequest, request);
771+
const actualHeaderRequestParams = (client.innerApiCalls.readRows as SinonStub)
772+
.getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
773+
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
774+
});
775+
741776
it('invokes readRows with error', async () => {
742777
const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({
743778
credentials: {client_email: 'bogus', private_key: 'bogus'},
@@ -800,6 +835,12 @@ describe('v1beta1.BigQueryStorageClient', () => {
800835
});
801836
await assert.rejects(promise, expectedError);
802837
});
838+
it('should create a client with gaxServerStreamingRetries enabled', () => {
839+
const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({
840+
gaxServerStreamingRetries: true,
841+
});
842+
assert(client);
843+
});
803844
});
804845

805846
describe('Path templates', () => {

baselines/bigquery-storage/test/gapic_big_query_storage_v1beta1.ts.baseline

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,41 @@ describe('v1beta1.BigQueryStorageClient', () => {
729729
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
730730
});
731731

732+
it('invokes readRows without error and gaxServerStreamingRetries enabled', async () => {
733+
const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({gaxServerStreamingRetries: true});
734+
client.initialize();
735+
const request = generateSampleMessage(
736+
new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest()
737+
);
738+
request.readPosition ??= {};
739+
request.readPosition.stream ??= {};
740+
const defaultValue1 =
741+
getTypeDefaultValue('.google.cloud.bigquery.storage.v1beta1.ReadRowsRequest', ['readPosition', 'stream', 'name']);
742+
request.readPosition.stream.name = defaultValue1;
743+
const expectedHeaderRequestParams = `read_position.stream.name=${defaultValue1}`;
744+
const expectedResponse = generateSampleMessage(
745+
new protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse()
746+
);
747+
client.innerApiCalls.readRows = stubServerStreamingCall(expectedResponse);
748+
const stream = client.readRows(request);
749+
const promise = new Promise((resolve, reject) => {
750+
stream.on('data', (response: protos.google.cloud.bigquery.storage.v1beta1.ReadRowsResponse) => {
751+
resolve(response);
752+
});
753+
stream.on('error', (err: Error) => {
754+
reject(err);
755+
});
756+
});
757+
const response = await promise;
758+
assert.deepStrictEqual(response, expectedResponse);
759+
const actualRequest = (client.innerApiCalls.readRows as SinonStub)
760+
.getCall(0).args[0];
761+
assert.deepStrictEqual(actualRequest, request);
762+
const actualHeaderRequestParams = (client.innerApiCalls.readRows as SinonStub)
763+
.getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
764+
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
765+
});
766+
732767
it('invokes readRows with error', async () => {
733768
const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({
734769
credentials: {client_email: 'bogus', private_key: 'bogus'},
@@ -791,6 +826,12 @@ describe('v1beta1.BigQueryStorageClient', () => {
791826
});
792827
await assert.rejects(promise, expectedError);
793828
});
829+
it('should create a client with gaxServerStreamingRetries enabled', () => {
830+
const client = new bigquerystorageModule.v1beta1.BigQueryStorageClient({
831+
gaxServerStreamingRetries: true,
832+
});
833+
assert(client);
834+
});
794835
});
795836

796837
describe('Path templates', () => {

baselines/disable-packing-test-esm/esm/src/v1beta1/echo_client.ts.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export class EchoClient {
248248
// Provide descriptors for these.
249249
this.descriptors.stream = {
250250
expand: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
251-
collect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
251+
collect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback),
252252
chat: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
253253
};
254254

baselines/disable-packing-test-esm/esm/src/v1beta1/messaging_client.ts.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export class MessagingClient {
247247
// Provide descriptors for these.
248248
this.descriptors.stream = {
249249
streamBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
250-
sendBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
250+
sendBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback),
251251
connect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
252252
};
253253

baselines/disable-packing-test-esm/esm/test/gapic_echo_v1beta1.ts.baseline

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,29 @@ describe('v1beta1.EchoClient', () => {
671671
assert.deepStrictEqual(response, expectedResponse);
672672
});
673673

674+
it('invokes expand without error and gaxServerStreamingRetries enabled', async () => {
675+
const client = new echoModule.v1beta1.EchoClient({gaxServerStreamingRetries: true});
676+
client.initialize();
677+
const request = generateSampleMessage(
678+
new protos.google.showcase.v1beta1.ExpandRequest()
679+
);
680+
const expectedResponse = generateSampleMessage(
681+
new protos.google.showcase.v1beta1.EchoResponse()
682+
);
683+
client.innerApiCalls.expand = stubServerStreamingCall(expectedResponse);
684+
const stream = client.expand(request);
685+
const promise = new Promise((resolve, reject) => {
686+
stream.on('data', (response: protos.google.showcase.v1beta1.EchoResponse) => {
687+
resolve(response);
688+
});
689+
stream.on('error', (err: Error) => {
690+
reject(err);
691+
});
692+
});
693+
const response = await promise;
694+
assert.deepStrictEqual(response, expectedResponse);
695+
});
696+
674697
it('invokes expand with error', async () => {
675698
const client = new echoModule.v1beta1.EchoClient({
676699
credentials: {client_email: 'bogus', private_key: 'bogus'},
@@ -716,6 +739,12 @@ describe('v1beta1.EchoClient', () => {
716739
});
717740
await assert.rejects(promise, expectedError);
718741
});
742+
it('should create a client with gaxServerStreamingRetries enabled', () => {
743+
const client = new echoModule.v1beta1.EchoClient({
744+
gaxServerStreamingRetries: true,
745+
});
746+
assert(client);
747+
});
719748
});
720749

721750
describe('chat', () => {

baselines/disable-packing-test-esm/esm/test/gapic_messaging_v1beta1.ts.baseline

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,39 @@ describe('v1beta1.MessagingClient', () => {
13061306
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
13071307
});
13081308

1309+
it('invokes streamBlurbs without error and gaxServerStreamingRetries enabled', async () => {
1310+
const client = new messagingModule.v1beta1.MessagingClient({gaxServerStreamingRetries: true});
1311+
client.initialize();
1312+
const request = generateSampleMessage(
1313+
new protos.google.showcase.v1beta1.StreamBlurbsRequest()
1314+
);
1315+
const defaultValue1 =
1316+
getTypeDefaultValue('.google.showcase.v1beta1.StreamBlurbsRequest', ['name']);
1317+
request.name = defaultValue1;
1318+
const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`;
1319+
const expectedResponse = generateSampleMessage(
1320+
new protos.google.showcase.v1beta1.StreamBlurbsResponse()
1321+
);
1322+
client.innerApiCalls.streamBlurbs = stubServerStreamingCall(expectedResponse);
1323+
const stream = client.streamBlurbs(request);
1324+
const promise = new Promise((resolve, reject) => {
1325+
stream.on('data', (response: protos.google.showcase.v1beta1.StreamBlurbsResponse) => {
1326+
resolve(response);
1327+
});
1328+
stream.on('error', (err: Error) => {
1329+
reject(err);
1330+
});
1331+
});
1332+
const response = await promise;
1333+
assert.deepStrictEqual(response, expectedResponse);
1334+
const actualRequest = (client.innerApiCalls.streamBlurbs as SinonStub)
1335+
.getCall(0).args[0];
1336+
assert.deepStrictEqual(actualRequest, request);
1337+
const actualHeaderRequestParams = (client.innerApiCalls.streamBlurbs as SinonStub)
1338+
.getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
1339+
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
1340+
});
1341+
13091342
it('invokes streamBlurbs with error', async () => {
13101343
const client = new messagingModule.v1beta1.MessagingClient({
13111344
credentials: {client_email: 'bogus', private_key: 'bogus'},
@@ -1364,6 +1397,12 @@ describe('v1beta1.MessagingClient', () => {
13641397
});
13651398
await assert.rejects(promise, expectedError);
13661399
});
1400+
it('should create a client with gaxServerStreamingRetries enabled', () => {
1401+
const client = new messagingModule.v1beta1.MessagingClient({
1402+
gaxServerStreamingRetries: true,
1403+
});
1404+
assert(client);
1405+
});
13671406
});
13681407

13691408
describe('connect', () => {

baselines/disable-packing-test/src/v1beta1/echo_client.ts.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export class EchoClient {
225225
// Provide descriptors for these.
226226
this.descriptors.stream = {
227227
expand: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
228-
collect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
228+
collect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback),
229229
chat: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
230230
};
231231

baselines/disable-packing-test/src/v1beta1/messaging_client.ts.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export class MessagingClient {
224224
// Provide descriptors for these.
225225
this.descriptors.stream = {
226226
streamBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
227-
sendBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
227+
sendBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback),
228228
connect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
229229
};
230230

baselines/disable-packing-test/test/gapic_echo_v1beta1.ts.baseline

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,29 @@ describe('v1beta1.EchoClient', () => {
662662
assert.deepStrictEqual(response, expectedResponse);
663663
});
664664

665+
it('invokes expand without error and gaxServerStreamingRetries enabled', async () => {
666+
const client = new echoModule.v1beta1.EchoClient({gaxServerStreamingRetries: true});
667+
client.initialize();
668+
const request = generateSampleMessage(
669+
new protos.google.showcase.v1beta1.ExpandRequest()
670+
);
671+
const expectedResponse = generateSampleMessage(
672+
new protos.google.showcase.v1beta1.EchoResponse()
673+
);
674+
client.innerApiCalls.expand = stubServerStreamingCall(expectedResponse);
675+
const stream = client.expand(request);
676+
const promise = new Promise((resolve, reject) => {
677+
stream.on('data', (response: protos.google.showcase.v1beta1.EchoResponse) => {
678+
resolve(response);
679+
});
680+
stream.on('error', (err: Error) => {
681+
reject(err);
682+
});
683+
});
684+
const response = await promise;
685+
assert.deepStrictEqual(response, expectedResponse);
686+
});
687+
665688
it('invokes expand with error', async () => {
666689
const client = new echoModule.v1beta1.EchoClient({
667690
credentials: {client_email: 'bogus', private_key: 'bogus'},
@@ -707,6 +730,12 @@ describe('v1beta1.EchoClient', () => {
707730
});
708731
await assert.rejects(promise, expectedError);
709732
});
733+
it('should create a client with gaxServerStreamingRetries enabled', () => {
734+
const client = new echoModule.v1beta1.EchoClient({
735+
gaxServerStreamingRetries: true,
736+
});
737+
assert(client);
738+
});
710739
});
711740

712741
describe('chat', () => {

baselines/disable-packing-test/test/gapic_messaging_v1beta1.ts.baseline

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,6 +1297,39 @@ describe('v1beta1.MessagingClient', () => {
12971297
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
12981298
});
12991299

1300+
it('invokes streamBlurbs without error and gaxServerStreamingRetries enabled', async () => {
1301+
const client = new messagingModule.v1beta1.MessagingClient({gaxServerStreamingRetries: true});
1302+
client.initialize();
1303+
const request = generateSampleMessage(
1304+
new protos.google.showcase.v1beta1.StreamBlurbsRequest()
1305+
);
1306+
const defaultValue1 =
1307+
getTypeDefaultValue('.google.showcase.v1beta1.StreamBlurbsRequest', ['name']);
1308+
request.name = defaultValue1;
1309+
const expectedHeaderRequestParams = `name=${defaultValue1}`;
1310+
const expectedResponse = generateSampleMessage(
1311+
new protos.google.showcase.v1beta1.StreamBlurbsResponse()
1312+
);
1313+
client.innerApiCalls.streamBlurbs = stubServerStreamingCall(expectedResponse);
1314+
const stream = client.streamBlurbs(request);
1315+
const promise = new Promise((resolve, reject) => {
1316+
stream.on('data', (response: protos.google.showcase.v1beta1.StreamBlurbsResponse) => {
1317+
resolve(response);
1318+
});
1319+
stream.on('error', (err: Error) => {
1320+
reject(err);
1321+
});
1322+
});
1323+
const response = await promise;
1324+
assert.deepStrictEqual(response, expectedResponse);
1325+
const actualRequest = (client.innerApiCalls.streamBlurbs as SinonStub)
1326+
.getCall(0).args[0];
1327+
assert.deepStrictEqual(actualRequest, request);
1328+
const actualHeaderRequestParams = (client.innerApiCalls.streamBlurbs as SinonStub)
1329+
.getCall(0).args[1].otherArgs.headers['x-goog-request-params'];
1330+
assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams));
1331+
});
1332+
13001333
it('invokes streamBlurbs with error', async () => {
13011334
const client = new messagingModule.v1beta1.MessagingClient({
13021335
credentials: {client_email: 'bogus', private_key: 'bogus'},
@@ -1355,6 +1388,12 @@ describe('v1beta1.MessagingClient', () => {
13551388
});
13561389
await assert.rejects(promise, expectedError);
13571390
});
1391+
it('should create a client with gaxServerStreamingRetries enabled', () => {
1392+
const client = new messagingModule.v1beta1.MessagingClient({
1393+
gaxServerStreamingRetries: true,
1394+
});
1395+
assert(client);
1396+
});
13581397
});
13591398

13601399
describe('connect', () => {

baselines/showcase-esm/esm/src/v1beta1/echo_client.ts.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export class EchoClient {
251251
// Provide descriptors for these.
252252
this.descriptors.stream = {
253253
expand: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
254-
collect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
254+
collect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback),
255255
chat: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
256256
};
257257

baselines/showcase-esm/esm/src/v1beta1/messaging_client.ts.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export class MessagingClient {
250250
// Provide descriptors for these.
251251
this.descriptors.stream = {
252252
streamBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
253-
sendBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
253+
sendBlurbs: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.CLIENT_STREAMING, !!opts.fallback),
254254
connect: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.BIDI_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries)
255255
};
256256

0 commit comments

Comments
 (0)