Skip to content

Commit

Permalink
chore(testproxy): Address TestCheckAndMutateRow_NoRetry_TrueMutations…
Browse files Browse the repository at this point in the history
… and TestCheckAndMutateRow_NoRetry_FalseMutations conformance tests (#1561)

* Add a test

* Reintroduce test file

* Add duplicate mutation test

* Put all mutations on the outer layer

* Add the known failures to the list

* This test file is not needed

* remove only
  • Loading branch information
danieljbruce authored Jan 6, 2025
1 parent 8f9c355 commit d9bed34
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
25 changes: 25 additions & 0 deletions test/test-proxy/checkAndMutateRowService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,31 @@ describe('TestProxy/CheckAndMutateRow', () => {
},
],
},
{
tableName: 'projects/projectId/instances/instance/tables/test-table',
appProfileId: 'test-app-profile',
rowKey: Buffer.from('test-row-key'),
predicateFilter: null,
trueMutations: [
{
setCell: {
familyName: '',
timestampMicros: 1000007,
columnQualifier: Buffer.from(''),
value: Buffer.from(''),
},
},
{
setCell: {
familyName: '',
timestampMicros: 1000007,
columnQualifier: Buffer.from(''),
value: Buffer.from(''),
},
},
],
falseMutations: [],
},
];
describe('Ensure the proper request is passed to the Gapic Layer', () => {
const clientId = 'TestCheckAndMutateRow_NoRetry_TransientError';
Expand Down
2 changes: 0 additions & 2 deletions testproxy/known_failures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ TestReadRows_Retry_WithRoutingCookie\|
TestReadRows_Retry_WithRoutingCookie_MultipleErrorResponses\|
TestReadRows_Retry_WithRetryInfo\|
TestReadRows_Retry_WithRetryInfo_MultipleErrorResponse\|
TestCheckAndMutateRow_NoRetry_TrueMutations\|
TestCheckAndMutateRow_NoRetry_FalseMutations\|
TestSampleRowKeys_Generic_DeadlineExceeded\|
TestSampleRowKeys_Retry_WithRoutingCookie\|
TestSampleRowKeys_Generic_CloseClient
22 changes: 13 additions & 9 deletions testproxy/services/check-and-mutate-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,19 @@ const {
* @returns {FilterConfigOption[]} An array of mutations in the handwritten layer format.
*/
function handwrittenLayerMutations(gapicLayerMutations) {
return createFlatMutationsListWithFnInverse(
[
{
mutations: gapicLayerMutations,
},
],
mutationParseInverse,
1
);
return gapicLayerMutations
.map(mutation =>
createFlatMutationsListWithFnInverse(
[
{
mutations: [mutation],
},
],
mutationParseInverse,
1
)
)
.flat();
}

/**
Expand Down

0 comments on commit d9bed34

Please sign in to comment.