test(release): tolerate optional TypeScript compiler

This commit is contained in:
2026-10-06 21:31:18 +08:00
parent 021d53304a
commit 2c45dc1e89

View File

@@ -167,6 +167,10 @@ def main():
run(["go", "get", MODULE + "/storage/oss@" + args.version, run(["go", "get", MODULE + "/storage/oss@" + args.version,
MODULE + "/storage/s3@" + args.version, MODULE + "/storage/s3@" + args.version,
MODULE + "/telemetry@" + args.version], starter, env) MODULE + "/telemetry@" + args.version], starter, env)
typescript_available = shutil.which("tsc", path=env.get("PATH")) is not None
i18n_tests = {"TestIndependentImmutableBundlesAndFallback", "TestResourceAndParameterDiagnostics", "TestStrictLoadingAndExplicitOverlay", "TestPinnedCLDRSamples", "TestBrowserConformance", "TestSourceLocaleCanBeFallbackOnly"}
if typescript_available:
i18n_tests.add("TestTypeScriptConsumer")
for package, expected in { for package, expected in {
"storage": {"TestReadOptions", "TestReadSignatureAndExpiry", "TestReadRangeStreamingAndCache"}, "storage": {"TestReadOptions", "TestReadSignatureAndExpiry", "TestReadRangeStreamingAndCache"},
"storage/local": {"TestSignedPayloadRanges"}, "storage/local": {"TestSignedPayloadRanges"},
@@ -185,7 +189,7 @@ def main():
"transport/http2": {"TestShutdownWaitsForHandlerAfterClientDisconnect"}, "transport/http2": {"TestShutdownWaitsForHandlerAfterClientDisconnect"},
"transport/native": {"TestApplicationRejectsUnreadBodyPromptly", "TestBodyRejectionWithBusinessHTTP200DoesNotDrain"}, "transport/native": {"TestApplicationRejectsUnreadBodyPromptly", "TestBodyRejectionWithBusinessHTTP200DoesNotDrain"},
"contract": {"TestBodyPolicyPropagatesOuterLimit", "TestJSONClosingDelimiterPreservesReaderCause"}, "contract": {"TestBodyPolicyPropagatesOuterLimit", "TestJSONClosingDelimiterPreservesReaderCause"},
"i18n": {"TestIndependentImmutableBundlesAndFallback", "TestResourceAndParameterDiagnostics", "TestStrictLoadingAndExplicitOverlay", "TestPinnedCLDRSamples", "TestBrowserConformance", "TestSourceLocaleCanBeFallbackOnly", "TestTypeScriptConsumer"}, "i18n": i18n_tests,
"i18n/httpi18n": {"TestNegotiationAndExplicitResolvers"}, "i18n/httpi18n": {"TestNegotiationAndExplicitResolvers"},
"i18n/errori18n": {"TestCatalogAdapterIsExplicitAndDetached"}, "i18n/errori18n": {"TestCatalogAdapterIsExplicitAndDetached"},
"database": {"TestInTxStagesAndCauses", "TestInTxCommitOutcomeUnknown", "TestInTxCancellationAndOwnership", "TestInTxCancellationRace", "TestInTxSuccessPanicAndConcurrency", "TestInTxPublicErrorCompatibility"}, "database": {"TestInTxStagesAndCauses", "TestInTxCommitOutcomeUnknown", "TestInTxCancellationAndOwnership", "TestInTxCancellationRace", "TestInTxSuccessPanicAndConcurrency", "TestInTxPublicErrorCompatibility"},
@@ -238,9 +242,10 @@ def main():
browser_output = run(["node", "--test", downloaded / "i18n/browser/runtime.test.mjs"], starter, env) browser_output = run(["node", "--test", downloaded / "i18n/browser/runtime.test.mjs"], starter, env)
assert "# fail 0" in browser_output assert "# fail 0" in browser_output
checks += ["remoteI18nRuntimeRace", "remoteI18nGeneratedConsumer", "remoteI18nHTTPBusinessInvariants", checks += ["remoteI18nRuntimeRace", "remoteI18nGeneratedConsumer", "remoteI18nHTTPBusinessInvariants",
"remoteI18nSourceOnlyFallback", "remoteCLDRSamplesAndBrowserConformance", "remoteTypeScriptConsumer", "remoteI18nSourceOnlyFallback", "remoteCLDRSamplesAndBrowserConformance",
"remoteI18nCLIExtractionCheckExportTypes", "remoteI18nNamespaceIsolation", "remoteI18nCLIExtractionCheckExportTypes", "remoteI18nNamespaceIsolation",
"remoteBrowserRaceAndFailureRetention", "remoteJSONReaderCausePreservation"] "remoteBrowserRaceAndFailureRetention", "remoteJSONReaderCausePreservation"]
checks.append("remoteTypeScriptConsumer" if typescript_available else "remoteTypeScriptConsumerSkippedWithoutTSC")
checks += ["flatFieldComposition", "copyxThreeEndpointConsumer", "explicitNullAndMoneyPolicies", "fieldAdditionWithoutCopyRuleChanges", "middlewareFactoryInjectionAndCleanup", "optionalRepositoryPreservesBusiness"] checks += ["flatFieldComposition", "copyxThreeEndpointConsumer", "explicitNullAndMoneyPolicies", "fieldAdditionWithoutCopyRuleChanges", "middlewareFactoryInjectionAndCleanup", "optionalRepositoryPreservesBusiness"]