Skip to content

Commit 9335091

Browse files
committed
chore(ci): run tests in isolation
1 parent a45333a commit 9335091

File tree

5 files changed

+29
-12
lines changed

5 files changed

+29
-12
lines changed

.github/workflows/ci-supabase-js.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,30 +186,34 @@ jobs:
186186
npm view @supabase/supabase-js version --registry http://localhost:4873
187187
npm view @supabase/supabase-js --registry http://localhost:4873 | head -20
188188
189-
- name: Run Deno Tests
189+
- name: Run Deno Tests in isolation (1.x)
190190
if: ${{ matrix.deno == '1.x' }}
191191
env:
192192
STORAGE_JS_ENTRY: main
193193
DENO_NPM_REGISTRY: http://localhost:4873
194194
run: |
195-
cd packages/core/supabase-js/test/deno
195+
TEST_DIR="/tmp/test-deno-1x-${{ github.run_id }}"
196+
mkdir -p "$TEST_DIR"
197+
cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/"
198+
cd "$TEST_DIR"
196199
echo "registry=http://localhost:4873/" > .npmrc
197200
npm install
198201
npm test || npm test
199202
rm -f .npmrc
200-
cd ../../..
201203
202-
- name: Run Deno Tests
204+
- name: Run Deno Tests in isolation (2.x)
203205
if: ${{ matrix.deno == '2.x' }}
204206
env:
205207
DENO_NPM_REGISTRY: http://localhost:4873
206208
run: |
207-
cd packages/core/supabase-js/test/deno
209+
TEST_DIR="/tmp/test-deno-2x-${{ github.run_id }}"
210+
mkdir -p "$TEST_DIR"
211+
cp -r packages/core/supabase-js/test/deno/* "$TEST_DIR/"
212+
cd "$TEST_DIR"
208213
echo "registry=http://localhost:4873/" > .npmrc
209214
npm install
210215
npm test || npm test
211216
rm -f .npmrc
212-
cd ../../..
213217
214218
- name: Run integration and browser tests on Deno 2.x only
215219
if: ${{ matrix.deno == '2.x' }}
@@ -353,9 +357,12 @@ jobs:
353357
npm view @supabase/supabase-js version --registry http://localhost:4873
354358
npm view @supabase/supabase-js --registry http://localhost:4873 | head -20
355359
356-
- name: Run integration tests
360+
- name: Run integration tests in isolation
357361
run: |
358-
cd packages/core/supabase-js/test/integration/next
362+
TEST_DIR="/tmp/test-next-${{ github.run_id }}"
363+
mkdir -p "$TEST_DIR"
364+
cp -r packages/core/supabase-js/test/integration/next/* "$TEST_DIR/"
365+
cd "$TEST_DIR"
359366
echo "registry=http://localhost:4873/" > .npmrc
360367
npm install --legacy-peer-deps
361368
npx playwright install
@@ -432,9 +439,12 @@ jobs:
432439
npm view @supabase/supabase-js version --registry http://localhost:4873
433440
npm view @supabase/supabase-js --registry http://localhost:4873 | head -20
434441
435-
- name: Install test dependencies and run tests
442+
- name: Install test dependencies and run tests in isolation
436443
run: |
437-
cd packages/core/supabase-js/test/integration/expo
444+
TEST_DIR="/tmp/test-expo-${{ github.run_id }}"
445+
mkdir -p "$TEST_DIR"
446+
cp -r packages/core/supabase-js/test/integration/expo/* "$TEST_DIR/"
447+
cd "$TEST_DIR"
438448
echo "registry=http://localhost:4873/" > .npmrc
439449
npm install
440450
npm test
@@ -515,9 +525,12 @@ jobs:
515525
npm view @supabase/supabase-js version --registry http://localhost:4873
516526
npm view @supabase/supabase-js --registry http://localhost:4873 | head -20
517527
518-
- name: Install dependencies and run tests
528+
- name: Install dependencies and run tests in isolation
519529
run: |
520-
cd packages/core/supabase-js/test/integration/bun
530+
TEST_DIR="/tmp/test-bun-${{ github.run_id }}"
531+
mkdir -p "$TEST_DIR"
532+
cp -r packages/core/supabase-js/test/integration/bun/* "$TEST_DIR/"
533+
cd "$TEST_DIR"
521534
echo "registry=http://localhost:4873/" > .npmrc
522535
bun install
523536
bun test

packages/core/auth-js/src/GoTrueClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ export default class GoTrueClient {
265265
* Create a new client for use in the browser.
266266
*/
267267
constructor(options: GoTrueClientOptions) {
268+
console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (auth-js) - if you see this, local packages are being used')
268269
this.instanceID = GoTrueClient.nextInstanceID
269270
GoTrueClient.nextInstanceID += 1
270271

packages/core/postgrest-js/src/PostgrestClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export default class PostgrestClient<
6161
fetch?: Fetch
6262
} = {}
6363
) {
64+
console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (postgrest-js) - if you see this, local packages are being used')
6465
this.url = url
6566
this.headers = new Headers(headers)
6667
this.schemaName = schema

packages/core/realtime-js/src/RealtimeClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export default class RealtimeClient {
157157
* @param options.workerUrl The URL of the worker script. Defaults to https://realtime.supabase.com/worker.js that includes a heartbeat event call to keep the connection alive.
158158
*/
159159
constructor(endPoint: string, options?: RealtimeClientOptions) {
160+
console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (realtime-js) - if you see this, local packages are being used')
160161
// Validate required parameters
161162
if (!options?.params?.apikey) {
162163
throw new Error('API key is required to connect to Realtime')

packages/core/storage-js/src/StorageClient.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class StorageClient extends StorageBucketApi {
1616
opts?: StorageClientOptions
1717
) {
1818
super(url, headers, fetch, opts)
19+
console.warn('🔴 VERDACCIO TEST: This is the LOCAL BUILD from Verdaccio (storage-js) - if you see this, local packages are being used')
1920
}
2021

2122
/**

0 commit comments

Comments
 (0)