From e1392c178a7423e7ca89f66af822366e8b14faf4 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Tue, 8 Jul 2025 21:31:17 +0300 Subject: [PATCH] pin bun and deno versions within integration script instead of within each project --- integrationTests/conditions/test.js | 4 ++-- integrationTests/dev-bun/package.json | 2 +- integrationTests/dev-deno/package.json | 2 +- integrationTests/prod-bun/package.json | 2 +- integrationTests/prod-deno/package.json | 2 +- integrationTests/ts/test.js | 2 +- resources/integration-test.ts | 13 ++++++++++++- 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/integrationTests/conditions/test.js b/integrationTests/conditions/test.js index 461f022c12..d6eb538c99 100644 --- a/integrationTests/conditions/test.js +++ b/integrationTests/conditions/test.js @@ -20,12 +20,12 @@ for (const { version, moduleSync } of nodeTests) { console.log('Testing on bun (moduleSync: true) ...'); childProcess.execSync( - `docker run --rm --volume "$PWD":/usr/src/app -w /usr/src/app --env MODULE_SYNC=true oven/bun:alpine bun ./check.mjs`, + `docker run --rm --volume "$PWD":/usr/src/app -w /usr/src/app --env MODULE_SYNC=true oven/bun:"$BUN_VERSION"-slim bun ./check.mjs`, { stdio: 'inherit' }, ); console.log('Testing on deno (moduleSync: false) ...'); childProcess.execSync( - `docker run --rm --volume "$PWD":/usr/src/app -w /usr/src/app --env MODULE_SYNC=false denoland/deno:alpine-2.4.1 deno run --allow-read --allow-env ./check.mjs`, + `docker run --rm --volume "$PWD":/usr/src/app -w /usr/src/app --env MODULE_SYNC=false denoland/deno:alpine-"$DENO_VERSION" deno run --allow-read --allow-env ./check.mjs`, { stdio: 'inherit' }, ); diff --git a/integrationTests/dev-bun/package.json b/integrationTests/dev-bun/package.json index bf17f73aaa..4b955f6116 100644 --- a/integrationTests/dev-bun/package.json +++ b/integrationTests/dev-bun/package.json @@ -2,7 +2,7 @@ "description": "graphql-js development mode should work with Bun", "private": true, "scripts": { - "test": "docker run --rm --volume \"$PWD:/usr/src/app\" -w /usr/src/app oven/bun:1.2.18-slim bun test.js" + "test": "docker run --rm --volume \"$PWD\":/usr/src/app -w /usr/src/app oven/bun:\"$BUN_VERSION\"-slim bun test.js" }, "dependencies": { "graphql": "file:../graphql.tgz" diff --git a/integrationTests/dev-deno/package.json b/integrationTests/dev-deno/package.json index af11eabe36..f6c0525ec8 100644 --- a/integrationTests/dev-deno/package.json +++ b/integrationTests/dev-deno/package.json @@ -2,7 +2,7 @@ "description": "graphql-js development mode should work with Deno", "private": true, "scripts": { - "test": "docker run --rm --volume \"$PWD:/usr/src/app\" -w /usr/src/app denoland/deno:alpine-2.4.1 deno run --allow-env=NODE_ENV test.js" + "test": "docker run --rm --volume \"$PWD\":/usr/src/app -w /usr/src/app denoland/deno:alpine-\"$DENO_VERSION\" deno run --allow-env=NODE_ENV test.js" }, "dependencies": { "graphql": "file:../graphql.tgz" diff --git a/integrationTests/prod-bun/package.json b/integrationTests/prod-bun/package.json index 808470409b..458560b6fa 100644 --- a/integrationTests/prod-bun/package.json +++ b/integrationTests/prod-bun/package.json @@ -2,7 +2,7 @@ "description": "graphql-js production mode should work with Bun", "private": true, "scripts": { - "test": "docker run --rm --volume \"$PWD:/usr/src/app\" -w /usr/src/app oven/bun:1.2.18-slim bun --define process.env.NODE_ENV='\"production\"' test.js" + "test": "docker run --rm --volume \"$PWD\":/usr/src/app -w /usr/src/app oven/bun:\"$BUN_VERSION\"-slim bun --define process.env.NODE_ENV='\"production\"' test.js" }, "dependencies": { "graphql": "file:../graphql.tgz" diff --git a/integrationTests/prod-deno/package.json b/integrationTests/prod-deno/package.json index baa215801b..8cede53be3 100644 --- a/integrationTests/prod-deno/package.json +++ b/integrationTests/prod-deno/package.json @@ -2,7 +2,7 @@ "description": "graphql-js production mode should work with Deno", "private": true, "scripts": { - "test": "docker run --rm --volume \"$PWD:/usr/src/app\" -w /usr/src/app denoland/deno:alpine-2.4.1 deno run --allow-env --preload env-shim.js test.js" + "test": "docker run --rm --volume \"$PWD\":/usr/src/app -w /usr/src/app denoland/deno:alpine-\"$DENO_VERSION\" deno run --allow-env --preload env-shim.js test.js" }, "dependencies": { "graphql": "file:../graphql.tgz" diff --git a/integrationTests/ts/test.js b/integrationTests/ts/test.js index 726d1129b6..55c52f5f7b 100644 --- a/integrationTests/ts/test.js +++ b/integrationTests/ts/test.js @@ -15,7 +15,7 @@ for (const version of tsVersions) { console.log('Testing on deno ...'); childProcess.execSync( - `docker run --rm --volume "$PWD":/usr/src/app -w /usr/src/app denoland/deno:alpine-2.4.1 deno check`, + `docker run --rm --volume "$PWD":/usr/src/app -w /usr/src/app denoland/deno:alpine-"$DENO_VERSION" deno check`, { stdio: 'inherit' }, ); diff --git a/resources/integration-test.ts b/resources/integration-test.ts index 02f2bc8dab..33df9f9825 100644 --- a/resources/integration-test.ts +++ b/resources/integration-test.ts @@ -4,6 +4,9 @@ import { describe, it } from 'mocha'; import { localRepoPath, makeTmpDir, npm, readPackageJSON } from './utils.js'; +const BUN_VERSION = '1.2.18'; +const DENO_VERSION = '2.4.1'; + describe('Integration Tests', () => { const { tmpDirPath } = makeTmpDir('graphql-js-integrationTmp'); fs.cpSync(localRepoPath('integrationTests'), tmpDirPath(), { @@ -31,7 +34,15 @@ describe('Integration Tests', () => { it(packageJSON.description, () => { // TODO: figure out a way to run it with --ignore-scripts npm({ cwd: projectPath, quiet: true }).install(); - npm({ cwd: projectPath, quiet: true }).run('test'); + npm({ + cwd: projectPath, + quiet: true, + env: { + ...process.env, + BUN_VERSION, + DENO_VERSION, + }, + }).run('test'); }).timeout(120000); }