feat: support restic check operation (#303)

This commit is contained in:
Gareth
2024-05-27 10:26:18 -07:00
committed by GitHub
parent 5a51ae7c20
commit ce42f68d0d
43 changed files with 1807 additions and 989 deletions

View File

@@ -179,8 +179,6 @@ func TestBackup(t *testing.T) {
}
func TestMultipleBackup(t *testing.T) {
t.Parallel()
sut := createSystemUnderTest(t, &config.MemoryStore{
Config: &v1.Config{
Modno: 1234,
@@ -218,7 +216,7 @@ func TestMultipleBackup(t *testing.T) {
sut.orch.Run(ctx)
}()
for i := 0; i < 2; i++ {
for i := 0; i < 3; i++ {
_, err := sut.handler.Backup(context.Background(), connect.NewRequest(&types.StringValue{Value: "test"}))
if err != nil {
t.Fatalf("Backup() error = %v", err)
@@ -230,7 +228,7 @@ func TestMultipleBackup(t *testing.T) {
operations := getOperations(t, sut.oplog)
if index := slices.IndexFunc(operations, func(op *v1.Operation) bool {
forget, ok := op.GetOp().(*v1.Operation_OperationForget)
return op.Status == v1.OperationStatus_STATUS_SUCCESS && ok && len(forget.OperationForget.Forget) == 1
return op.Status == v1.OperationStatus_STATUS_SUCCESS && ok && len(forget.OperationForget.Forget) > 0
}); index != -1 {
return nil
}
@@ -605,7 +603,7 @@ func retry(t *testing.T, times int, backoff time.Duration, f func() error) error
}
func getOperations(t *testing.T, oplog *oplog.OpLog) []*v1.Operation {
t.Logf("Reading oplog")
t.Logf("Reading oplog at time %v", time.Now())
operations := []*v1.Operation{}
if err := oplog.ForAll(func(op *v1.Operation) error {
operations = append(operations, op)