This commit is contained in:
andy committed 2026-08-18 18:23:11 +08:00
1 parent 648b274c55
commit 18cb51670c
14 files changed
+420 -171

No files matched your search

+9 -12
View File
@@ -21,35 +21,32 @@ describe("Go runtime settings compatibility fixture", () => {
publicSecretValue: "blank",
runtimeApplication: "mixed",
providerRuntimeApplication: "immediate",
providerPersistence: "postgres-with-environment-fallback"
providerPersistence: "postgres-with-environment-fallback",
settingsPersistence: "postgres-with-environment-fallback"
});
expect(fixture.allowedKeys).toContain("IMAGE_GENERATE_ENGINE");
expect(fixture.secretKeys).toContain("ALI_OSS_ACCESS_KEY_SECRET");
expect(fixture.allowedKeys).not.toContain("DATABASE_URL");
expect(fixture.databaseBackedKeys).toEqual(expect.arrayContaining([
"VOLCENGINE_ACCESS_KEY_ID",
"EVOLINK_API_KEY",
"SEEDANCE_API_KEY",
"BAILIAN_API_KEY",
"IMAGE_GENERATE_ENGINE",
"VIDEO_GENERATE_ENGINE"
]));
expect([...fixture.databaseBackedKeys].sort()).toEqual([...fixture.allowedKeys].sort());
});
it("requires a PostgreSQL table for mutable provider settings", async () => {
it("requires a PostgreSQL table for all mutable settings", async () => {
const migration = await readFile(runtimeSettingsMigrationUrl, "utf8");
expect(migration).toContain("create table if not exists platform_runtime_settings");
expect(migration).toContain("setting_key text primary key");
expect(migration).toContain("setting_value text not null");
});
it("refreshes database settings at both job-build and provider-call seams", async () => {
it("loads database settings for startup services and refreshes provider calls", async () => {
const [application, runtime, service] = await Promise.all([
readFile(applicationUrl, "utf8"),
readFile(runtimeUrl, "utf8"),
readFile(settingsServiceUrl, "utf8")
]);
expect(application).toContain("databaseSettingsService(getenv, database.Store)");
expect(application).toContain("databaseSettingsService(getenv, repository)");
expect(application).toContain("runtimeSettingsGetenv(ctx, getenv, runtimeSettings)");
expect(application).toContain("ParseAuthConfig(startupGetenv)");
expect(application).toContain("configuredOSSBlobStore(startupGetenv)");
expect(application).toContain("newRuntimeProviderResolver(getenv, runtimeSettings)");
expect(application).toContain("runtimeProviderJobBuilder{");
expect(runtime).toContain("runtimeSettingsGetenv(ctx, builder.fallback, builder.settings)");