mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-15 02:05:45 -04:00
Wrote and applied helper function for tests
replaced with new function removed log/slog readded log/slog when needed fixed last testwriter problems
This commit is contained in:
parent
944bdedc59
commit
76ada50c17
55 changed files with 133 additions and 178 deletions
|
@ -9,7 +9,6 @@ package cmd
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"log/slog"
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
||||
|
@ -228,7 +227,7 @@ func TestCreate(t *testing.T) {
|
|||
skipPhases: newPhases(skipInitPhase, skipAttestationConfigPhase, skipCertSANsPhase, skipHelmPhase, skipImagePhase, skipK8sPhase),
|
||||
},
|
||||
|
||||
log: slog.New(slog.NewTextHandler(logger.TestWriter{T: t}, nil)),
|
||||
log: logger.NewTest(t),
|
||||
spinner: &nopSpinner{},
|
||||
|
||||
newInfraApplier: func(_ context.Context) (cloudApplier, func(), error) {
|
||||
|
@ -296,7 +295,7 @@ func TestCheckDirClean(t *testing.T) {
|
|||
for _, f := range tc.existingFiles {
|
||||
require.NoError(fh.Write(f, []byte{1, 2, 3}, file.OptNone))
|
||||
}
|
||||
a := &applyCmd{log: slog.New(slog.NewTextHandler(logger.TestWriter{T: t}, nil)), fileHandler: fh}
|
||||
a := &applyCmd{log: logger.NewTest(t), fileHandler: fh}
|
||||
err := a.checkInitFilesClean()
|
||||
|
||||
if tc.wantErr {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue