Skip to content

Commit 1cdde87

Browse files
PR Batch Testerclaude
andcommitted
test: drop tests that only check the interactive flag is passed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent bbb8bdd commit 1cdde87

2 files changed

Lines changed: 0 additions & 99 deletions

File tree

‎apps/server/src/git/GitManager.test.ts‎

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as NodeChildProcess from "node:child_process";
66

77
import * as NodeServices from "@effect/platform-node/NodeServices";
88
import { it } from "@effect/vitest";
9-
import * as Clock from "effect/Clock";
109
import * as Context from "effect/Context";
1110
import * as Effect from "effect/Effect";
1211
import * as Deferred from "effect/Deferred";
@@ -66,7 +65,6 @@ import {
6665
toForgejoChangeRequest,
6766
} from "@t3tools/source-control-forgejo/server/forgejoPullRequests";
6867
import type { SourceControlProvider } from "@t3tools/source-control-core/server/SourceControlProvider";
69-
import * as SourceControlRateLimit from "@t3tools/source-control-core/server/SourceControlRateLimit";
7068
import * as SourceControlProviderRegistry from "../sourceControl/SourceControlProviderRegistry.ts";
7169
import * as ServerConfig from "../config.ts";
7270
import * as ProjectionStore from "../orchestration-v2/ProjectionStore.ts";
@@ -2027,59 +2025,6 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
20272025
}),
20282026
);
20292027

2030-
it.effect("resolves a user's pull request while background reads to its host are paused", () =>
2031-
Effect.gen(function* () {
2032-
const { service } = createGitHubProviderWithFakeGh({
2033-
pullRequest: {
2034-
number: 91,
2035-
title: "Safe checkout PR",
2036-
url: "https://github.com/pingdotgg/codething-mvp/pull/91",
2037-
baseRefName: "main",
2038-
headRefName: "feature/pr-safe",
2039-
state: "open",
2040-
},
2041-
});
2042-
const limits = yield* SourceControlRateLimit.make;
2043-
const key = { provider: SourceControlProviderKind.make("github"), host: "github.com" };
2044-
yield* limits.recordRateLimit({
2045-
...key,
2046-
lease: 0,
2047-
retryAt: (yield* Clock.currentTimeMillis) + 60_000,
2048-
});
2049-
// Gated like BitbucketApi's reads: refused during a pause unless a user is waiting.
2050-
const getChangeRequest: SourceControlProvider["Service"]["getChangeRequest"] = (input) =>
2051-
SourceControlRateLimit.Interactive.pipe(
2052-
Effect.flatMap((interactive) =>
2053-
limits.check(key, interactive ? { allowPaused: true } : undefined),
2054-
),
2055-
Effect.mapError(
2056-
(cause) =>
2057-
new SourceControlProviderFailure({
2058-
provider: key.provider,
2059-
operation: "getChangeRequest",
2060-
cwd: input.cwd,
2061-
detail: cause.detail,
2062-
cause,
2063-
}),
2064-
),
2065-
Effect.andThen(service.getChangeRequest(input)),
2066-
);
2067-
const background = yield* Effect.flip(
2068-
getChangeRequest({ cwd: process.cwd(), reference: "91" }),
2069-
);
2070-
expect(background.cause).toMatchObject({ _tag: "SourceControlRateLimitPausedError" });
2071-
2072-
const { manager } = yield* makeManager({
2073-
sourceControlProvider: { ...service, getChangeRequest },
2074-
});
2075-
const { pullRequest } = yield* manager.resolvePullRequest({
2076-
cwd: process.cwd(),
2077-
reference: "91",
2078-
});
2079-
expect(pullRequest.number).toBe(91);
2080-
}),
2081-
);
2082-
20832028
it.effect(
20842029
"status ignores unrelated fork PRs when the current branch tracks the same repository",
20852030
() =>

‎apps/server/src/sourceControl/SourceControlRepositoryService.test.ts‎

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { SourceControlProviderKind } from "@t3tools/contracts";
22
import * as NodePath from "@effect/platform-node/NodePath";
33
import * as NodeServices from "@effect/platform-node/NodeServices";
44
import { assert, it } from "@effect/vitest";
5-
import * as Clock from "effect/Clock";
65
import * as Effect from "effect/Effect";
76
import * as FileSystem from "effect/FileSystem";
87
import * as Path from "effect/Path";
@@ -19,7 +18,6 @@ import {
1918
import * as ServerConfig from "../config.ts";
2019
import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
2120
import type * as SourceControlProvider from "@t3tools/source-control-core/server/SourceControlProvider";
22-
import * as SourceControlRateLimit from "@t3tools/source-control-core/server/SourceControlRateLimit";
2321
import * as SourceControlProviderRegistry from "./SourceControlProviderRegistry.ts";
2422
import * as SourceControlRepositoryService from "./SourceControlRepositoryService.ts";
2523

@@ -103,48 +101,6 @@ function layer(input: {
103101
: layerService.pipe(Layer.provideMerge(NodeServices.layer));
104102
}
105103

106-
it.effect("looks up a repository while background reads to its host are paused", () =>
107-
Effect.gen(function* () {
108-
const limits = yield* SourceControlRateLimit.make;
109-
const key = { provider: SourceControlProviderKind.make("github"), host: "github.com" };
110-
yield* limits.recordRateLimit({
111-
...key,
112-
lease: 0,
113-
retryAt: (yield* Clock.currentTimeMillis) + 60_000,
114-
});
115-
// Gated like BitbucketApi's reads: refused during a pause unless a user is waiting.
116-
const getRepositoryCloneUrls = () =>
117-
SourceControlRateLimit.Interactive.pipe(
118-
Effect.flatMap((interactive) =>
119-
limits.check(key, interactive ? { allowPaused: true } : undefined),
120-
),
121-
Effect.mapError(
122-
(cause) =>
123-
new SourceControlProviderError({
124-
provider: key.provider,
125-
operation: "getRepositoryCloneUrls",
126-
cwd: process.cwd(),
127-
detail: cause.detail,
128-
cause,
129-
}),
130-
),
131-
Effect.as(CLONE_URLS),
132-
);
133-
const background = yield* Effect.flip(getRepositoryCloneUrls());
134-
assert.instanceOf(background.cause, SourceControlRateLimit.SourceControlRateLimitPausedError);
135-
136-
const repository = yield* Effect.gen(function* () {
137-
const service = yield* SourceControlRepositoryService.SourceControlRepositoryService;
138-
return yield* service.lookupRepository({
139-
provider: key.provider,
140-
repository: "octocat/t3code",
141-
});
142-
}).pipe(Effect.provide(layer({ provider: makeProvider({ getRepositoryCloneUrls }) })));
143-
144-
assert.strictEqual(repository.nameWithOwner, "octocat/t3code");
145-
}),
146-
);
147-
148104
it.effect("clones a looked-up repository after creating missing parent directories", () =>
149105
Effect.gen(function* () {
150106
const fs = yield* FileSystem.FileSystem;

0 commit comments

Comments
 (0)