Skip to content

Commit 730a953

Browse files
committed
Make integration tests blazing fast (#2473)
Signed-off-by: Alexis Rico <sferadev@gmail.com> Synced from monorepo@2b3017315084055f62ac4b596355439681e47432
1 parent 415894a commit 730a953

11 files changed

Lines changed: 24 additions & 24 deletions

.sync-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a39439c505c3d7c4cb9e8fac0239aad728e99e0e
1+
2b3017315084055f62ac4b596355439681e47432

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
"yaml": "2.9.0",
3737
"zod": "4.4.3",
3838
"zod-config": "1.4.0",
39+
"@xata.io/ai": "0.1.0",
3940
"@xata.io/api": "0.1.0",
40-
"@xata.io/config": "0.0.0",
4141
"@xata.io/lang": "0.0.1",
4242
"@xata.io/pgroll": "0.9.0",
43-
"@xata.io/ai": "0.1.0",
43+
"@xata.io/config": "0.0.0",
4444
"@xata.io/pgstream": "0.2.0",
4545
"@xata.io/sql": "0.1.3",
4646
"@xata.io/test-utils": "0.0.0",
@@ -52,8 +52,8 @@
5252
"build": "bun scripts/build.ts",
5353
"test": "bun test",
5454
"test-unit": "bun test unit.test",
55-
"test-integration": "bun test --parallel=4 --timeout 90000 integration.test",
56-
"test-binary-e2e": "bun test --parallel=2 --timeout 90000 test-binary/e2e",
55+
"test-integration": "bun test --concurrent --timeout 90000 integration.test",
56+
"test-binary-e2e": "bun test --concurrent --timeout 90000 test-binary/e2e",
5757
"test:watch": "bun test --watch",
5858
"release": "bun run build && bun scripts/release.ts",
5959
"tsc": "tsc"

src/commands/branch/describe.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import stripAnsi from 'strip-ansi';
44
import { getNthArgOfNthCall, getTestContext, TEST_XATA_ORG } from '~/lib/test-utils';
55
import { implementation } from './describe';
66

7-
describe('branch describe command tests', () => {
8-
const { project, branch } = setupTestResources();
7+
const { project, branch } = await setupTestResources();
98

9+
describe('branch describe command tests', () => {
1010
test('describe branch with json output', async () => {
1111
const context = await getTestContext();
1212
const stdoutWriteSpy = spyOn(context.process.stdout, 'write');

src/commands/branch/get.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { getNthArgOfNthCall, getTestContext, TEST_XATA_ORG } from '~/lib/test-ut
44
import { implementation } from './get';
55
import stripAnsi from 'strip-ansi';
66

7-
describe('branch get command tests', () => {
8-
const { project, branch } = setupTestResources();
7+
const { project, branch } = await setupTestResources();
98

9+
describe('branch get command tests', () => {
1010
test('get non-existent field', async () => {
1111
const context = await getTestContext();
1212
const _stdoutWriteSpy = spyOn(context.process.stdout, 'write');

src/commands/branch/list.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import stripAnsi from 'strip-ansi';
44
import { getNthArgOfNthCall, getTestContext, TEST_XATA_ORG } from '~/lib/test-utils';
55
import { implementation } from './list';
66

7-
describe('branch list command tests', () => {
8-
const { project, branch } = setupTestResources();
7+
const { project, branch } = await setupTestResources();
98

9+
describe('branch list command tests', () => {
1010
test('list branches with json output', async () => {
1111
const context = await getTestContext();
1212
const stdoutWriteSpy = spyOn(context.process.stdout, 'write');

src/commands/branch/tree.integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import stripAnsi from 'strip-ansi';
44
import { getNthArgOfNthCall, getTestContext, TEST_XATA_ORG } from '~/lib/test-utils';
55
import { implementation } from './tree';
66

7-
describe('branch tree command tests', () => {
8-
const { project, branch } = setupTestResources();
9-
const { child } = setupChildBranch();
7+
const { project, branch } = await setupTestResources();
8+
const { child } = await setupChildBranch();
109

10+
describe('branch tree command tests', () => {
1111
test('tree displays branch hierarchy', async () => {
1212
const context = await getTestContext();
1313
const stdoutWriteSpy = spyOn(context.process.stdout, 'write');

src/commands/branch/url.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { getNthArgOfNthCall, getTestContext, TEST_XATA_ORG } from '~/lib/test-ut
44
import type { Types } from '@xata.io/api';
55
import { implementation } from './url';
66

7-
describe('branch url command tests', () => {
8-
const { project, branch } = setupTestResources();
7+
const { project, branch } = await setupTestResources();
98

9+
describe('branch url command tests', () => {
1010
test('url returns connection string for healthy branch', async () => {
1111
const context = await getTestContext();
1212
const stdoutWriteSpy = spyOn(context.process.stdout, 'write');

src/commands/project/describe.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import stripAnsi from 'strip-ansi';
44
import { getNthArgOfNthCall, getTestContext, TEST_XATA_ORG } from '~/lib/test-utils';
55
import { implementation } from './describe';
66

7-
describe('project describe command tests', () => {
8-
const { project } = setupTestResources();
7+
const { project } = await setupTestResources();
98

9+
describe('project describe command tests', () => {
1010
test('describe 404 project call', async () => {
1111
const context = await getTestContext();
1212
const projectId = 'PROJECT_ID_THAT_DOES_NOT_EXIST';

src/commands/project/get.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { setupTestResources } from '@xata.io/test-utils';
33
import { getNthArgOfNthCall, getTestContext, TEST_XATA_ORG } from '~/lib/test-utils';
44
import { implementation } from './get';
55

6-
describe('project get command tests', () => {
7-
const { project } = setupTestResources();
6+
const { project } = await setupTestResources();
87

8+
describe('project get command tests', () => {
99
test('project get a non-existent field', async () => {
1010
const context = await getTestContext();
1111
const _stdoutWriteSpy = spyOn(context.process.stdout, 'write');

src/commands/project/list.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { setupTestResources } from '@xata.io/test-utils';
33
import { getNthArgOfNthCall, getTestContext, TEST_XATA_ORG } from '~/lib/test-utils';
44
import { implementation } from './list';
55

6-
describe('project list command with tests', () => {
7-
const { project } = setupTestResources();
6+
const { project } = await setupTestResources();
87

8+
describe('project list command with tests', () => {
99
test('list projects with json output', async () => {
1010
const context = await getTestContext();
1111
const stdoutWriteSpy = spyOn(context.process.stdout, 'write');

0 commit comments

Comments
 (0)