Skip to content

Commit 672b6e5

Browse files
committed
fix tests compilation
1 parent 0d9d802 commit 672b6e5

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

tests/integration/internal/tests/api/sandboxes/sandbox_auto_pause_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/stretchr/testify/assert"
99
"github.com/stretchr/testify/require"
1010

11+
sharedUtils "github.com/e2b-dev/infra/packages/shared/pkg/utils"
1112
"github.com/e2b-dev/infra/tests/integration/internal/api"
1213
envdapi "github.com/e2b-dev/infra/tests/integration/internal/envd/api"
1314
"github.com/e2b-dev/infra/tests/integration/internal/setup"
@@ -87,7 +88,7 @@ func TestSandboxAutoPauseResumePersisted(t *testing.T) {
8788
t.Context(),
8889
&envdapi.GetFilesParams{
8990
Path: &path,
90-
Username: "user",
91+
Username: sharedUtils.ToPtr("user"),
9192
},
9293
setup.WithSandbox(sbxId),
9394
)
@@ -126,7 +127,7 @@ func TestSandboxAutoPauseResumePersisted(t *testing.T) {
126127
t.Context(),
127128
&envdapi.GetFilesParams{
128129
Path: &path,
129-
Username: "user",
130+
Username: sharedUtils.ToPtr("user"),
130131
},
131132
setup.WithSandbox(sbxId),
132133
)

tests/integration/internal/tests/envd/auth_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
"github.com/e2b-dev/infra/packages/shared/pkg/grpc/envd/filesystem"
1515
"github.com/e2b-dev/infra/packages/shared/pkg/grpc/envd/process"
16+
sharedUtils "github.com/e2b-dev/infra/packages/shared/pkg/utils"
1617
"github.com/e2b-dev/infra/tests/integration/internal/api"
1718
envdapi "github.com/e2b-dev/infra/tests/integration/internal/envd/api"
1819
"github.com/e2b-dev/infra/tests/integration/internal/setup"
@@ -156,7 +157,7 @@ func TestAccessAuthorizedPathWithResumedSandboxWithValidAccessToken(t *testing.T
156157
// try to get the file with the valid access token
157158
fileResponse, err := envdClient.HTTPClient.GetFilesWithResponse(
158159
ctx,
159-
&envdapi.GetFilesParams{Path: &filePath, Username: "user"},
160+
&envdapi.GetFilesParams{Path: &filePath, Username: sharedUtils.ToPtr("user")},
160161
setup.WithSandbox(sbx.JSON201.SandboxID),
161162
setup.WithEnvdAccessToken(*sbxMeta.EnvdAccessToken),
162163
)
@@ -212,7 +213,7 @@ func TestAccessAuthorizedPathWithResumedSandboxWithoutAccessToken(t *testing.T)
212213
// try to get the file with the without access token
213214
fileResponse, err := envdClient.HTTPClient.GetFilesWithResponse(
214215
ctx,
215-
&envdapi.GetFilesParams{Path: &filePath, Username: "user"},
216+
&envdapi.GetFilesParams{Path: &filePath, Username: sharedUtils.ToPtr("user")},
216217
setup.WithSandbox(sbx.JSON201.SandboxID),
217218
)
218219
if err != nil {

tests/integration/internal/tests/envd/hyperloop_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/stretchr/testify/assert"
1010
"github.com/stretchr/testify/require"
1111

12+
sharedUtils "github.com/e2b-dev/infra/packages/shared/pkg/utils"
1213
envdapi "github.com/e2b-dev/infra/tests/integration/internal/envd/api"
1314
"github.com/e2b-dev/infra/tests/integration/internal/setup"
1415
"github.com/e2b-dev/infra/tests/integration/internal/utils"
@@ -29,7 +30,7 @@ func TestAccessingHyperloopServerViaIP(t *testing.T) {
2930
readPath := "output.txt"
3031
readRes, readErr := envdClient.HTTPClient.GetFilesWithResponse(
3132
ctx,
32-
&envdapi.GetFilesParams{Path: &readPath, Username: "user"},
33+
&envdapi.GetFilesParams{Path: &readPath, Username: sharedUtils.ToPtr("user")},
3334
setup.WithSandbox(sbx.SandboxID),
3435
)
3536

@@ -53,7 +54,7 @@ func TestAccessingHyperloopServerViaDomain(t *testing.T) {
5354
readPath := "output.txt"
5455
readRes, readErr := envdClient.HTTPClient.GetFilesWithResponse(
5556
ctx,
56-
&envdapi.GetFilesParams{Path: &readPath, Username: "user"},
57+
&envdapi.GetFilesParams{Path: &readPath, Username: sharedUtils.ToPtr("user")},
5758
setup.WithSandbox(sbx.SandboxID),
5859
)
5960

tests/integration/internal/tests/envd/signatures_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/stretchr/testify/require"
1313

1414
"github.com/e2b-dev/infra/packages/shared/pkg/keys"
15+
sharedUtils "github.com/e2b-dev/infra/packages/shared/pkg/utils"
1516
envdapi "github.com/e2b-dev/infra/tests/integration/internal/envd/api"
1617
"github.com/e2b-dev/infra/tests/integration/internal/setup"
1718
"github.com/e2b-dev/infra/tests/integration/internal/utils"
@@ -32,7 +33,7 @@ func TestDownloadFileWhenAuthIsDisabled(t *testing.T) {
3233
ctx,
3334
&envdapi.PostFilesParams{
3435
Path: &filePath,
35-
Username: "user",
36+
Username: sharedUtils.ToPtr("user"),
3637
},
3738
contentType,
3839
textFile,
@@ -44,7 +45,7 @@ func TestDownloadFileWhenAuthIsDisabled(t *testing.T) {
4445

4546
getRes, err := envdClient.HTTPClient.GetFilesWithResponse(
4647
ctx,
47-
&envdapi.GetFilesParams{Path: &filePath, Username: "user"},
48+
&envdapi.GetFilesParams{Path: &filePath, Username: sharedUtils.ToPtr("user")},
4849
setup.WithSandbox(sbx.JSON201.SandboxID),
4950
)
5051

@@ -72,7 +73,7 @@ func TestDownloadFileWithoutSigningWhenAuthIsEnabled(t *testing.T) {
7273
ctx,
7374
&envdapi.PostFilesParams{
7475
Path: &filePath,
75-
Username: "user",
76+
Username: sharedUtils.ToPtr("user"),
7677
Signature: &writeFileSigning,
7778
},
7879
contentType,
@@ -86,7 +87,7 @@ func TestDownloadFileWithoutSigningWhenAuthIsEnabled(t *testing.T) {
8687

8788
readRes, readErr := envdClient.HTTPClient.GetFiles(
8889
ctx,
89-
&envdapi.GetFilesParams{Path: &filePath, Username: "user"},
90+
&envdapi.GetFilesParams{Path: &filePath, Username: sharedUtils.ToPtr("user")},
9091
setup.WithSandbox(sbx.JSON201.SandboxID),
9192
)
9293
require.NoError(t, readErr)
@@ -115,7 +116,7 @@ func TestDownloadFileWithSigningWhenAuthIsEnabled(t *testing.T) {
115116
ctx,
116117
&envdapi.PostFilesParams{
117118
Path: &filePath,
118-
Username: "user",
119+
Username: sharedUtils.ToPtr("user"),
119120
Signature: &writeFileSigning,
120121
},
121122
contentType,
@@ -128,7 +129,7 @@ func TestDownloadFileWithSigningWhenAuthIsEnabled(t *testing.T) {
128129

129130
readRes, readErr := envdClient.HTTPClient.GetFilesWithResponse(
130131
ctx,
131-
&envdapi.GetFilesParams{Path: &filePath, Username: "user", Signature: &readFileSigning},
132+
&envdapi.GetFilesParams{Path: &filePath, Username: sharedUtils.ToPtr("user"), Signature: &readFileSigning},
132133
setup.WithSandbox(sbx.JSON201.SandboxID),
133134
)
134135

@@ -158,7 +159,7 @@ func TestDownloadWithAlreadyExpiredToken(t *testing.T) {
158159
ctx,
159160
&envdapi.GetFilesParams{
160161
Path: &filePath,
161-
Username: "user",
162+
Username: sharedUtils.ToPtr("user"),
162163
Signature: &signatureForRead,
163164
SignatureExpiration: &readExpiration,
164165
},
@@ -191,7 +192,7 @@ func TestDownloadWithHealthyToken(t *testing.T) {
191192
ctx,
192193
&envdapi.GetFilesParams{
193194
Path: &filePath,
194-
Username: "user",
195+
Username: sharedUtils.ToPtr("user"),
195196
Signature: &signatureForRead,
196197
SignatureExpiration: &readExpiration,
197198
},
@@ -224,7 +225,7 @@ func TestAccessWithNotCorrespondingSignatureAndSignatureExpiration(t *testing.T)
224225
ctx,
225226
&envdapi.GetFilesParams{
226227
Path: &filePath,
227-
Username: "user",
228+
Username: sharedUtils.ToPtr("user"),
228229
Signature: &signatureForRead,
229230
SignatureExpiration: &readExpiration,
230231
},

tests/integration/internal/utils/filesystem.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"connectrpc.com/connect"
1212

1313
"github.com/e2b-dev/infra/packages/shared/pkg/grpc/envd/filesystem"
14+
"github.com/e2b-dev/infra/packages/shared/pkg/utils"
1415
"github.com/e2b-dev/infra/tests/integration/internal/api"
1516
envdapi "github.com/e2b-dev/infra/tests/integration/internal/envd/api"
1617
"github.com/e2b-dev/infra/tests/integration/internal/setup"
@@ -28,7 +29,7 @@ func UploadFile(tb testing.TB, ctx context.Context, sbx *api.Sandbox, envdClient
2829

2930
writeRes, err := envdClient.HTTPClient.PostFilesWithBodyWithResponse(
3031
ctx,
31-
&envdapi.PostFilesParams{Path: &path, Username: "user"},
32+
&envdapi.PostFilesParams{Path: &path, Username: utils.ToPtr("user")},
3233
contentType,
3334
buffer,
3435
reqEditors...,

0 commit comments

Comments
 (0)