From 54f175102609d0a743d60e4a24c15c24d9941560 Mon Sep 17 00:00:00 2001 From: riccardom Date: Tue, 22 Sep 2026 12:06:35 +0200 Subject: [PATCH] [client] Say what each assertion was checking in the mobile test AGENTS.md asks for a context message on comparison and boolean assertions, and four of the ones added with this test had none, so a failure would have read as a bare Empty/Equal with no hint of which step of the round trip broke. Reported by cubic on the PR. --- client/mobile/profile_lifecycle_test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/mobile/profile_lifecycle_test.go b/client/mobile/profile_lifecycle_test.go index 38f1d0c22..9612f550d 100644 --- a/client/mobile/profile_lifecycle_test.go +++ b/client/mobile/profile_lifecycle_test.go @@ -63,7 +63,7 @@ func TestProfileSurvivesLogoutAndReload(t *testing.T) { // fails nor mints a key that nothing would write down. after := loadAsTheMobileSDKsDo(t, configPath) assert.Empty(t, after.PrivateKey, "loading a logged-out profile minted a key nothing will persist") - assert.Empty(t, after.SSHKey) + assert.Empty(t, after.SSHKey, "loading a logged-out profile minted an SSH key") assert.Equal(t, managementURL, after.ManagementURL.String(), "the rest of the profile did not survive the logout") // Switched away from and back: still the same profile, still loadable. @@ -73,9 +73,10 @@ func TestProfileSurvivesLogoutAndReload(t *testing.T) { active, err := pm.GetActiveProfile() require.NoError(t, err) - assert.Equal(t, created.ID, active.ID) + assert.Equal(t, created.ID, active.ID, "the profile switched to is not the active one") - assert.Equal(t, managementURL, loadAsTheMobileSDKsDo(t, configPath).ManagementURL.String()) + assert.Equal(t, managementURL, loadAsTheMobileSDKsDo(t, configPath).ManagementURL.String(), + "the profile did not survive the round of switches") } // The profile the SDKs fall back to gets the same treatment, since it is the @@ -91,6 +92,6 @@ func TestDefaultProfileSurvivesLogoutAndReload(t *testing.T) { require.NoError(t, pm.LogoutProfile(profilemanager.DefaultProfileName)) reloaded := loadAsTheMobileSDKsDo(t, configPath) - assert.Empty(t, reloaded.PrivateKey) + assert.Empty(t, reloaded.PrivateKey, "loading the logged-out default profile minted a key") assert.NotNil(t, reloaded.ManagementURL, "the profile lost its management URL") }