@sedum-dev/core 0.1.0-alpha.20 → 0.1.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +16 -3
- package/dist/index.js +63 -28
- package/dist/run-result.schema.json +9 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export { j as Ai, k as AiValue, l as FlowStep, m as FormatCoverage, n as ModuleD
|
|
|
5
5
|
import { inspect } from 'node:util';
|
|
6
6
|
import 'playwright/test';
|
|
7
7
|
|
|
8
|
+
/** Whether a test's outcome decides the run; see `ResultTest.blocking`. */
|
|
9
|
+
declare function isBlocking(test: ResultTest): boolean;
|
|
10
|
+
/** A non-blocking test that failed or could not run. */
|
|
11
|
+
declare function nonBlockingFailure(test: ResultTest): boolean;
|
|
8
12
|
declare function resultTotals(tests: readonly ResultTest[], setupCalls?: readonly ResultCall[], selectedTestCount?: number): RunResult["totals"];
|
|
9
13
|
|
|
10
14
|
declare const ResultSourceSchema: z.ZodObject<{
|
|
@@ -687,6 +691,7 @@ declare const ResultTestSchema: z.ZodObject<{
|
|
|
687
691
|
verify: z.ZodString;
|
|
688
692
|
}, z.core.$strict>>;
|
|
689
693
|
tags: z.ZodArray<z.ZodString>;
|
|
694
|
+
blocking: z.ZodOptional<z.ZodLiteral<false>>;
|
|
690
695
|
state: z.ZodEnum<{
|
|
691
696
|
error: "error";
|
|
692
697
|
running: "running";
|
|
@@ -1000,6 +1005,7 @@ declare const ResultTotalsSchema: z.ZodObject<{
|
|
|
1000
1005
|
executedTests: z.ZodNumber;
|
|
1001
1006
|
passedTests: z.ZodNumber;
|
|
1002
1007
|
failedTests: z.ZodNumber;
|
|
1008
|
+
nonBlockingFailedTests: z.ZodOptional<z.ZodNumber>;
|
|
1003
1009
|
passedSteps: z.ZodNumber;
|
|
1004
1010
|
failedSteps: z.ZodNumber;
|
|
1005
1011
|
historicalAttempts: z.ZodNumber;
|
|
@@ -1079,6 +1085,7 @@ declare const RunResultSchema: z.ZodObject<{
|
|
|
1079
1085
|
executedTests: z.ZodNumber;
|
|
1080
1086
|
passedTests: z.ZodNumber;
|
|
1081
1087
|
failedTests: z.ZodNumber;
|
|
1088
|
+
nonBlockingFailedTests: z.ZodOptional<z.ZodNumber>;
|
|
1082
1089
|
passedSteps: z.ZodNumber;
|
|
1083
1090
|
failedSteps: z.ZodNumber;
|
|
1084
1091
|
historicalAttempts: z.ZodNumber;
|
|
@@ -1123,6 +1130,7 @@ declare const RunResultSchema: z.ZodObject<{
|
|
|
1123
1130
|
verify: z.ZodString;
|
|
1124
1131
|
}, z.core.$strict>>;
|
|
1125
1132
|
tags: z.ZodArray<z.ZodString>;
|
|
1133
|
+
blocking: z.ZodOptional<z.ZodLiteral<false>>;
|
|
1126
1134
|
state: z.ZodEnum<{
|
|
1127
1135
|
error: "error";
|
|
1128
1136
|
running: "running";
|
|
@@ -1504,6 +1512,7 @@ declare class RunRecorder {
|
|
|
1504
1512
|
private readonly started;
|
|
1505
1513
|
private value;
|
|
1506
1514
|
private readonly ordinals;
|
|
1515
|
+
private nonBlocking;
|
|
1507
1516
|
private lastTestId;
|
|
1508
1517
|
constructor(sink: ResultSink, runId?: string);
|
|
1509
1518
|
get runId(): string;
|
|
@@ -1517,8 +1526,12 @@ declare class RunRecorder {
|
|
|
1517
1526
|
start(): Promise<void>;
|
|
1518
1527
|
addSetupCalls(calls: readonly ResultCall[]): Promise<void>;
|
|
1519
1528
|
addDiscoveryProblems(problems: NonNullable<RunResult["discoveryProblems"]>): Promise<void>;
|
|
1520
|
-
/**
|
|
1521
|
-
|
|
1529
|
+
/**
|
|
1530
|
+
* Record the selection size and, for parallel or sharded runs, how it runs.
|
|
1531
|
+
* Tests named in `nonBlockingIds` are recorded with `blocking: false` when
|
|
1532
|
+
* they start.
|
|
1533
|
+
*/
|
|
1534
|
+
selectTests(count: number, execution?: ResultExecution, nonBlockingIds?: readonly string[]): Promise<void>;
|
|
1522
1535
|
/** The recording for a selection ordinal, if that test has started. */
|
|
1523
1536
|
testAt(ordinal: number): TestRecording | undefined;
|
|
1524
1537
|
/** The most recently started test, for sequential single-test callers. */
|
|
@@ -4203,4 +4216,4 @@ interface ActionRequest {
|
|
|
4203
4216
|
readonly description: string;
|
|
4204
4217
|
}
|
|
4205
4218
|
|
|
4206
|
-
export { ACCEPTANCE_POLICY_VERSION, type ActionRequest, AiValues, type Aim, type AimResult, type AllowRule, AssertionEngineError, type AssertionEngineErrorCode, type AssertionOptions, type AttemptDependencies, type AttemptReport, BACKOFF_JITTER, type BrowserContextOptions, type BrowserContextSession, type BrowserDriver, BrowserDriverError, type BrowserDriverErrorCode, type BrowserInstallResult, type BrowserKind, type BrowserLaunchOptions, type BrowserPage, type BrowserSession, type BrowserSignal, type BrowserSignalSource, BugDetector, type BugDetectorOptions, CACHE_FORMAT, CANDIDATE_LIMIT, CLASSIFICATION_PROMPT_VERSION, type CacheEntry, type CacheLookup, type CacheMissReason, type CacheStore, type CachedClassification, type Candidate, type CandidatePage, type ChoiceWhy, ClassificationBatchError, type ClassificationCache, type ClassificationDiagnostic, type ClassificationDiagnosticCode, type ClassificationInput, type ClassificationMetrics, type ClassificationOptions, type ClassificationProvider, type ClassificationResult, type ClassifiedFlowDefinition, type ClassifiedFlowSentence, type ClassifiedFlowStep, type ClassifiedModuleStep, type ClassifiedStep, type ClassifyFlowOptions, type ClickOptions, type ClickResult, type ControlStateResult, DEFAULT_ALLOW, DEFAULT_BAND, DEFAULT_CONTRADICTION_CUTOFF, DEFAULT_MAX_SEVERAL, DEFAULT_MIN_P, DEFAULT_PROVIDER_CONCURRENCY, DEFAULT_SEMANTIC_THRESHOLDS, DEFAULT_TUNING, DIGEST_LIMIT, DataResolutionError, DeclaredDataValue, type Detection, type DetectionCheck, type DetectorCall, type DigestResult, type DiscoveryProblem, type DiscoveryProblemCode, type EmittedStep, type EmittedTest, type ExplorationAdvisor, type ExploreAction, type ExploreActionKind, type ExploreAdvice, type ExploreAdviceRequest, type ExploreDecision, type ExploreDecisionRequest, type ExploreFailure, type ExploreFinding, type ExploreMode, type ExploreOptions, type ExploreResult, type ExploreRunMeta, type ExploreRunResult, type ExploreSafety, type ExploreStepView, type ExploreTuning, FileClassificationCache, type FillResult, type FillTarget, type FindingTest, type FlowClassificationDiagnostic, type FlowClassificationResult, FlowDefinition, FlowDiagnostic, type FlowRunResult, type FlowRunnerDependencies, FlowScalar, FlowSource, FlowToken, FlowValidationResult, type FrameBox, type FreshPage, FullValidationCoverage, GOAL_NO_MATCH, GateAborted, GateWaitExceeded, type GoalAction, type GoalChoice, type GoalDecision, type GoalOptions, type GoalPlanner, type GoalResult, type GoalState, type GoalValueState, type HelperCall, type HistoryMove, INSPECTED_PAGE_LIMITS, type ImportBinding, type InputSource, type InspectedPage, type InvalidListEntry, type ItemVerdict, type Judge, type JudgeDecision, type JudgePageDigest, type LineRange, type ListedDiagnostic, type ListedTest, type LoadedScriptFile, LocatorCacheConflict, type LocatorCacheDiagnostic, type LocatorCacheLookup, type LocatorCacheSeed, type LocatorDiagnostic, type LocatorFailure, type LocatorOptionDiagnostic, type LocatorOptions, type LocatorResult, MATCHER_VERSION, MAX_COOLDOWN_MS, MAX_PROVIDER_CONCURRENCY, MIN_MODEL_MARGIN, MIN_MODEL_PROBABILITY, MODEL_CHOICES, type MatchResult, type MeasureResult, type ModelChoice, type ModelClassification, type ModelDecision, ModuleBinding, ModuleBindingResolutionError, ModuleStep, NAME_LIMIT, NOT_CHECKED_OFFLINE_CODE, NO_PAGE_FINDINGS, type NavigationOptions, type NavigationResult, NoopCacheStore, NoopClassificationCache, OPERATIONS, OPERATION_SET_VERSION, type Operation, type OracleEvent, type OracleOptions, PAGE_KINDS, PAGE_PROTOCOL, PEER_LIMIT, type PageBridge, type PageCheck, PageChecks, type PageChecksOptions, type PageFindings, type PageInspection, type PageInspector, PageScriptError, PageSignalCollector, type PageVersion, type ParseFlowOptions, ParsedFlowResult, ParsedModuleResult, PlaywrightBrowserDriver, type PlaywrightBrowserDriverOptions, type ProjectFileValidation, type ProjectFiles, type ProjectValidationCounts, type ProjectValidationOptions, type ProjectValidationResult, type ProviderCall, type ProviderCallOptions, ProviderError, type ProviderErrorCode, ProviderGate, type ProviderGateOptions, type ProviderRate, type ProviderTokenUsage, RATE_LIMIT_BUDGET_MS, type ReadTargetResult, type RejectionOwner, RejectionRouter, type RelevanceProvider, type RelevanceTest, type RepeatedMemberPolicy, type ReportPrivacy, type ResolveFlowModulesOptions, type ResolvedDataEntry, type ResolvedFlowResult, ResolvedModuleCall, ResolvedStepTarget, type Resolver, type ResolverCandidate, type ResolverCandidates, type ResolverDecision, type ResolverItem, type ResolverOption, type ResultAttempt, ResultAttemptSchema, type ResultCall, ResultCallSchema, type ResultDetection, ResultDetectionSchema, ResultErrorSchema, type ResultExecution, ResultExecutionSchema, type ResultFrame, ResultFrameSchema, ResultJudgementSchema, ResultLocatorSchema, ResultObservationSchema, type ResultPage, ResultPageSchema, type ResultProblem, ResultProblemSchema, type ResultSink, ResultSourceSchema, type ResultStep, ResultStepSchema, type ResultTest, ResultTestSchema, ResultTotalsSchema, ReusableBrowserDriver, RunRecorder, type RunResult, RunResultSchema, type RunningTest, RuntimeUrl, RuntimeValue, SCRIPT_TEST_SUFFIX, SEMANTIC_CHECKS, ScriptRegistration, type ScriptSentence, type ScriptSentenceScan, type ScriptTest, ScriptUsageError, SeededRandom, type SemanticCheck, type SemanticThresholds, type SentenceClassification, type SentencePresentation, SentenceStep, type SettleOptions, type SettleResult, type ShrinkResult, type SignalSettleOptions, type StateInspection, type StepCommand, StepExecutionError, type StepExecutionOptions, type StepExecutionResult, type StepFailureCode, type StepFailurePhase, type StepFrames, type StepInspection, type StepOperation, type StepOperationKind, type StepOutcome, type StepSource, type StepTokenization, type StrayReason, TEST_SUFFIXES, type TargetCheckDecision, type TargetCheckInput, type TargetCheckOptions, type TargetChecker, type TargetIdentity, TestBody, type TestListing, TestRecording, type TestStartInput, type TraceEntry, type UnattributedRejection, ValidationInput, type VerifyDecision, type VerifyFlag, type VerifyOptions, type VerifyPolicy, type VerifyResult, type VisionFailure, type VisionObservation, type VisionResolver, WAIT_UNTIL, type WriteRecord, allowed, attributeRejection, backoffDelay, buildExploreRunResult, buildRelevanceBatches, callExtent, canonicalSentence, captureVisionObservation, checkRegistrations, classificationKey, classifyParsedFlow, classifySentenceSteps, classifySteps, clearPageRefs, clickTarget, closeQuietly, codePoints, collectCandidates, compareDiagnostics, controlState, cooldownDelay, dedupeDiagnostics, describeAction, describeRejection, discoverFlowFiles, discoverProjectFiles, displayPath, emitTest, evaluateModelAnswer, evaluateVerifyScores, executeSentence, executeStep, explore, findBrowserExecutable, findIdentityCollisions, firstDiagnostic, goalChoiceAccepted, goalFailureArtifacts, goalOperations, inlineValues, installChromium, isClaimSentence, isFlowScalar, isPageInspector, isRunWideProviderError, isSafeRole, isScriptTestFile, isStaticHoldsClaim, isWeakPeer, keyedDigest, listTests, liveCandidates, loadFlowFile, loadListingEntries, loadScriptFile, looksDestructive, matchEntry, matchLiveEntry, measure, navigationWhy, nextConcurrency, normalizeSignal, opaqueMatches, pageDigest, pageKey, pageVersion, parseAllowRule, parseDataTemplate, parseFlow, parseModule, parseRetryAfter, patternOperation, preflightSentence, projectCandidates, projectDigest, quietPage, readTarget, recordGoalAction, redactOpaqueText, relevanceQuestion, replay, reportPage, resolveData, resolveEntryUrl, resolveFlowModules, resolveModuleBindings, resolveTarget, resolveTypeOperand, resultCall, resultTotals, runFlow, runGoal, runResultJsonSchema, runScriptTest, runtimeFailure, safeSource, safeText, safeUrl, sameVisualVersion, scanImportBindings, scanLocalImports, scanScriptSentences, scriptListingEntries, semanticDetections, shrink, signalDetection, stageEntry, stateDetections, targetVariants, textDetections, tokenize, tokenizeStep, uniqueDetections, unknownCostCall, validateFlows, validateOperand, validateProject, validateRunResult, validateTypeOperand, valueEntries, verify, visibleText, visualCandidates, walkSuiteFiles };
|
|
4219
|
+
export { ACCEPTANCE_POLICY_VERSION, type ActionRequest, AiValues, type Aim, type AimResult, type AllowRule, AssertionEngineError, type AssertionEngineErrorCode, type AssertionOptions, type AttemptDependencies, type AttemptReport, BACKOFF_JITTER, type BrowserContextOptions, type BrowserContextSession, type BrowserDriver, BrowserDriverError, type BrowserDriverErrorCode, type BrowserInstallResult, type BrowserKind, type BrowserLaunchOptions, type BrowserPage, type BrowserSession, type BrowserSignal, type BrowserSignalSource, BugDetector, type BugDetectorOptions, CACHE_FORMAT, CANDIDATE_LIMIT, CLASSIFICATION_PROMPT_VERSION, type CacheEntry, type CacheLookup, type CacheMissReason, type CacheStore, type CachedClassification, type Candidate, type CandidatePage, type ChoiceWhy, ClassificationBatchError, type ClassificationCache, type ClassificationDiagnostic, type ClassificationDiagnosticCode, type ClassificationInput, type ClassificationMetrics, type ClassificationOptions, type ClassificationProvider, type ClassificationResult, type ClassifiedFlowDefinition, type ClassifiedFlowSentence, type ClassifiedFlowStep, type ClassifiedModuleStep, type ClassifiedStep, type ClassifyFlowOptions, type ClickOptions, type ClickResult, type ControlStateResult, DEFAULT_ALLOW, DEFAULT_BAND, DEFAULT_CONTRADICTION_CUTOFF, DEFAULT_MAX_SEVERAL, DEFAULT_MIN_P, DEFAULT_PROVIDER_CONCURRENCY, DEFAULT_SEMANTIC_THRESHOLDS, DEFAULT_TUNING, DIGEST_LIMIT, DataResolutionError, DeclaredDataValue, type Detection, type DetectionCheck, type DetectorCall, type DigestResult, type DiscoveryProblem, type DiscoveryProblemCode, type EmittedStep, type EmittedTest, type ExplorationAdvisor, type ExploreAction, type ExploreActionKind, type ExploreAdvice, type ExploreAdviceRequest, type ExploreDecision, type ExploreDecisionRequest, type ExploreFailure, type ExploreFinding, type ExploreMode, type ExploreOptions, type ExploreResult, type ExploreRunMeta, type ExploreRunResult, type ExploreSafety, type ExploreStepView, type ExploreTuning, FileClassificationCache, type FillResult, type FillTarget, type FindingTest, type FlowClassificationDiagnostic, type FlowClassificationResult, FlowDefinition, FlowDiagnostic, type FlowRunResult, type FlowRunnerDependencies, FlowScalar, FlowSource, FlowToken, FlowValidationResult, type FrameBox, type FreshPage, FullValidationCoverage, GOAL_NO_MATCH, GateAborted, GateWaitExceeded, type GoalAction, type GoalChoice, type GoalDecision, type GoalOptions, type GoalPlanner, type GoalResult, type GoalState, type GoalValueState, type HelperCall, type HistoryMove, INSPECTED_PAGE_LIMITS, type ImportBinding, type InputSource, type InspectedPage, type InvalidListEntry, type ItemVerdict, type Judge, type JudgeDecision, type JudgePageDigest, type LineRange, type ListedDiagnostic, type ListedTest, type LoadedScriptFile, LocatorCacheConflict, type LocatorCacheDiagnostic, type LocatorCacheLookup, type LocatorCacheSeed, type LocatorDiagnostic, type LocatorFailure, type LocatorOptionDiagnostic, type LocatorOptions, type LocatorResult, MATCHER_VERSION, MAX_COOLDOWN_MS, MAX_PROVIDER_CONCURRENCY, MIN_MODEL_MARGIN, MIN_MODEL_PROBABILITY, MODEL_CHOICES, type MatchResult, type MeasureResult, type ModelChoice, type ModelClassification, type ModelDecision, ModuleBinding, ModuleBindingResolutionError, ModuleStep, NAME_LIMIT, NOT_CHECKED_OFFLINE_CODE, NO_PAGE_FINDINGS, type NavigationOptions, type NavigationResult, NoopCacheStore, NoopClassificationCache, OPERATIONS, OPERATION_SET_VERSION, type Operation, type OracleEvent, type OracleOptions, PAGE_KINDS, PAGE_PROTOCOL, PEER_LIMIT, type PageBridge, type PageCheck, PageChecks, type PageChecksOptions, type PageFindings, type PageInspection, type PageInspector, PageScriptError, PageSignalCollector, type PageVersion, type ParseFlowOptions, ParsedFlowResult, ParsedModuleResult, PlaywrightBrowserDriver, type PlaywrightBrowserDriverOptions, type ProjectFileValidation, type ProjectFiles, type ProjectValidationCounts, type ProjectValidationOptions, type ProjectValidationResult, type ProviderCall, type ProviderCallOptions, ProviderError, type ProviderErrorCode, ProviderGate, type ProviderGateOptions, type ProviderRate, type ProviderTokenUsage, RATE_LIMIT_BUDGET_MS, type ReadTargetResult, type RejectionOwner, RejectionRouter, type RelevanceProvider, type RelevanceTest, type RepeatedMemberPolicy, type ReportPrivacy, type ResolveFlowModulesOptions, type ResolvedDataEntry, type ResolvedFlowResult, ResolvedModuleCall, ResolvedStepTarget, type Resolver, type ResolverCandidate, type ResolverCandidates, type ResolverDecision, type ResolverItem, type ResolverOption, type ResultAttempt, ResultAttemptSchema, type ResultCall, ResultCallSchema, type ResultDetection, ResultDetectionSchema, ResultErrorSchema, type ResultExecution, ResultExecutionSchema, type ResultFrame, ResultFrameSchema, ResultJudgementSchema, ResultLocatorSchema, ResultObservationSchema, type ResultPage, ResultPageSchema, type ResultProblem, ResultProblemSchema, type ResultSink, ResultSourceSchema, type ResultStep, ResultStepSchema, type ResultTest, ResultTestSchema, ResultTotalsSchema, ReusableBrowserDriver, RunRecorder, type RunResult, RunResultSchema, type RunningTest, RuntimeUrl, RuntimeValue, SCRIPT_TEST_SUFFIX, SEMANTIC_CHECKS, ScriptRegistration, type ScriptSentence, type ScriptSentenceScan, type ScriptTest, ScriptUsageError, SeededRandom, type SemanticCheck, type SemanticThresholds, type SentenceClassification, type SentencePresentation, SentenceStep, type SettleOptions, type SettleResult, type ShrinkResult, type SignalSettleOptions, type StateInspection, type StepCommand, StepExecutionError, type StepExecutionOptions, type StepExecutionResult, type StepFailureCode, type StepFailurePhase, type StepFrames, type StepInspection, type StepOperation, type StepOperationKind, type StepOutcome, type StepSource, type StepTokenization, type StrayReason, TEST_SUFFIXES, type TargetCheckDecision, type TargetCheckInput, type TargetCheckOptions, type TargetChecker, type TargetIdentity, TestBody, type TestListing, TestRecording, type TestStartInput, type TraceEntry, type UnattributedRejection, ValidationInput, type VerifyDecision, type VerifyFlag, type VerifyOptions, type VerifyPolicy, type VerifyResult, type VisionFailure, type VisionObservation, type VisionResolver, WAIT_UNTIL, type WriteRecord, allowed, attributeRejection, backoffDelay, buildExploreRunResult, buildRelevanceBatches, callExtent, canonicalSentence, captureVisionObservation, checkRegistrations, classificationKey, classifyParsedFlow, classifySentenceSteps, classifySteps, clearPageRefs, clickTarget, closeQuietly, codePoints, collectCandidates, compareDiagnostics, controlState, cooldownDelay, dedupeDiagnostics, describeAction, describeRejection, discoverFlowFiles, discoverProjectFiles, displayPath, emitTest, evaluateModelAnswer, evaluateVerifyScores, executeSentence, executeStep, explore, findBrowserExecutable, findIdentityCollisions, firstDiagnostic, goalChoiceAccepted, goalFailureArtifacts, goalOperations, inlineValues, installChromium, isBlocking, isClaimSentence, isFlowScalar, isPageInspector, isRunWideProviderError, isSafeRole, isScriptTestFile, isStaticHoldsClaim, isWeakPeer, keyedDigest, listTests, liveCandidates, loadFlowFile, loadListingEntries, loadScriptFile, looksDestructive, matchEntry, matchLiveEntry, measure, navigationWhy, nextConcurrency, nonBlockingFailure, normalizeSignal, opaqueMatches, pageDigest, pageKey, pageVersion, parseAllowRule, parseDataTemplate, parseFlow, parseModule, parseRetryAfter, patternOperation, preflightSentence, projectCandidates, projectDigest, quietPage, readTarget, recordGoalAction, redactOpaqueText, relevanceQuestion, replay, reportPage, resolveData, resolveEntryUrl, resolveFlowModules, resolveModuleBindings, resolveTarget, resolveTypeOperand, resultCall, resultTotals, runFlow, runGoal, runResultJsonSchema, runScriptTest, runtimeFailure, safeSource, safeText, safeUrl, sameVisualVersion, scanImportBindings, scanLocalImports, scanScriptSentences, scriptListingEntries, semanticDetections, shrink, signalDetection, stageEntry, stateDetections, targetVariants, textDetections, tokenize, tokenizeStep, uniqueDetections, unknownCostCall, validateFlows, validateOperand, validateProject, validateRunResult, validateTypeOperand, valueEntries, verify, visibleText, visualCandidates, walkSuiteFiles };
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,21 @@ import {
|
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
|
|
16
16
|
// src/run-result/validation.ts
|
|
17
|
+
function isBlocking(test2) {
|
|
18
|
+
return test2.blocking !== false;
|
|
19
|
+
}
|
|
20
|
+
function nonBlockingFailure(test2) {
|
|
21
|
+
return !isBlocking(test2) && (test2.verdict === "failed" || test2.state === "error");
|
|
22
|
+
}
|
|
23
|
+
function completedRunVerdict(tests) {
|
|
24
|
+
const blocking = tests.filter(isBlocking);
|
|
25
|
+
if (blocking.some((test2) => test2.verdict === "failed")) return "failed";
|
|
26
|
+
if (blocking.every((test2) => test2.verdict === "passed")) return "passed";
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
function runFlags(tests) {
|
|
30
|
+
return [...new Set(tests.filter(isBlocking).flatMap((test2) => test2.flags))];
|
|
31
|
+
}
|
|
17
32
|
function resultTotals(tests, setupCalls = [], selectedTestCount = tests.length) {
|
|
18
33
|
const selected = tests.flatMap(
|
|
19
34
|
(test2) => test2.attempts.filter((attempt) => attempt.id === test2.selectedAttemptId)
|
|
@@ -33,7 +48,10 @@ function resultTotals(tests, setupCalls = [], selectedTestCount = tests.length)
|
|
|
33
48
|
selectedTests: selectedTestCount,
|
|
34
49
|
executedTests: tests.filter((test2) => test2.attempts.length > 0).length,
|
|
35
50
|
passedTests: tests.filter((test2) => test2.verdict === "passed").length,
|
|
36
|
-
failedTests: tests.filter(
|
|
51
|
+
failedTests: tests.filter(
|
|
52
|
+
(test2) => isBlocking(test2) && test2.verdict === "failed"
|
|
53
|
+
).length,
|
|
54
|
+
...tests.some((test2) => !isBlocking(test2)) ? { nonBlockingFailedTests: tests.filter(nonBlockingFailure).length } : {},
|
|
37
55
|
passedSteps: steps.filter((step) => step.verdict === "passed").length,
|
|
38
56
|
failedSteps: steps.filter((step) => step.verdict === "failed").length,
|
|
39
57
|
historicalAttempts: tests.reduce(
|
|
@@ -208,9 +226,7 @@ function validateTest(test2, ids) {
|
|
|
208
226
|
function expectedRunVerdict(result) {
|
|
209
227
|
if (result.error || result.state !== "completed" || result.tests.length === 0)
|
|
210
228
|
return null;
|
|
211
|
-
|
|
212
|
-
if (result.tests.every((test2) => test2.verdict === "passed")) return "passed";
|
|
213
|
-
return null;
|
|
229
|
+
return completedRunVerdict(result.tests);
|
|
214
230
|
}
|
|
215
231
|
function validateRunAggregates(result) {
|
|
216
232
|
const expectedTotals = resultTotals(
|
|
@@ -226,15 +242,14 @@ function validateRunAggregates(result) {
|
|
|
226
242
|
result.verdict !== expectedRunVerdict(result),
|
|
227
243
|
"Run verdict differs from tests"
|
|
228
244
|
);
|
|
229
|
-
const runFlags = [...new Set(result.tests.flatMap((test2) => test2.flags))];
|
|
230
245
|
rejectIf(
|
|
231
|
-
JSON.stringify(result.flags) !== JSON.stringify(runFlags),
|
|
246
|
+
JSON.stringify(result.flags) !== JSON.stringify(runFlags(result.tests)),
|
|
232
247
|
"Run flags differ from tests"
|
|
233
248
|
);
|
|
234
249
|
}
|
|
235
250
|
function validateRunCompletion(result) {
|
|
236
251
|
const hasIncompleteTest = result.tests.some(
|
|
237
|
-
(test2) => test2.state !== "completed"
|
|
252
|
+
(test2) => test2.state !== "completed" && (isBlocking(test2) || test2.state !== "error")
|
|
238
253
|
);
|
|
239
254
|
rejectIf(
|
|
240
255
|
result.state === "completed" && (result.error !== null || result.tests.length === 0 || hasIncompleteTest),
|
|
@@ -486,6 +501,12 @@ var ResultTestSchema = z.strictObject({
|
|
|
486
501
|
description: z.string().max(512),
|
|
487
502
|
goal: z.strictObject({ text: z.string(), verify: z.string() }).optional(),
|
|
488
503
|
tags: z.array(z.string().max(120)),
|
|
504
|
+
/**
|
|
505
|
+
* `false` when `--non-blocking-labels` matched a tag: the test runs and is
|
|
506
|
+
* reported, but its failure or error does not decide the run. Absent means
|
|
507
|
+
* blocking.
|
|
508
|
+
*/
|
|
509
|
+
blocking: z.literal(false).optional(),
|
|
489
510
|
state,
|
|
490
511
|
verdict: verdict.nullable(),
|
|
491
512
|
flags: z.array(flag),
|
|
@@ -496,7 +517,10 @@ var ResultTotalsSchema = z.strictObject({
|
|
|
496
517
|
selectedTests: count,
|
|
497
518
|
executedTests: count,
|
|
498
519
|
passedTests: count,
|
|
520
|
+
/** Failed blocking tests; non-blocking failures count separately. */
|
|
499
521
|
failedTests: count,
|
|
522
|
+
/** Non-blocking tests that failed or could not run; present when any test is non-blocking. */
|
|
523
|
+
nonBlockingFailedTests: count.optional(),
|
|
500
524
|
passedSteps: count,
|
|
501
525
|
failedSteps: count,
|
|
502
526
|
historicalAttempts: count,
|
|
@@ -634,6 +658,20 @@ function newAttempt(runId, ordinal2, lane2) {
|
|
|
634
658
|
primaryProblemId: null
|
|
635
659
|
};
|
|
636
660
|
}
|
|
661
|
+
function newTest(input, attempt, blocking) {
|
|
662
|
+
return {
|
|
663
|
+
id: input.id,
|
|
664
|
+
file: input.file,
|
|
665
|
+
description: input.description ?? "",
|
|
666
|
+
tags: [...input.tags ?? []],
|
|
667
|
+
...blocking ? {} : { blocking: false },
|
|
668
|
+
state: "running",
|
|
669
|
+
verdict: null,
|
|
670
|
+
flags: [],
|
|
671
|
+
selectedAttemptId: attempt.id,
|
|
672
|
+
attempts: [attempt]
|
|
673
|
+
};
|
|
674
|
+
}
|
|
637
675
|
var RunRecorder = class {
|
|
638
676
|
constructor(sink, runId = randomUUID()) {
|
|
639
677
|
this.sink = sink;
|
|
@@ -660,6 +698,7 @@ var RunRecorder = class {
|
|
|
660
698
|
started = performance.now();
|
|
661
699
|
value;
|
|
662
700
|
ordinals = /* @__PURE__ */ new Map();
|
|
701
|
+
nonBlocking = /* @__PURE__ */ new Set();
|
|
663
702
|
lastTestId = null;
|
|
664
703
|
get runId() {
|
|
665
704
|
return this.value.runId;
|
|
@@ -677,9 +716,7 @@ var RunRecorder = class {
|
|
|
677
716
|
this.value.setupCalls,
|
|
678
717
|
Math.max(this.value.selectedTestCount ?? 0, this.value.tests.length)
|
|
679
718
|
),
|
|
680
|
-
flags:
|
|
681
|
-
...new Set(this.value.tests.flatMap((test2) => test2.flags))
|
|
682
|
-
]
|
|
719
|
+
flags: runFlags(this.value.tests)
|
|
683
720
|
};
|
|
684
721
|
await this.sink(validateRunResult(this.value));
|
|
685
722
|
}
|
|
@@ -728,10 +765,15 @@ var RunRecorder = class {
|
|
|
728
765
|
};
|
|
729
766
|
await this.publish();
|
|
730
767
|
}
|
|
731
|
-
/**
|
|
732
|
-
|
|
768
|
+
/**
|
|
769
|
+
* Record the selection size and, for parallel or sharded runs, how it runs.
|
|
770
|
+
* Tests named in `nonBlockingIds` are recorded with `blocking: false` when
|
|
771
|
+
* they start.
|
|
772
|
+
*/
|
|
773
|
+
async selectTests(count2, execution, nonBlockingIds = []) {
|
|
733
774
|
if (!Number.isSafeInteger(count2) || count2 < this.value.tests.length)
|
|
734
775
|
throw new Error("Selected test count is invalid");
|
|
776
|
+
this.nonBlocking = new Set(nonBlockingIds);
|
|
735
777
|
this.value = {
|
|
736
778
|
...this.value,
|
|
737
779
|
selectedTestCount: count2,
|
|
@@ -760,18 +802,11 @@ var RunRecorder = class {
|
|
|
760
802
|
const ordinal2 = input.ordinal ?? Math.max(-1, ...this.ordinals.values()) + 1;
|
|
761
803
|
if ([...this.ordinals.values()].includes(ordinal2))
|
|
762
804
|
throw new Error("Test ordinal already started");
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
tags: [...input.tags ?? []],
|
|
769
|
-
state: "running",
|
|
770
|
-
verdict: null,
|
|
771
|
-
flags: [],
|
|
772
|
-
selectedAttemptId: attempt.id,
|
|
773
|
-
attempts: [attempt]
|
|
774
|
-
};
|
|
805
|
+
const test2 = newTest(
|
|
806
|
+
input,
|
|
807
|
+
newAttempt(this.value.runId, 1, input.lane),
|
|
808
|
+
!this.nonBlocking.has(input.id)
|
|
809
|
+
);
|
|
775
810
|
const position = this.value.tests.findIndex(
|
|
776
811
|
(entry) => (this.ordinals.get(entry.id) ?? 0) > ordinal2
|
|
777
812
|
);
|
|
@@ -982,15 +1017,13 @@ var RunRecorder = class {
|
|
|
982
1017
|
};
|
|
983
1018
|
}
|
|
984
1019
|
const tests = this.value.tests;
|
|
985
|
-
const verdict2 = error2 || tests.length === 0
|
|
1020
|
+
const verdict2 = error2 || tests.length === 0 ? null : completedRunVerdict(tests);
|
|
986
1021
|
this.value = {
|
|
987
1022
|
...this.value,
|
|
988
1023
|
state: error2 ? terminalState : "completed",
|
|
989
1024
|
error: error2,
|
|
990
1025
|
verdict: verdict2,
|
|
991
|
-
flags:
|
|
992
|
-
...new Set(tests.flatMap((test2) => test2.flags))
|
|
993
|
-
],
|
|
1026
|
+
flags: runFlags(tests),
|
|
994
1027
|
finishedAt: at
|
|
995
1028
|
};
|
|
996
1029
|
await this.publish();
|
|
@@ -17521,6 +17554,7 @@ export {
|
|
|
17521
17554
|
goalOperations,
|
|
17522
17555
|
inlineValues,
|
|
17523
17556
|
installChromium,
|
|
17557
|
+
isBlocking,
|
|
17524
17558
|
isClaimSentence,
|
|
17525
17559
|
isFlowScalar,
|
|
17526
17560
|
isFullyValidated,
|
|
@@ -17543,6 +17577,7 @@ export {
|
|
|
17543
17577
|
measure,
|
|
17544
17578
|
navigationWhy,
|
|
17545
17579
|
nextConcurrency,
|
|
17580
|
+
nonBlockingFailure,
|
|
17546
17581
|
normalizeSignal,
|
|
17547
17582
|
opaqueMatches,
|
|
17548
17583
|
pageDigest,
|
|
@@ -198,6 +198,11 @@
|
|
|
198
198
|
"minimum": 0,
|
|
199
199
|
"maximum": 9007199254740991
|
|
200
200
|
},
|
|
201
|
+
"nonBlockingFailedTests": {
|
|
202
|
+
"type": "integer",
|
|
203
|
+
"minimum": 0,
|
|
204
|
+
"maximum": 9007199254740991
|
|
205
|
+
},
|
|
201
206
|
"passedSteps": {
|
|
202
207
|
"type": "integer",
|
|
203
208
|
"minimum": 0,
|
|
@@ -442,6 +447,10 @@
|
|
|
442
447
|
"maxLength": 120
|
|
443
448
|
}
|
|
444
449
|
},
|
|
450
|
+
"blocking": {
|
|
451
|
+
"type": "boolean",
|
|
452
|
+
"const": false
|
|
453
|
+
},
|
|
445
454
|
"state": {
|
|
446
455
|
"type": "string",
|
|
447
456
|
"enum": [
|