Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dotnet/test/E2E/ClientSessionManagementE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ public async Task Should_Delete_Session_By_Id()
public async Task Should_Report_Error_When_Deleting_Unknown_Session_Id()
{
await Client.StartAsync();
const string UnknownSessionId = "00000000-0000-0000-0000-000000000000";

await AssertFailureAsync(
() => Client.DeleteSessionAsync("00000000-0000-0000-0000-000000000000"),
"Session file not found");
() => Client.DeleteSessionAsync(UnknownSessionId),
$"Failed to delete session {UnknownSessionId}");
}

[Fact]
Expand Down
8 changes: 5 additions & 3 deletions go/internal/e2e/client_api_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ func TestClientApiE2E(t *testing.T) {
})

t.Run("should report error when deleting unknown session id", func(t *testing.T) {
err := client.DeleteSession(t.Context(), "00000000-0000-0000-0000-000000000000")
sessionID := "00000000-0000-0000-0000-000000000000"
err := client.DeleteSession(t.Context(), sessionID)
if err == nil {
t.Fatal("Expected DeleteSession to fail for unknown id")
}
if !strings.Contains(strings.ToLower(err.Error()), "session file not found") {
t.Errorf("Expected error mentioning 'Session file not found', got %v", err)
expectedMessage := "failed to delete session " + sessionID
if !strings.Contains(strings.ToLower(err.Error()), expectedMessage) {
t.Errorf("Expected error mentioning %q, got %v", expectedMessage, err)
}
})

Expand Down
5 changes: 3 additions & 2 deletions nodejs/test/e2e/client_api.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ describe("Client session management", async () => {

it("should report error when deleting unknown session id", async () => {
await client.start();
const unknownSessionId = "00000000-0000-0000-0000-000000000000";

await assertFailure(
() => client.deleteSession("00000000-0000-0000-0000-000000000000"),
"Session file not found"
() => client.deleteSession(unknownSessionId),
`Failed to delete session ${unknownSessionId}`
);
});

Expand Down
5 changes: 3 additions & 2 deletions python/e2e/test_client_api_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ async def test_should_delete_session_by_id(self, ctx: E2ETestContext):

async def test_should_report_error_when_deleting_unknown_session_id(self, ctx: E2ETestContext):
await ctx.client.start()
unknown_session_id = "00000000-0000-0000-0000-000000000000"

with pytest.raises(Exception) as exc_info:
await ctx.client.delete_session("00000000-0000-0000-0000-000000000000")
assert "session file not found" in str(exc_info.value).lower()
await ctx.client.delete_session(unknown_session_id)
assert f"failed to delete session {unknown_session_id}" in str(exc_info.value).lower()

async def test_should_get_null_last_session_id_before_any_sessions_exist(
self, ctx: E2ETestContext
Expand Down
Loading