Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
tstelzer committed Jun 14, 2024
1 parent f6e3b02 commit 5ced554
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 90 deletions.
85 changes: 0 additions & 85 deletions workspace/examples/src/as-library/simple.ts

This file was deleted.

5 changes: 1 addition & 4 deletions workspace/tons-of-tests-cli/src/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,11 @@ export const _diff = <I = unknown, O = unknown, T = unknown>({
);
const hasResults = yield* repository.hasResults(currentTestRun);

// FIXME: void type cast
// FIXME: avoid type cast
const previousTestRun = (yield* getPreviousTestRunResults(
testSuite,
)) as P.Option.Option<PT.Test.TestRunResults<I, O, T>>;

// FIXME: I can't filter before runCollectRecord, as
// I need to calculate the stats first. Not sure how
// to do this better.
const filterUnchanged =
(previous: P.Option.Option<PT.Test.TestRunResults>) =>
({
Expand Down
6 changes: 5 additions & 1 deletion workspace/tons-of-tests-cli/src/summarize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const andTags = Options.text('all-tags').pipe(
Options.withDescription('Filter tags (AND).'),
);

// TEST: summarize --labels doesn't affect the db (i.e. same test results are stored)
// TEST: summarize --run -> commit -> summarize --run is idempotent
export const _sumarize = <I = unknown, O = unknown, T = unknown>({
labels: maybeLabels,
orTags: maybeOrTags,
Expand Down Expand Up @@ -113,6 +115,7 @@ export const _sumarize = <I = unknown, O = unknown, T = unknown>({
}).pipe(
P.Effect.flatMap(PT.Test.runCollectRecord(currentTestRun)),
P.Effect.tap(P.Effect.logDebug('from run')),
P.Effect.map(filter),
);

const getFromCache = () =>
Expand All @@ -121,12 +124,13 @@ export const _sumarize = <I = unknown, O = unknown, T = unknown>({
.pipe(
PT.Test.runCollectRecord(currentTestRun),
P.Effect.tap(P.Effect.logDebug('from cache')),
P.Effect.map(filter),
);

const testRun: PT.Test.TestRunResults = yield* P.Effect.if(
shouldRun || !hasResults,
{onTrue: getFromRun, onFalse: getFromCache},
).pipe(P.Effect.map(filter));
);

yield* P.Effect.logDebug('testRun');

Expand Down

0 comments on commit 5ced554

Please sign in to comment.