Skip to content

Commit 8d6b760

Browse files
fix: review test reuse writeSkill
1 parent e9bf2b2 commit 8d6b760

3 files changed

Lines changed: 8 additions & 17 deletions

File tree

src/__tests__/CodexACPAgent/e2e/acp-e2e.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ import {
1111
type SpawnedAgentFixture,
1212
} from "./acp-e2e-test-utils";
1313

14-
const HELLO_WORLD_ADDITIONAL_ROOT_FIXTURE = "hello-world";
14+
const HELLO_WORLD_ADDITIONAL_ROOT_NAME = "hello-world";
1515
const HELLO_WORLD_MARKETPLACE_NAME = "additional-roots-hello-world";
16+
const HELLO_WORLD_SKILL = {
17+
name: "hello",
18+
description: "Use when the user asks for a hello world skill.",
19+
body: "Respond with a concise hello world message and mention that the local plugin skill is active.",
20+
};
1621

1722
describeE2E("E2E tests", () => {
1823
let fixture: SpawnedAgentFixture | null = null;
@@ -170,7 +175,8 @@ describeE2E("E2E tests", () => {
170175
});
171176

172177
async function prepareHelloWorldAdditionalRoot(fixture: SpawnedAgentFixture): Promise<string> {
173-
const additionalRoot = fixture.copyAdditionalRootFixture(HELLO_WORLD_ADDITIONAL_ROOT_FIXTURE);
178+
const additionalRoot = path.join(fixture.workspaceDir, "..", "additional-roots", HELLO_WORLD_ADDITIONAL_ROOT_NAME);
179+
fixture.writeSkill(HELLO_WORLD_SKILL, path.join(additionalRoot, ".agents", "skills"));
174180
await fixture.removeMarketplace(HELLO_WORLD_MARKETPLACE_NAME);
175181
return additionalRoot;
176182
}

src/__tests__/CodexACPAgent/e2e/data/hello-world/.agents/skills/hello/SKILL.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/__tests__/CodexACPAgent/e2e/spawned-agent-fixture.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export interface SpawnedAgentFixture {
2828
readonly connection: acp.ClientSideConnection;
2929
readonly workspaceDir: string;
3030
createSession(options?: CreateSessionOptions): Promise<acp.NewSessionResponse>;
31-
copyAdditionalRootFixture(name: string): string;
3231
hasMarketplace(marketplaceName: string): Promise<boolean>;
3332
removeMarketplace(marketplaceName: string): Promise<void>;
3433
restart(): Promise<SpawnedAgentFixture>;
@@ -186,14 +185,6 @@ class SpawnedAgentFixtureImpl implements SpawnedAgentFixture {
186185
});
187186
}
188187

189-
copyAdditionalRootFixture(name: string): string {
190-
const source = path.join(process.cwd(), "src", "__tests__", "CodexACPAgent", "e2e", "data", name);
191-
const destination = path.join(this.paths.rootDir, "additional-roots", name);
192-
fs.mkdirSync(path.dirname(destination), {recursive: true});
193-
fs.cpSync(source, destination, {recursive: true});
194-
return destination;
195-
}
196-
197188
async hasMarketplace(marketplaceName: string): Promise<boolean> {
198189
const response = await this.connection.extMethod("marketplace/list", {
199190
cwd: this.workspaceDir,

0 commit comments

Comments
 (0)