Skip to content

Commit 7231232

Browse files
Fix invalid tests
1 parent 6d73ed7 commit 7231232

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

dotnet/test/PerSessionAuthTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ public async Task ShouldBeUnauthenticatedWithoutToken()
9898

9999
var authStatus = await session.Rpc.Auth.GetStatusAsync();
100100

101-
Assert.False(authStatus.IsAuthenticated);
101+
// Without a per-session token, there is no per-session identity.
102+
// In CI the process-level fake token may still authenticate globally,
103+
// so we check Login rather than IsAuthenticated.
104+
Assert.Null(authStatus.Login);
102105
}
103106

104107
[Fact]

go/internal/e2e/per_session_auth_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@ func TestPerSessionAuth(t *testing.T) {
111111
t.Fatalf("Failed to get auth status: %v", err)
112112
}
113113

114-
if authStatus.IsAuthenticated {
115-
t.Errorf("Expected session to be unauthenticated without token")
114+
// Without a per-session token, there is no per-session identity.
115+
// In CI the process-level fake token may still authenticate globally,
116+
// so we check Login rather than IsAuthenticated.
117+
if authStatus.Login != "" {
118+
t.Errorf("Expected no per-session login without token, got %q", authStatus.Login)
116119
}
117120
})
118121

nodejs/test/e2e/per_session_auth.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ describe("Per-session GitHub auth", async () => {
8181
});
8282

8383
const authStatus = await session.rpc.auth.getStatus();
84-
// Without a GitHub token, the session should not be authenticated
85-
// (since the SDK test runs without global auth)
86-
expect(authStatus.isAuthenticated).toBe(false);
84+
// Without a per-session GitHub token, there is no per-session identity.
85+
// In CI the process-level fake token may still authenticate globally,
86+
// so we check login rather than isAuthenticated.
87+
expect(authStatus.login).toBeFalsy();
8788

8889
await session.disconnect();
8990
});

python/e2e/test_per_session_auth.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ async def test_should_return_unauthenticated_when_no_token_provided(
9898
)
9999

100100
auth_status = await session.rpc.auth.get_status()
101-
assert auth_status.is_authenticated is False
101+
# Without a per-session token, there is no per-session identity.
102+
# In CI the process-level fake token may still authenticate globally,
103+
# so we check login rather than is_authenticated.
104+
assert auth_status.login is None
102105

103106
await session.disconnect()
104107

0 commit comments

Comments
 (0)