Skip to content

Commit 23c494f

Browse files
fix(agent/agentcontainers): resolve symlink in tests (coder#19440)
Fixes coder/internal#917
1 parent 67da780 commit 23c494f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

agent/agentcontainers/api_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,8 @@ func TestAPI(t *testing.T) {
16751675

16761676
coderBin, err := os.Executable()
16771677
require.NoError(t, err)
1678+
coderBin, err = filepath.EvalSymlinks(coderBin)
1679+
require.NoError(t, err)
16781680

16791681
mCCLI.EXPECT().List(gomock.Any()).Return(codersdk.WorkspaceAgentListContainersResponse{
16801682
Containers: []codersdk.WorkspaceAgentContainer{testContainer},
@@ -2455,6 +2457,8 @@ func TestAPI(t *testing.T) {
24552457

24562458
coderBin, err := os.Executable()
24572459
require.NoError(t, err)
2460+
coderBin, err = filepath.EvalSymlinks(coderBin)
2461+
require.NoError(t, err)
24582462

24592463
// Mock the `List` function to always return out test container.
24602464
mCCLI.EXPECT().List(gomock.Any()).Return(codersdk.WorkspaceAgentListContainersResponse{
@@ -2549,6 +2553,8 @@ func TestAPI(t *testing.T) {
25492553

25502554
coderBin, err := os.Executable()
25512555
require.NoError(t, err)
2556+
coderBin, err = filepath.EvalSymlinks(coderBin)
2557+
require.NoError(t, err)
25522558

25532559
// Mock the `List` function to always return out test container.
25542560
mCCLI.EXPECT().List(gomock.Any()).Return(codersdk.WorkspaceAgentListContainersResponse{
@@ -2654,6 +2660,8 @@ func TestAPI(t *testing.T) {
26542660

26552661
coderBin, err := os.Executable()
26562662
require.NoError(t, err)
2663+
coderBin, err = filepath.EvalSymlinks(coderBin)
2664+
require.NoError(t, err)
26572665

26582666
// Mock the `List` function to always return our test container.
26592667
mCCLI.EXPECT().List(gomock.Any()).Return(codersdk.WorkspaceAgentListContainersResponse{

0 commit comments

Comments
 (0)