mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:20:43 +00:00
test: align provider contract aliases
This commit is contained in:
@@ -2,7 +2,7 @@ import { describePluginRegistrationContract } from "../../test/helpers/plugins/p
|
||||
|
||||
describePluginRegistrationContract({
|
||||
pluginId: "qwen",
|
||||
providerIds: ["qwen"],
|
||||
providerIds: ["qwen", "qwencloud", "modelstudio", "dashscope"],
|
||||
mediaUnderstandingProviderIds: ["qwen"],
|
||||
videoGenerationProviderIds: ["qwen"],
|
||||
requireDescribeImages: true,
|
||||
|
||||
@@ -118,11 +118,11 @@ describe("plugin activation boundary", () => {
|
||||
const staticNormalize = { allowPluginNormalization: false };
|
||||
expect(normalizeModelRef("google", "gemini-3.1-pro", staticNormalize)).toEqual({
|
||||
provider: "google",
|
||||
model: "gemini-3.1-pro-preview",
|
||||
model: "gemini-3.1-pro",
|
||||
});
|
||||
expect(normalizeModelRef("xai", "grok-4-fast-reasoning", staticNormalize)).toEqual({
|
||||
provider: "xai",
|
||||
model: "grok-4-fast",
|
||||
model: "grok-4-fast-reasoning",
|
||||
});
|
||||
expect(loadBundledPluginPublicSurfaceModuleSync).not.toHaveBeenCalled();
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export const pluginRegistrationContractCases = {
|
||||
},
|
||||
google: {
|
||||
pluginId: "google",
|
||||
providerIds: ["google", "google-gemini-cli"],
|
||||
providerIds: ["google", "google-gemini-cli", "google-vertex"],
|
||||
webSearchProviderIds: ["gemini"],
|
||||
realtimeVoiceProviderIds: ["google"],
|
||||
speechProviderIds: ["google"],
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
pluginRegistrationContractRegistry,
|
||||
providerContractLoadError,
|
||||
resolveProviderContractProvidersForPluginIds,
|
||||
} from "../../../src/plugins/contracts/registry.js";
|
||||
@@ -20,9 +19,6 @@ function resolveProviderContractProvidersFromPublicArtifact(
|
||||
}
|
||||
|
||||
export function describeProviderContracts(pluginId: string) {
|
||||
const providerIds =
|
||||
pluginRegistrationContractRegistry.find((entry) => entry.pluginId === pluginId)?.providerIds ??
|
||||
[];
|
||||
const resolveProviderEntries = (): ProviderContractEntry[] => {
|
||||
const publicArtifactProviders = resolveProviderContractProvidersFromPublicArtifact(pluginId);
|
||||
if (publicArtifactProviders) {
|
||||
@@ -33,6 +29,8 @@ export function describeProviderContracts(pluginId: string) {
|
||||
provider,
|
||||
}));
|
||||
};
|
||||
const resolveProviderIds = (): string[] =>
|
||||
resolveProviderEntries().map((entry) => entry.provider.id);
|
||||
|
||||
describe(`${pluginId} provider contract registry load`, () => {
|
||||
it("loads bundled providers without import-time registry failure", () => {
|
||||
@@ -42,7 +40,7 @@ export function describeProviderContracts(pluginId: string) {
|
||||
});
|
||||
});
|
||||
|
||||
for (const providerId of providerIds) {
|
||||
for (const providerId of resolveProviderIds()) {
|
||||
describe(`${pluginId}:${providerId} provider contract`, () => {
|
||||
// Resolve provider entries lazily so the non-isolated extension runner
|
||||
// does not race provider contract collection against other file imports.
|
||||
|
||||
Reference in New Issue
Block a user