@@ -12,6 +12,7 @@ import (
1212 "github.com/stretchr/testify/require"
1313 "k8s.io/klog/v2"
1414 "k8s.io/klog/v2/ktesting"
15+ _ "k8s.io/klog/v2/ktesting/init"
1516
1617 "github.com/jetstack/preflight/api"
1718 "github.com/jetstack/preflight/pkg/internal/cyberark/dataupload"
@@ -126,6 +127,11 @@ func TestCyberArkClient_PostDataReadingsWithOptions(t *testing.T) {
126127// An API token is obtained by authenticating with the ARK_USERNAME and ARK_SECRET from the environment.
127128// ARK_SUBDOMAIN should be your tenant subdomain.
128129// ARK_PLATFORM_DOMAIN should be either integration-cyberark.cloud or cyberark.cloud
130+ //
131+ // To enable verbose request logging:
132+ //
133+ // go test ./pkg/internal/cyberark/dataupload/... \
134+ // -v -count 1 -run TestPostDataReadingsWithOptionsWithRealAPI -args -testing.v 6
129135func TestPostDataReadingsWithOptionsWithRealAPI (t * testing.T ) {
130136 platformDomain := os .Getenv ("ARK_PLATFORM_DOMAIN" )
131137 subdomain := os .Getenv ("ARK_SUBDOMAIN" )
@@ -137,7 +143,7 @@ func TestPostDataReadingsWithOptionsWithRealAPI(t *testing.T) {
137143 return
138144 }
139145
140- logger := ktesting .NewLogger (t , ktesting .NewConfig () )
146+ logger := ktesting .NewLogger (t , ktesting .DefaultConfig )
141147 ctx := klog .NewContext (t .Context (), logger )
142148
143149 const (
@@ -165,7 +171,7 @@ func TestPostDataReadingsWithOptionsWithRealAPI(t *testing.T) {
165171 cyberArkClient , err := dataupload .NewCyberArkClient (nil , serviceURL , identityClient .AuthenticateRequest )
166172 require .NoError (t , err )
167173
168- err = cyberArkClient .PostDataReadingsWithOptions (t . Context () , api.DataReadingsPost {}, dataupload.Options {
174+ err = cyberArkClient .PostDataReadingsWithOptions (ctx , api.DataReadingsPost {}, dataupload.Options {
169175 ClusterName : "bb068932-c80d-460d-88df-34bc7f3f3297" ,
170176 })
171177 require .NoError (t , err )
0 commit comments