Skip to content

Commit

Permalink
context
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Dec 13, 2024
1 parent 23f125c commit 954d0a6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/test/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (e2e *ZarfE2ETest) GetMismatchedArch() string {
func (e2e *ZarfE2ETest) GetLogger(t *testing.T) *slog.Logger {
t.Helper()
cfg := logger.Config{
Level: logger.Debug,
Level: logger.Info,
Format: logger.FormatConsole,
Destination: logger.DestinationDefault, // Stderr
Color: false,
Expand Down
2 changes: 2 additions & 0 deletions src/test/e2e/14_oci_compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/zarf-dev/zarf/src/api/v1alpha1"
"github.com/zarf-dev/zarf/src/pkg/layout"
"github.com/zarf-dev/zarf/src/pkg/logger"
"github.com/zarf-dev/zarf/src/pkg/transform"
"github.com/zarf-dev/zarf/src/pkg/utils"
"github.com/zarf-dev/zarf/src/pkg/zoci"
Expand Down Expand Up @@ -187,6 +188,7 @@ func (suite *PublishCopySkeletonSuite) Test_3_Copy() {
dstRegistry := testutil.SetupInMemoryRegistry(testutil.TestContext(t), t, 31890)
dstRef := strings.Replace(ref, suite.Reference.Registry, dstRegistry, 1)
ctx := testutil.TestContext(t)
ctx = logger.WithContext(ctx, e2e.GetLogger(t))

src, err := zoci.NewRemote(ctx, ref, oci.PlatformForArch(e2e.Arch), oci.WithPlainHTTP(true))
suite.NoError(err)
Expand Down
3 changes: 1 addition & 2 deletions src/test/e2e/21_connect_creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ type RegistryResponse struct {

func TestConnectAndCreds(t *testing.T) {
t.Log("E2E: Connect")
ctx := context.Background()
ctx = logger.WithContext(ctx, e2e.GetLogger(t))
ctx := logger.WithContext(context.Background(), e2e.GetLogger(t))

prevAgentSecretData, _, err := e2e.Kubectl(t, "get", "secret", "agent-hook-tls", "-n", "zarf", "-o", "jsonpath={.data}")
require.NoError(t, err)
Expand Down
6 changes: 4 additions & 2 deletions src/test/e2e/22_git_and_gitops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/zarf-dev/zarf/src/internal/gitea"
"github.com/zarf-dev/zarf/src/pkg/cluster"
"github.com/zarf-dev/zarf/src/pkg/logger"
"github.com/zarf-dev/zarf/src/types"
)

Expand All @@ -35,7 +36,8 @@ func TestGit(t *testing.T) {

c, err := cluster.NewCluster()
require.NoError(t, err)
ctx := context.Background()
ctx := logger.WithContext(context.Background(), e2e.GetLogger(t))

tunnelGit, err := c.Connect(ctx, cluster.ZarfGit)
require.NoError(t, err)
defer tunnelGit.Close()
Expand Down Expand Up @@ -132,7 +134,7 @@ func testGitServerTagAndHash(ctx context.Context, t *testing.T, gitURL string) {
}

func waitFluxPodInfoDeployment(t *testing.T) {
ctx := context.Background()
ctx := logger.WithContext(context.Background(), e2e.GetLogger(t))
cluster, err := cluster.NewClusterWithWait(ctx)
require.NoError(t, err)
zarfState, err := cluster.LoadZarfState(ctx)
Expand Down
4 changes: 1 addition & 3 deletions src/test/e2e/23_data_injection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import (
func TestDataInjection(t *testing.T) {
t.Log("E2E: Data injection")

ctx := context.Background()
ctx = logger.WithContext(ctx, e2e.GetLogger(t))

ctx := logger.WithContext(context.Background(), e2e.GetLogger(t))
path := fmt.Sprintf("build/zarf-package-kiwix-%s-3.5.0.tar", e2e.Arch)

tmpdir := t.TempDir()
Expand Down

0 comments on commit 954d0a6

Please sign in to comment.