Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail after exceptions from ValidationTasks #53

Merged
merged 6 commits into from
Apr 14, 2022

Conversation

mikejritter
Copy link
Contributor

JIRA Ticket: https://fedora-repository.atlassian.net/browse/FCREPO-3811

What does this Pull Request do?

Stops execution of validation tasks when exceptions occur in the tasks which are unhandled.

What's new?

  • Add flag for signaling abort in the ValidationExecutionManager
  • Create ValidationTasks as CompletableFutures for better exception handling
  • Add test which throws a RuntimeException when writing ValidationResults
  • Typos/import updates

How should this be tested?

The best way to test this is to have the ValidationResultWriter fail, which can be done by specifying a --results-dir which cannot be written, e.g.:

java -jar target/fcrepo-migration-validator-1.2.0-SNAPSHOT-driver.jar -c /data/migration/f6-migration/data/ocfl-root -d /data/migration/f3dataset/2018/datastreams -o /data/migration/f3dataset/2018/objects -s legacy -r /reports -R csv

Additional Notes

I also opted to not attempt to write reports if any exceptions occurred from the ValidationExecutionManager. Since the only exception we re-throw is the RuntimeException in the FileSystemValidationResultWriter, I felt it was safe to do so as we wouldn't be able to write any of the reports.

Interested parties

Tag (@ mention) interested parties or, if unsure, @fcrepo/committers

Copy link
Contributor

@dbernstein dbernstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks @mikejritter

@dbernstein dbernstein merged commit 7e9cb8e into fcrepo-exts:main Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants