mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
fix(ci): make the suites run under node, and start MinIO as a step
Both failures were environment-specific and invisible locally. The vitest projects only ever ran under bun here, because the containers used for local runs have no node at all. On a GitHub runner the vitest bin's `#!/usr/bin/env node` shebang wins, and node's ESM resolver cannot resolve the extensionless 'next/server' that next-auth/lib/env.js imports, so all 17 api suites died with ERR_MODULE_NOT_FOUND. The next-auth inline rule that the unit project already carried is now declared at the root so every project inherits it. All three projects verified under node as well as bun. The e2e job could never start: a GitHub Actions `services:` block cannot pass a command to its container, and the MinIO entrypoint requires `server /data`, so the container printed its usage text and exited. MinIO now starts as a step with `docker run`, which means the job can no longer run inside a container, which in turn removes the reason the Playwright image was needed at all. The browser is installed on the runner instead, so the image tag no longer has to be kept in lockstep with the npm package.
This commit is contained in:
+14
-10
@@ -5,6 +5,20 @@ import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
export default defineConfig({
|
||||
plugins: [tsconfigPaths()],
|
||||
test: {
|
||||
server: {
|
||||
deps: {
|
||||
// Anything reaching lib/auth.ts pulls in next-auth, whose lib/env.js imports
|
||||
// the extensionless specifier 'next/server'. Node's ESM resolver cannot
|
||||
// resolve that, so the module has to go through Vite's resolver instead of
|
||||
// being externalised. Bun resolves it either way, which is why this is easy
|
||||
// to miss: the containers used locally have no node at all, so vitest runs
|
||||
// under bun there, while on a GitHub runner the vitest bin's
|
||||
// `#!/usr/bin/env node` shebang wins and every suite that touches auth dies
|
||||
// with ERR_MODULE_NOT_FOUND. Declared at the root so all three projects
|
||||
// inherit it through `extends: true`.
|
||||
inline: [/next-auth/],
|
||||
},
|
||||
},
|
||||
projects: [
|
||||
{
|
||||
extends: true,
|
||||
@@ -12,16 +26,6 @@ export default defineConfig({
|
||||
name: 'unit',
|
||||
environment: 'node',
|
||||
include: ['tests/unit/**/*.test.ts'],
|
||||
server: {
|
||||
deps: {
|
||||
// lib/auth.ts pulls in next-auth, whose lib/env.js imports
|
||||
// 'next/server'. Node's ESM resolver cannot resolve that extensionless
|
||||
// specifier, so the module has to go through Vite's resolver instead
|
||||
// of being externalised. Bun resolves it either way; this keeps the
|
||||
// suite runnable under plain Node too, which is how coverage runs.
|
||||
inline: [/next-auth/],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user