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

FCREPO-3812: Add failure only reporting option #52

Merged
merged 5 commits into from
Apr 6, 2022

Conversation

mikejritter
Copy link
Contributor

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

What does this Pull Request do?

  • Add flag for reporting only failed validations
  • Update logic to account for failed only flag

What's new?

Updates the FileSystemValidationResultWriter to be able to write out only failed validations.

How should this be tested?

  • Migrate some data
  • Run the validator with the --failure-only flag, 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/datastreams -o /data/migration/f3dataset/objects -s legacy -r /data/migration/report --failure-only
    
  • Check the resulting files only contain validations which failed, some something like grep -R OK json/ should return no matches.

Additional Notes:

  • This is a little awkward when there are no errors as you're left with either and empty csv file or a mostly blank HTML report. I could disable that portion of the report gen as well if there are no errors, or generate something for this condition.
  • Likewise, there weren't any tests covering report generation, so I haven't added any. This could be done before merging if desired.

Interested parties

@fcrepo/committers

@dbernstein
Copy link
Contributor

Excellent @mikejritter. Yes, please ensure there is some feedback to the user when in errors only mode and there are not errors. Also yes please add some tests to cover report generation. Maybe at a minimum some smoke tests confirming the cases of

  1. all okay for html and csv
    2)errors only flag = true for csv and html for validation with no errors.

@mikejritter
Copy link
Contributor Author

@dbernstein I made a few small changes to the template to make it more clear that these are object reports. I think that's sufficient (at least for now) for running in --failure-only mode.

I also added an integration test which runs the report generator for both HTML and CSV reports. It's only checking that the expected object reports exist, we could go further and check validations but I left that out for now.

@dbernstein dbernstein merged commit 7dca472 into fcrepo-exts:main Apr 6, 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