Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/runConfigurations/System_Test.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions dev/system-test/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3447,7 +3447,7 @@ describe.skipEnterprise('Query class - Standard DB', () => {

// TODO Enterprise - wait for implicit sort order decision
// Skip this test if running against standard production because it results in a 'missing index' error.
it.skipClassic('supports OR queries with composite indexes', async () => {
it.skipStandard('supports OR queries with composite indexes', async () => {
const collection = await testCollectionWithDocs({
doc1: {a: 1, b: 0},
doc2: {a: 2, b: 1},
Expand Down Expand Up @@ -3547,7 +3547,7 @@ describe.skipEnterprise('Query class - Standard DB', () => {

// Skip this test if running against production standard DB because it results in a 'missing index' error.
// The Firestore Emulator and Enterprise-editions, however, do serve these queries.
it.skipClassic(
it.skipStandard(
'supports OR queries on documents with missing fields',
async () => {
const collection = await testCollectionWithDocs({
Expand Down Expand Up @@ -3645,7 +3645,7 @@ describe.skipEnterprise('Query class - Standard DB', () => {
});

// Skip this test if running against production because it results in a 'missing index' error.
it.skipClassic('supports OR queries with not-in', async () => {
it.skipStandard('supports OR queries with not-in', async () => {
const collection = await testCollectionWithDocs({
doc1: {a: 1, b: 0},
doc2: {b: 1},
Expand Down Expand Up @@ -7503,7 +7503,7 @@ describe('Client initialization', () => {
'CollectionReference.listDocuments()',

randomColl => {
if (process.env.RUN_ENTERPRISE_TESTS) return Promise.resolve();
if (isEnterprise()) return Promise.resolve();
return randomColl.listDocuments();
},
],
Expand Down Expand Up @@ -7563,7 +7563,7 @@ describe('Client initialization', () => {
'CollectionGroup.getPartitions()',
async randomColl => {
// Requires PartitionQuery support
if (process.env.RUN_ENTERPRISE_TESTS) return;
if (isEnterprise()) return;

const partitions = randomColl.firestore
.collectionGroup('id')
Expand Down
92 changes: 53 additions & 39 deletions dev/system-test/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ import * as chaiAsPromised from 'chai-as-promised';

import {afterEach, describe, it} from 'mocha';
import '../test/util/mocha_extensions';
import {verifyInstance} from '../test/util/helpers';
import {isPreferRest, verifyInstance} from '../test/util/helpers';
import {getTestDb, getTestRoot} from './firestore';

import {Firestore as InternalFirestore} from '../src';
Expand All @@ -146,7 +146,7 @@ use(chaiAsPromised);

const timestampDeltaMS = 3000;

describe.skipClassic('Pipeline class', () => {
describe.skipStandard('Pipeline class', () => {
let firestore: Firestore;
let randomCol: CollectionReference;
let beginDocCreation = 0;
Expand Down Expand Up @@ -458,7 +458,7 @@ describe.skipClassic('Pipeline class', () => {
});

describe('pipeline explain', () => {
it('mode: analyze, format: text', async () => {
it.skipRestConnection('mode: analyze, format: text', async () => {
const ppl = firestore
.pipeline()
.collection(randomCol.path)
Expand Down Expand Up @@ -498,7 +498,7 @@ describe.skipClassic('Pipeline class', () => {
);
});

it('mode: analyze, format: unspecified', async () => {
it.skipRestConnection('mode: analyze, format: unspecified', async () => {
const ppl = firestore
.pipeline()
.collection(randomCol.path)
Expand Down Expand Up @@ -1636,17 +1636,24 @@ describe.skipClassic('Pipeline class', () => {

expect.fail('expected pipeline.execute() to throw');
} catch (e: unknown) {
expect(e instanceof Error).to.be.true;
const err = e as ServiceError;
expect(err['code']).to.equal(3);
expect(typeof err['message']).to.equal('string');
expect(typeof err['details']).to.equal('string');
expect(typeof err['stack']).to.equal('string');
expect(err['metadata'] instanceof Object).to.be.true;

expect(err['message']).to.equal(
`${err.code} INVALID_ARGUMENT: ${err.details}`,
);
if (isPreferRest()) {
expect(e instanceof Error).to.be.true;
const err = e as ServiceError;
expect(err['code']).to.equal(400);
} else {
// grpc
expect(e instanceof Error).to.be.true;
const err = e as ServiceError;
expect(err['code']).to.equal(3);
expect(typeof err['message']).to.equal('string');
expect(typeof err['details']).to.equal('string');
expect(typeof err['stack']).to.equal('string');
expect(err['metadata'] instanceof Object).to.be.true;

expect(err['message']).to.equal(
`${err.code} INVALID_ARGUMENT: ${err.details}`,
);
}
}
});

Expand All @@ -1667,32 +1674,39 @@ describe.skipClassic('Pipeline class', () => {

expect.fail('expected pipeline.execute() to throw');
} catch (e: unknown) {
const err = e as {[k: string]: unknown};
expect(err instanceof Error).to.be.true;

expect(err['code']).to.equal(8);
expect(typeof err['message']).to.equal('string');
expect(typeof err['details']).to.equal('string');
expect(typeof err['stack']).to.equal('string');
expect(err['metadata'] instanceof Object).to.be.true;

expect(err['message']).to.equal(
`${err.code} RESOURCE_EXHAUSTED: ${err.details}`,
);
if (isPreferRest()) {
const err = e as {[k: string]: unknown};
expect(err instanceof Error).to.be.true;
expect(err['code']).to.equal(429);
} else {
// grpc
const err = e as {[k: string]: unknown};
expect(err instanceof Error).to.be.true;

expect(err['code']).to.equal(8);
expect(typeof err['message']).to.equal('string');
expect(typeof err['details']).to.equal('string');
expect(typeof err['stack']).to.equal('string');
expect(err['metadata'] instanceof Object).to.be.true;

expect(err['message']).to.equal(
`${err.code} RESOURCE_EXHAUSTED: ${err.details}`,
);

expect('statusDetails' in err).to.be.true;
expect(Array.isArray(err['statusDetails'])).to.be.true;
expect('statusDetails' in err).to.be.true;
expect(Array.isArray(err['statusDetails'])).to.be.true;

const statusDetails = err['statusDetails'] as Array<object>;
const statusDetails = err['statusDetails'] as Array<object>;

const foundExplainStats = statusDetails.find(x => {
return (
'type_url' in x &&
x['type_url'] ===
'type.googleapis.com/google.firestore.v1.ExplainStats'
);
});
expect(foundExplainStats).to.not.be.undefined;
const foundExplainStats = statusDetails.find(x => {
return (
'type_url' in x &&
x['type_url'] ===
'type.googleapis.com/google.firestore.v1.ExplainStats'
);
});
expect(foundExplainStats).to.not.be.undefined;
}
}
});
});
Expand Down Expand Up @@ -4449,7 +4463,7 @@ describe.skipClassic('Pipeline class', () => {
// This is the Query integration tests from the lite API (no cache support)
// with some additional test cases added for more complete coverage.
// eslint-disable-next-line no-restricted-properties
describe.skipClassic('Query to Pipeline', () => {
describe.skipStandard('Query to Pipeline', () => {
async function execute(ppl: Pipeline): Promise<PipelineSnapshot> {
return ppl.execute();
}
Expand Down
Loading
Loading