Skip to content

Commit 12d60ed

Browse files
committed
Make schema test more stable.
1 parent ac790a7 commit 12d60ed

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

modules/module-mongodb/src/replication/ChangeStream.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
ServiceError
1111
} from '@powersync/lib-services-framework';
1212
import {
13-
InternalOpId,
1413
MetricsEngine,
1514
RelationCache,
1615
SaveOperationTag,

modules/module-postgres/src/api/PostgresRouteAPIAdapter.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ LEFT JOIN (
314314
AND NOT a.attisdropped
315315
AND has_column_privilege(tbl.quoted_name, a.attname, 'SELECT, INSERT, UPDATE, REFERENCES')
316316
)
317-
GROUP BY schemaname, tablename, quoted_name`
317+
GROUP BY schemaname, tablename, quoted_name
318+
ORDER BY schemaname, tablename;`
318319
);
319320
await this.typeCache.fetchTypesForSchema();
320321
const rows = pgwire.pgwireRows(results);

modules/module-postgres/test/src/route_api_adapter.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { describe, expect, test } from 'vitest';
2-
import { clearTestDb, connectPgPool } from './util.js';
31
import { PostgresRouteAPIAdapter } from '@module/api/PostgresRouteAPIAdapter.js';
42
import { TYPE_INTEGER, TYPE_REAL, TYPE_TEXT } from '@powersync/service-sync-rules';
3+
import { describe, expect, test } from 'vitest';
4+
import { clearTestDb, connectPgPool } from './util.js';
55

66
describe('PostgresRouteAPIAdapter tests', () => {
77
test('infers connection schema', async () => {
@@ -20,7 +20,9 @@ describe('PostgresRouteAPIAdapter tests', () => {
2020
`);
2121

2222
const schema = await api.getConnectionSchema();
23-
expect(schema).toStrictEqual([
23+
// Filter out powersync schema, for cases where we use the same database for storage and replication testing.
24+
const filtered = schema.filter((s) => s.name != 'powersync');
25+
expect(filtered).toStrictEqual([
2426
{
2527
name: 'public',
2628
tables: [

0 commit comments

Comments
 (0)