e2e-worker-environment.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. const ASK_USER_QUESTION_AUTO_RESOLUTION_SETTING_SPEC =
  2. "conversation-session-ask-user-question-auto-resolution-setting.test.ts";
  3. export function resolveAskUserQuestionClockScaleForWorker({
  4. requestedScale,
  5. specs,
  6. }: {
  7. requestedScale?: string;
  8. specs: readonly string[];
  9. }): string | undefined {
  10. const normalizedRequestedScale = requestedScale?.trim();
  11. if (normalizedRequestedScale) return normalizedRequestedScale;
  12. return specs.some((spec) =>
  13. spec.replaceAll("\\", "/").endsWith(`/${ASK_USER_QUESTION_AUTO_RESOLUTION_SETTING_SPEC}`),
  14. )
  15. ? "20"
  16. : undefined;
  17. }
  18. /** 合成凭据测试不访问开发者钥匙串;原生存储专项必须走真实系统后端。 */
  19. export function resolveE2ECredentialSecret(
  20. specs: readonly string[],
  21. configured?: string,
  22. ): string | undefined {
  23. if (configured) return configured;
  24. if (
  25. specs.some((spec) =>
  26. /\/system-credential-(storage|owner|owner-mcp)\.test\.ts$/.test(spec.replaceAll("\\", "/")),
  27. )
  28. )
  29. return undefined;
  30. return "e2e-credential-storage";
  31. }