Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2f6cb95

Browse files
committed
chnage order of tests
1 parent 637b4cd commit 2f6cb95

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

agent/agent_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,36 +1391,36 @@ func TestAgent_Startup(t *testing.T) {
13911391
require.Equal(t, homeDir, client.getStartup().ExpandedDirectory)
13921392
})
13931393

1394-
t.Run("HomeEnvironmentVariable", func(t *testing.T) {
1394+
t.Run("NotAbsoluteDirectory", func(t *testing.T) {
13951395
t.Parallel()
13961396

13971397
_, client, _, _, _ := setupAgent(t, agentsdk.Manifest{
13981398
StartupScript: "true",
13991399
StartupScriptTimeout: 30 * time.Second,
1400-
Directory: "$HOME",
1400+
Directory: "coder/coder",
14011401
}, 0)
14021402
assert.Eventually(t, func() bool {
14031403
return client.getStartup().Version != ""
14041404
}, testutil.WaitShort, testutil.IntervalFast)
14051405
homeDir, err := os.UserHomeDir()
14061406
require.NoError(t, err)
1407-
require.Equal(t, homeDir, client.getStartup().ExpandedDirectory)
1407+
require.Equal(t, filepath.Join(homeDir, "coder/coder"), client.getStartup().ExpandedDirectory)
14081408
})
14091409

1410-
t.Run("NotAbsoluteDirectory", func(t *testing.T) {
1410+
t.Run("HomeEnvironmentVariable", func(t *testing.T) {
14111411
t.Parallel()
14121412

14131413
_, client, _, _, _ := setupAgent(t, agentsdk.Manifest{
14141414
StartupScript: "true",
14151415
StartupScriptTimeout: 30 * time.Second,
1416-
Directory: "coder/coder",
1416+
Directory: "$HOME",
14171417
}, 0)
14181418
assert.Eventually(t, func() bool {
14191419
return client.getStartup().Version != ""
14201420
}, testutil.WaitShort, testutil.IntervalFast)
14211421
homeDir, err := os.UserHomeDir()
14221422
require.NoError(t, err)
1423-
require.Equal(t, filepath.Join(homeDir, "coder/coder"), client.getStartup().ExpandedDirectory)
1423+
require.Equal(t, homeDir, client.getStartup().ExpandedDirectory)
14241424
})
14251425
}
14261426

0 commit comments

Comments
 (0)