Skip to content

Commit 789a3b9

Browse files
committed
fix: CI test failures, undefined prefix bug, and duplicate docs entries
- Fix objectStore test failures: replace manual PrismaClient(process.env.DATABASE_URL) with proper postgresAndMinioTest fixture (new combined testcontainer) - Fix undefined prefix in uploadDataToObjectStore: pathname now conditional - Remove duplicate MAXIMUM_DEV_QUEUE_SIZE/MAXIMUM_DEPLOYED_QUEUE_SIZE rows from docs
1 parent feac4be commit 789a3b9

File tree

4 files changed

+16
-23
lines changed

4 files changed

+16
-23
lines changed

apps/webapp/app/v3/objectStore.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export async function uploadDataToObjectStore(
293293
});
294294

295295
const url = new URL(config.baseUrl);
296-
url.pathname = `${prefix}/${filename}`;
296+
url.pathname = prefix ? `/${prefix}/${filename}` : `/${filename}`;
297297

298298
logger.debug("Uploading to object store", { url: url.href, protocol: protocol || "default" });
299299

apps/webapp/test/objectStore.test.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { minioTest } from "@internal/testcontainers";
1+
import { postgresAndMinioTest } from "@internal/testcontainers";
22
import { type IOPacket } from "@trigger.dev/core/v3";
33
import { PrismaClient } from "@trigger.dev/database";
44
import { afterAll, describe, expect, it, vi } from "vitest";
@@ -10,7 +10,7 @@ import {
1010
} from "~/v3/objectStore.server";
1111

1212
// Extend the timeout for container tests
13-
vi.setConfig({ testTimeout: 30_000 });
13+
vi.setConfig({ testTimeout: 60_000 });
1414

1515
// Helper to create a test environment
1616
async function createTestEnvironment(prisma: PrismaClient) {
@@ -54,21 +54,6 @@ async function createTestEnvironment(prisma: PrismaClient) {
5454
// Mock env module for testing
5555
const originalEnv = process.env;
5656

57-
// Create extended test with Prisma client
58-
const minioWithPrismaTest = minioTest.extend<{ prisma: PrismaClient }>({
59-
prisma: async ({}, use) => {
60-
const prisma = new PrismaClient({
61-
datasources: {
62-
db: {
63-
url: process.env.DATABASE_URL,
64-
},
65-
},
66-
});
67-
await use(prisma);
68-
await prisma.$disconnect();
69-
},
70-
});
71-
7257
describe("Object Storage", () => {
7358
describe("URI parsing functions", () => {
7459
it("should parse URI with protocol", () => {
@@ -106,7 +91,7 @@ describe("Object Storage", () => {
10691
});
10792
});
10893

109-
minioWithPrismaTest(
94+
postgresAndMinioTest(
11095
"should upload and download data without protocol (legacy)",
11196
async ({ minioConfig, prisma }) => {
11297
// Set up env for default provider
@@ -151,7 +136,7 @@ describe("Object Storage", () => {
151136
}
152137
);
153138

154-
minioWithPrismaTest(
139+
postgresAndMinioTest(
155140
"should upload and download data with protocol prefix",
156141
async ({ minioConfig, prisma }) => {
157142
// Set up env for named provider
@@ -197,7 +182,7 @@ describe("Object Storage", () => {
197182
}
198183
);
199184

200-
minioWithPrismaTest(
185+
postgresAndMinioTest(
201186
"should support migration from default provider to named provider",
202187
async ({ minioConfig, prisma }) => {
203188
const environment = await createTestEnvironment(prisma);

docs/self-hosting/env/webapp.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ mode: "wide"
143143
| `RUN_ENGINE_RATE_LIMIT_REJECTION_LOGS_ENABLED` | No | 1 | Run engine rate limit rejection logs. |
144144
| `RUN_ENGINE_RATE_LIMIT_LIMITER_LOGS_ENABLED` | No | 0 | Run engine rate limit limiter logs. |
145145
| `RUN_ENGINE_DEFAULT_MAX_TTL` | No || Maximum TTL for all runs (e.g. "14d"). Runs without a TTL use this as default; runs with a larger TTL are clamped. |
146-
| `MAXIMUM_DEV_QUEUE_SIZE` | No || Maximum queued runs per queue in development environments. |
147-
| `MAXIMUM_DEPLOYED_QUEUE_SIZE` | No || Maximum queued runs per queue in deployed (staging/prod) environments. |
148146
| **Misc** | | | |
149147
| `TRIGGER_TELEMETRY_DISABLED` | No || Disable telemetry. |
150148
| `NODE_MAX_OLD_SPACE_SIZE` | No | 8192 | Maximum memory allocation for Node.js heap in MiB (e.g. "4096" for 4GB). |

internal-packages/testcontainers/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,3 +292,13 @@ export const minioTest = test.extend<MinIOContext>({
292292
minioContainer,
293293
minioConfig,
294294
});
295+
296+
type PostgresAndMinIOContext = NetworkContext & PostgresContext & MinIOContext;
297+
298+
export const postgresAndMinioTest = test.extend<PostgresAndMinIOContext>({
299+
network,
300+
postgresContainer,
301+
prisma,
302+
minioContainer,
303+
minioConfig,
304+
});

0 commit comments

Comments
 (0)