diff --git a/internal/pkg/agent/cmd/enroll_cmd_test.go b/internal/pkg/agent/cmd/enroll_cmd_test.go index 361a9d8b9ae..2d28db5a4f8 100644 --- a/internal/pkg/agent/cmd/enroll_cmd_test.go +++ b/internal/pkg/agent/cmd/enroll_cmd_test.go @@ -232,8 +232,8 @@ func TestEnroll(t *testing.T) { } assert.True(t, store.Called) - config, err := readConfig(store.Content) + require.NoError(t, err, "readConfig returned an error") assert.Equal(t, "my-access-api-key", config.AccessAPIKey, "The stored 'Access API Key' must be the same returned by Fleet-Server") assert.Equal(t, host, config.Client.Host, diff --git a/testing/integration/container_cmd_test.go b/testing/integration/container_cmd_test.go index 40fa73437c6..36bd5d7bcb3 100644 --- a/testing/integration/container_cmd_test.go +++ b/testing/integration/container_cmd_test.go @@ -75,11 +75,11 @@ func TestContainerCMD(t *testing.T) { } cmd, err := agentFixture.PrepareAgentCommand(ctx, []string{"container"}) - cmd.Env = append(os.Environ(), []string{ + cmd.Env = append(os.Environ(), "FLEET_ENROLL=1", - "FLEET_URL=" + fleetURL, - "FLEET_ENROLLMENT_TOKEN=" + enrollmentToken.APIKey, - }...) + "FLEET_URL="+fleetURL, + "FLEET_ENROLLMENT_TOKEN="+enrollmentToken.APIKey, + ) t.Logf(">> running binary with: %v", cmd.Args) output, err := cmd.CombinedOutput()