Skip to content

Commit

Permalink
fix xray tests
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Jan 17, 2024
1 parent 55cbe0b commit a120a5b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion tests/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var (
RtAuth auth.ServiceDetails
RtHttpDetails httputils.HttpClientDetails

XrayCli *coreTests.JfrogCli
PlatformCli *coreTests.JfrogCli

TestApplication *components.App
Expand Down
3 changes: 0 additions & 3 deletions tests/utils/test_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ func InitTestCliDetails() {
testApplication := cli.GetJfrogCliSecurityApp()

configTests.TestApplication = &testApplication
if configTests.XrayCli == nil {
configTests.XrayCli = coreTests.NewJfrogCli(func() error { return plugins.RunCliWithPlugin(*configTests.TestApplication)() }, "xr", creds)
}
if configTests.PlatformCli == nil {
configTests.PlatformCli = coreTests.NewJfrogCli(func() error { return plugins.RunCliWithPlugin(*configTests.TestApplication)() }, "", creds)
}
Expand Down
4 changes: 2 additions & 2 deletions xray_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ func TestXrayCurl(t *testing.T) {
securityTestUtils.CreateJfrogHomeConfig(t, true)
defer securityTestUtils.CleanTestsHomeEnv()
// Check curl command with the default configured server.
err := securityTests.XrayCli.WithoutCredentials().Exec("curl", "-XGET", "/api/v1/system/version")
err := securityTests.PlatformCli.WithoutCredentials().Exec("xr", "curl", "-XGET", "/api/v1/system/version")
assert.NoError(t, err)
// Check curl command with '--server-id' flag
err = securityTests.XrayCli.WithoutCredentials().Exec("curl", "-XGET", "/api/system/version", "--server-id=default")
err = securityTests.PlatformCli.WithoutCredentials().Exec("xr", "curl", "-XGET", "/api/system/version", "--server-id=default")
assert.NoError(t, err)
// Check curl command with invalid server id - should get an error.
err = securityTests.PlatformCli.WithoutCredentials().Exec("xr", "curl", "-XGET", "/api/system/version", "--server-id=not_configured_name")
Expand Down

0 comments on commit a120a5b

Please sign in to comment.