Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 08a8c8c

Browse files
committed
tests: move utility function into the only test using it, and convert the veneer output to proto format
1 parent 70d41bf commit 08a8c8c

2 files changed

Lines changed: 11 additions & 46 deletions

File tree

testproxy/services/sample-row-keys.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414

1515
import * as grpc from '@grpc/grpc-js';
1616
import {GoogleError} from 'google-gax';
17-
import {getSRKRequest} from './utils/request/sampleRowKeys';
1817
import {ClientImplMaker, normalizeCallback} from './utils';
1918

2019
import {google} from '../protos/protos';
20+
import {log} from './utils/log';
2121
type ISampleRowKeysRequest = google.bigtable.testproxy.ISampleRowKeysRequest;
2222
type ISampleRowKeysResult = google.bigtable.testproxy.ISampleRowKeysResult;
2323

@@ -32,12 +32,20 @@ export const sampleRowKeys: ClientImplMaker<
3232

3333
const bigtable = clientMap.get(clientId!);
3434

35+
const [, , , instanceId, , tableId] = tableName!.split('/');
36+
const instance = bigtable.instance(instanceId);
37+
const table = instance.table(tableId);
38+
3539
try {
36-
const response = await getSRKRequest(bigtable, {tableName});
40+
const response = await table.sampleRowKeys();
3741

42+
log.info('sampleRowKeys response %o', response);
3843
return {
3944
status: {code: grpc.status.OK, details: []},
40-
response,
45+
samples: response[0].map(sample => ({
46+
rowKey: sample.key,
47+
offsetBytes: sample.offset,
48+
})),
4149
};
4250
} catch (e) {
4351
const error = e as GoogleError;

testproxy/services/utils/request/sampleRowKeys.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)