Skip to content

Commit 298e72f

Browse files
stephentoubCopilot
andcommitted
Fix formatting/lint issues in cross-SDK E2E test fixes
- rust/tests/e2e/hooks_extended.rs: apply nightly rustfmt (shortening the tool name to "view" lets the closure collapse onto one line). - python: split the long todos PROMPT into implicit string concatenation to satisfy ruff E501 (line <= 100); string content is byte-identical. - dotnet: keep the postToolUseFailure Skip reason on a single line to match the existing codebase convention and dotnet format. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 547cf27 commit 298e72f

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

dotnet/test/E2E/HookLifecycleAndOutputE2ETests.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ public async Task Should_Allow_PostToolUse_To_Return_ModifiedResult()
342342
Assert.Contains("done", (response?.Data.Content ?? string.Empty).ToLowerInvariant());
343343
}
344344

345-
[Fact(Skip = "Fails with 1.0.64-0 runtime: built-in tools are not available when hooks " +
346-
"restrict availableTools, so the failure path cannot be exercised. Follow up with runtime team.")]
345+
[Fact(Skip = "Fails with 1.0.64-0 runtime: built-in tools are not available when hooks restrict availableTools, so the failure path cannot be exercised. Follow up with runtime team.")]
347346
public async Task Should_Invoke_PostToolUseFailure_Hook_For_Failed_Tool_Result()
348347
{
349348
var failureInputs = new List<PostToolUseFailureHookInput>();

python/e2e/test_session_todos_changed_e2e.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313
pytestmark = pytest.mark.asyncio(loop_scope="module")
1414

1515

16-
PROMPT = """Use the sql tool exactly once to execute all three of the following statements together, in this exact order, in a single sql tool call (a single query string containing all three statements):
17-
1. INSERT INTO todos (id, title, status) VALUES ('alpha', 'First todo', 'pending');
18-
2. INSERT INTO todos (id, title, status) VALUES ('beta', 'Second todo', 'done');
19-
3. INSERT INTO todo_deps (todo_id, depends_on) VALUES ('beta', 'alpha');
20-
Then stop. Do not insert any other rows or create any other tables."""
16+
PROMPT = (
17+
"Use the sql tool exactly once to execute all three of the following statements "
18+
"together, in this exact order, in a single sql tool call (a single query string "
19+
"containing all three statements):\n"
20+
"1. INSERT INTO todos (id, title, status) VALUES ('alpha', 'First todo', 'pending');\n"
21+
"2. INSERT INTO todos (id, title, status) VALUES ('beta', 'Second todo', 'done');\n"
22+
"3. INSERT INTO todo_deps (todo_id, depends_on) VALUES ('beta', 'alpha');\n"
23+
"Then stop. Do not insert any other rows or create any other tables."
24+
)
2125

2226

2327
class TestSessionTodosChanged:

rust/tests/e2e/hooks_extended.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,17 +588,16 @@ impl SessionHooks for RecordingHooks {
588588
input: PostToolUseInput,
589589
_ctx: HookContext,
590590
) -> Option<PostToolUseOutput> {
591-
let output = (self.post_tool.is_some() && input.tool_name == "view").then(|| {
592-
PostToolUseOutput {
591+
let output =
592+
(self.post_tool.is_some() && input.tool_name == "view").then(|| PostToolUseOutput {
593593
modified_result: Some(json!({
594594
"textResultForLlm": "modified by post hook",
595595
"resultType": "success",
596596
"toolTelemetry": {},
597597
})),
598598
suppress_output: Some(false),
599599
..PostToolUseOutput::default()
600-
}
601-
});
600+
});
602601
if let Some(tx) = &self.post_tool {
603602
let _ = tx.send(input);
604603
}

0 commit comments

Comments
 (0)