Skip to content

Commit e8755b5

Browse files
authored
Merge pull request googleapis#7926 from googleapis/fix-pipeline-nightly-tests
fix(firestore): update pipeline tests for backend changes
2 parents d920859 + 1b22825 commit e8755b5

3 files changed

Lines changed: 43 additions & 40 deletions

File tree

handwritten/firestore/dev/src/pipelines/pipeline-util.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ export class ExecutionUtil {
222222
this._serializer,
223223
result.fields || {},
224224
ref,
225-
Timestamp.fromProto(proto.executionTime!),
225+
proto.executionTime
226+
? Timestamp.fromProto(proto.executionTime)
227+
: undefined,
226228
result.createTime
227229
? Timestamp.fromProto(result.createTime!)
228230
: undefined,

handwritten/firestore/dev/system-test/pipeline.ts

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,17 +2463,17 @@ describe.skipClassic('Pipeline class', () => {
24632463
.select(
24642464
'title',
24652465
logicalMaximum(constant(1960), field('published'), 1961).as(
2466-
'published-safe',
2466+
'publishedSafe',
24672467
),
24682468
)
24692469
.sort(field('title').ascending())
24702470
.limit(3)
24712471
.execute();
24722472
expectResults(
24732473
snapshot,
2474-
{title: '1984', 'published-safe': 1961},
2475-
{title: 'Crime and Punishment', 'published-safe': 1961},
2476-
{title: 'Dune', 'published-safe': 1965},
2474+
{title: '1984', publishedSafe: 1961},
2475+
{title: 'Crime and Punishment', publishedSafe: 1961},
2476+
{title: 'Dune', publishedSafe: 1965},
24772477
);
24782478
});
24792479

@@ -2484,17 +2484,17 @@ describe.skipClassic('Pipeline class', () => {
24842484
.select(
24852485
'title',
24862486
logicalMinimum(constant(1960), field('published'), 1961).as(
2487-
'published-safe',
2487+
'publishedSafe',
24882488
),
24892489
)
24902490
.sort(field('title').ascending())
24912491
.limit(3)
24922492
.execute();
24932493
expectResults(
24942494
snapshot,
2495-
{title: '1984', 'published-safe': 1949},
2496-
{title: 'Crime and Punishment', 'published-safe': 1866},
2497-
{title: 'Dune', 'published-safe': 1960},
2495+
{title: '1984', publishedSafe: 1949},
2496+
{title: 'Crime and Punishment', publishedSafe: 1866},
2497+
{title: 'Dune', publishedSafe: 1960},
24982498
);
24992499
});
25002500

@@ -2508,7 +2508,7 @@ describe.skipClassic('Pipeline class', () => {
25082508
lessThan(field('published'), 1960),
25092509
constant(1960),
25102510
field('published'),
2511-
).as('published-safe'),
2511+
).as('publishedSafe'),
25122512
field('rating')
25132513
.greaterThanOrEqual(4.5)
25142514
.conditional(constant('great'), constant('good'))
@@ -2519,13 +2519,13 @@ describe.skipClassic('Pipeline class', () => {
25192519
.execute();
25202520
expectResults(
25212521
snapshot,
2522-
{title: '1984', 'published-safe': 1960, rating: 'good'},
2522+
{title: '1984', publishedSafe: 1960, rating: 'good'},
25232523
{
25242524
title: 'Crime and Punishment',
2525-
'published-safe': 1960,
2525+
publishedSafe: 1960,
25262526
rating: 'good',
25272527
},
2528-
{title: 'Dune', 'published-safe': 1965, rating: 'great'},
2528+
{title: 'Dune', publishedSafe: 1965, rating: 'great'},
25292529
);
25302530
});
25312531

@@ -3116,9 +3116,9 @@ describe.skipClassic('Pipeline class', () => {
31163116
snapshot,
31173117
{
31183118
title: "The Hitchhiker's Guide to the Galaxy",
3119-
'awards.hugo': true,
3119+
awards: {hugo: true},
31203120
},
3121-
{title: 'Dune', 'awards.hugo': true},
3121+
{title: 'Dune', awards: {hugo: true}},
31223122
);
31233123
});
31243124

@@ -3143,14 +3143,14 @@ describe.skipClassic('Pipeline class', () => {
31433143
.select(
31443144
'title',
31453145
field('nested.level.1'),
3146-
mapGet('nested', 'level.1').mapGet('level.2').as('nested'),
3146+
mapGet('nested', 'level.1').mapGet('level.2').as('new_nested'),
31473147
)
31483148
.execute();
31493149

31503150
expectResults(snapshot, {
31513151
title: 'foo',
3152-
'nested.level.`1`': 'bar',
3153-
nested: 'baz',
3152+
nested: {level: {1: 'bar'}},
3153+
new_nested: 'baz',
31543154
});
31553155
});
31563156

@@ -4258,17 +4258,17 @@ describe.skipClassic('Pipeline class', () => {
42584258
}),
42594259
)
42604260
.select(
4261-
field('foo').round(0).as('0'),
4262-
round('foo', 1).as('1'),
4263-
round('foo', constant(2)).as('2'),
4264-
round(field('foo'), 4).as('4'),
4261+
field('foo').round(0).as('round0'),
4262+
round('foo', 1).as('round1'),
4263+
round('foo', constant(2)).as('round2'),
4264+
round(field('foo'), 4).as('round4'),
42654265
)
42664266
.execute();
42674267
expectResults(snapshot, {
4268-
'0': 4,
4269-
'1': 4.1,
4270-
'2': 4.12,
4271-
'4': 4.1235,
4268+
round0: 4,
4269+
round1: 4.1,
4270+
round2: 4.12,
4271+
round4: 4.1235,
42724272
});
42734273
});
42744274

@@ -4309,17 +4309,17 @@ describe.skipClassic('Pipeline class', () => {
43094309
}),
43104310
)
43114311
.select(
4312-
field('foo').trunc(0).as('0'),
4313-
trunc('foo', 1).as('1'),
4314-
trunc('foo', constant(2)).as('2'),
4315-
trunc(field('foo'), 4).as('4'),
4312+
field('foo').trunc(0).as('trunc0'),
4313+
trunc('foo', 1).as('trunc1'),
4314+
trunc('foo', constant(2)).as('trunc2'),
4315+
trunc(field('foo'), 4).as('trunc4'),
43164316
)
43174317
.execute();
43184318
expectResults(snapshot, {
4319-
'0': 4,
4320-
'1': 4.1,
4321-
'2': 4.12,
4322-
'4': 4.1234,
4319+
trunc0: 4,
4320+
trunc1: 4.1,
4321+
trunc2: 4.12,
4322+
trunc4: 4.1234,
43234323
});
43244324
});
43254325

@@ -4916,15 +4916,15 @@ describe.skipClassic('Pipeline class', () => {
49164916
constant(1).as('pos1'),
49174917
)
49184918
.select(
4919-
abs('neg10').as('10'),
4920-
abs(field('neg22')).as('22'),
4921-
field('pos1').as('1'),
4919+
abs('neg10').as('abs10'),
4920+
abs(field('neg22')).as('abs22'),
4921+
field('pos1').as('abs1'),
49224922
)
49234923
.execute();
49244924
expectResults(snapshot, {
4925-
'10': 10,
4926-
'22': 22.22,
4927-
'1': 1,
4925+
abs10: 10,
4926+
abs22: 22.22,
4927+
abs1: 1,
49284928
});
49294929
});
49304930

handwritten/firestore/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"system-test:emulator:grpc": "FIRESTORE_EMULATOR_HOST=localhost:8080 mocha build/system-test --timeout 1200000",
4949
"system-test:named-db:emulator:grpc": "FIRESTORE_NAMED_DATABASE=test-db FIRESTORE_EMULATOR_HOST=localhost:8080 mocha build/system-test --timeout 1200000",
5050
"system-test": "npm run system-test:grpc && npm run system-test:rest && npm run system-test:named-db:grpc && npm run system-test:named-db:rest",
51+
"system-test:nightly": "FIRESTORE_TARGET_BACKEND=nightly FIRESTORE_NAMED_DATABASE=enterprise RUN_ENTERPRISE_TESTS=yes GCLOUD_PROJECT=firestore-sdk-nightly mocha build/system-test --timeout 1200000",
5152
"system-test:emulator": "npm run system-test:emulator:grpc && npm run system-test:emulator:rest && npm run system-test:named-db:emulator:grpc && npm run system-test:named-db:emulator:rest",
5253
"presystem-test": "npm run compile",
5354
"samples-test": "npm link && cd samples/ && npm link ../ && npm test && cd ../",

0 commit comments

Comments
 (0)