Skip to content

Runner returns success when check failed #54

@sebastiaanluca

Description

@sebastiaanluca

The point here is that using $result = $this->runner->run($configuration); the following should return false when a check failed: $result->wasSuccessful(). But in my test case, it returns true as in success. While it should return that the entire backup failed because the check failed, right?

Debugged it and boils down to this (I could be totally wrong though):

  1. Added a check to a backup
  2. Check fails and https://github.com/sebastianfeldmann/phpbu/blob/master/src/Result.php#L285 is called. This adds a failed check and also fails the backup.
  3. This only updates the backup, not the result which is used to determine a successful backup run! This is done here: https://github.com/sebastianfeldmann/phpbu/blob/master/src/Result.php#L133 where the value being used (backupsFailed) is only updated when a backup itself failed (https://github.com/sebastianfeldmann/phpbu/blob/master/src/Result.php#L237). The checksFailed value is not being used anywhere except in the verbose CLI logging, I think?

In short, shouldn't wasSuccessful in the result class also check for failed checks, syncs, … instead of just backups?

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions