Skip to content

Commit

Permalink
Improve repositores code
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Sverdlov <[email protected]>
  • Loading branch information
sverdlov93 committed Nov 6, 2024
1 parent 0f0856e commit f280aa5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions artifactory/commands/buildtoollogin/buildtoollogin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import (
"github.com/jfrog/jfrog-cli-core/v2/utils/ioutils"
"github.com/jfrog/jfrog-client-go/auth"
"github.com/jfrog/jfrog-client-go/utils/io"
clientTestUtils "github.com/jfrog/jfrog-client-go/utils/tests"
"github.com/stretchr/testify/assert"
"os"
"os/exec"
"path/filepath"
"testing"
)
Expand Down Expand Up @@ -278,8 +280,11 @@ func TestBuildToolLoginCommand_configurePoetry(t *testing.T) {
}

func TestBuildToolLoginCommand_Go(t *testing.T) {
// todo: Implement this test
t.Skip()
goProxyEnv := "GOPROXY"
// Restore the original value of the GOPROXY environment variable after the test.
restoreGoProxy := clientTestUtils.SetEnvWithCallbackAndAssert(t, goProxyEnv, "")
defer restoreGoProxy()

// Assuming createTestBuildToolLoginCommand initializes your Go login command
goLoginCmd := createTestBuildToolLoginCommand(project.Go)

Expand All @@ -295,7 +300,10 @@ func TestBuildToolLoginCommand_Go(t *testing.T) {
t.FailNow()
}

goProxy := os.Getenv("GOPROXY")
// Get the value of the GOPROXY environment variable.
outputBytes, err := exec.Command("go", "env", "GOPROXY").Output()
assert.NoError(t, err)
goProxy := string(outputBytes)

switch {
case testCase.accessToken != "":
Expand Down

0 comments on commit f280aa5

Please sign in to comment.