Skip to content

Commit

Permalink
skip running docker containers outside of linux runners
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed Nov 11, 2024
1 parent 25cadb6 commit 88f9473
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/adders/_tests/drizzle/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { fileURLToPath } from 'node:url';
import { execSync } from 'node:child_process';
import * as vitest from 'vitest';
Expand All @@ -10,7 +11,11 @@ import { pageServer, pageComp } from './fixtures.ts';

const { test, variants, prepareServer } = setupTest({ drizzle });

// only linux is supported for running docker containers in github runners
const noDocker = process.env.CI && process.platform !== 'linux';

vitest.beforeAll(() => {
if (noDocker) return;
const cwd = path.dirname(fileURLToPath(import.meta.url));
execSync('docker compose up --detach', { cwd, stdio: 'pipe' });

Expand All @@ -33,6 +38,7 @@ const testCases = [
test.concurrent.for(testCases)(
'queries database - $name - $variant',
async ({ options, variant }, { page, ...ctx }) => {
if (options.docker && noDocker) ctx.skip();
const cwd = await ctx.run(variant, { drizzle: options as any });

const ts = variant === 'kit-ts';
Expand Down

0 comments on commit 88f9473

Please sign in to comment.