fix: complete target diagnostics and reset inspection
This commit is contained in:
@@ -44,6 +44,29 @@ func TestAvailabilityAndDescriptionDescribeOnlyDockerClientDefaults(t *testing.T
|
||||
}
|
||||
}
|
||||
|
||||
func TestDiagnosticChecksCoverSchemaAndAuthorityWithoutMutation(t *testing.T) {
|
||||
files := &countingFS{FileSystem: dockerclient.OSFileSystem{}}
|
||||
a := newAdapterWithFS(t, files)
|
||||
checks := a.DiagnosticChecks(context.Background(), activeProfile())
|
||||
for _, name := range []string{"required commands", "configuration schema", "write authority"} {
|
||||
found := false
|
||||
for _, check := range checks {
|
||||
found = found || check.Name == name
|
||||
}
|
||||
if !found {
|
||||
t.Errorf("diagnostics missing %q: %#v", name, checks)
|
||||
}
|
||||
}
|
||||
if files.writes != 0 {
|
||||
t.Fatalf("diagnostics wrote Docker client state %d times", files.writes)
|
||||
}
|
||||
for _, path := range []string{a.ConfigPath(), a.RecoveryPath(), a.LockPath()} {
|
||||
if _, err := os.Stat(path); !errors.Is(err, os.ErrNotExist) {
|
||||
t.Fatalf("diagnostics created %s: %v", path, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestDockerClientAdapterRunsReusableTargetContract(t *testing.T) {
|
||||
targettest.Run(t, func(t *testing.T) targettest.Fixture {
|
||||
a := newAdapter(t, nil)
|
||||
|
||||
Reference in New Issue
Block a user