Skip to content

Commit

Permalink
Merge pull request kcp-dev#1093 from stevekuznetsov/skuznets/quiet-do…
Browse files Browse the repository at this point in the history
…wn-e2e

test/e2e: quiet down spammy log messages
  • Loading branch information
stevekuznetsov authored May 18, 2022
2 parents 5056e7b + 1c2dcde commit 3b62a46
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 3 additions & 4 deletions test/e2e/framework/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,13 @@ func (sf SyncerFixture) Start(t *testing.T) *StartedSyncerFixture {
gather := func(client dynamic.Interface, gvr schema.GroupVersionResource) {
resourceClient := client.Resource(gvr)

t.Logf("gathering %q", gvr)
list, err := resourceClient.List(ctx, metav1.ListOptions{})
if err != nil {
// Don't fail the test
t.Logf("Error gathering %s: %v", gvr, err)
return
}

t.Logf("got %d items", len(list.Items))

for i := range list.Items {
item := list.Items[i]
sf.UpstreamServer.Artifact(t, func() (runtime.Object, error) {
Expand Down Expand Up @@ -757,7 +754,9 @@ func Kubectl(t *testing.T, kubeconfigPath string, args ...string) []byte {
t.Logf("running: %s", strings.Join(cmdParts, " "))

output, err := cmd.CombinedOutput()
t.Logf("kubectl apply output:\n%s", output)
if err != nil {
t.Logf("kubectl output:\n%s", output)
}
require.NoError(t, err)

return output
Expand Down
1 change: 0 additions & 1 deletion test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ func artifact(t *testing.T, server RunningServer, producer func() (runtime.Objec
gvkForFilename := fmt.Sprintf("%s_%s", group, gvk.Kind)

file := path.Join(dir, fmt.Sprintf("%s-%s.yaml", gvkForFilename, accessor.GetName()))
t.Logf("saving artifact to %s", file)

serializer := json.NewSerializerWithOptions(json.DefaultMetaFactory, scheme.Scheme, scheme.Scheme, json.SerializerOptions{Yaml: true})
raw := bytes.Buffer{}
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/virtual/syncer/virtualworkspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
kubernetesclientset "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/klog/v2"
"sigs.k8s.io/yaml"

kubefixtures "github.com/kcp-dev/kcp/test/e2e/fixtures/kube"
Expand Down Expand Up @@ -258,8 +257,6 @@ func TestSyncerVirtualWorkspace(t *testing.T) {
luckyluke, err := wildwestWorkspaceClient.WildwestV1alpha1().Cowboys("default").Get(ctx, "luckyluke", metav1.GetOptions{})
require.NoError(t, err)

klog.Infof("luckyluke: %v", toYAML(t, luckyluke))

return luckyluke.GetLabels()[fmt.Sprintf("state.internal.workloads.kcp.dev/%s", wildwestWorkloadClusterName)] == "Sync"
}, wait.ForeverTestTimeout, time.Millisecond*100)

Expand Down

0 comments on commit 3b62a46

Please sign in to comment.