-
Notifications
You must be signed in to change notification settings - Fork 63
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
Refactor test framework to load test resources dynamically #5876
Refactor test framework to load test resources dynamically #5876
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comprehensive implementation. In addition to fixing the Checkstyle or Codacy errors, I have some comments.
Kitodo/src/test/java/org/kitodo/production/exporter/download/ExportMetsIT.java
Outdated
Show resolved
Hide resolved
Kitodo/src/test/java/org/kitodo/production/metadata/MetadataEditorIT.java
Outdated
Show resolved
Hide resolved
Kitodo/src/test/java/org/kitodo/production/metadata/MetadataEditorIT.java
Outdated
Show resolved
Hide resolved
Kitodo/src/test/java/org/kitodo/production/metadata/MetadataEditorIT.java
Outdated
Show resolved
Hide resolved
Kitodo/src/test/java/org/kitodo/production/metadata/MetadataEditorIT.java
Outdated
Show resolved
Hide resolved
Kitodo/src/test/java/org/kitodo/production/metadata/MetadataEditorIT.java
Outdated
Show resolved
Hide resolved
Kitodo/src/test/java/org/kitodo/production/services/workflow/WorkflowControllerServiceIT.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some Codacy Issues to fix. After that, I am satisfied.
Kitodo/src/test/java/org/kitodo/production/exporter/download/ExportMetsIT.java
Show resolved
Hide resolved
Kitodo/src/test/java/org/kitodo/production/metadata/MetadataEditorIT.java
Outdated
Show resolved
Hide resolved
Kitodo/src/test/java/org/kitodo/production/metadata/MetadataEditorIT.java
Outdated
Show resolved
Hide resolved
* Create a base for the Kitodo script * Add a button in the Kitodo Script Dialog * Implement * Add tests * Fix and complete messages * Improve readability * Fix checkstyle * Fix checkstyle * Fix checkstyle * Print meaningful exception * Print meaningful exception manually * Fix a control flow error * Remove error wrapper * Test more generically, and give better error message on failure * Fixes a typo * Fix progress not working * Prevents tasks not being indexed * Support test file arrangement before and after PR #5876 * Fix Javadoc * Remove 'final' modifier from functions used in constructors Since private methods cannot be meaningfully overridden because of their visibility, declaring them final is redundant. * Use Files.walk() with try-with-resources * Invert if-condition * Use Files.walk() with try-with-resource * Invert if-condition * Fix Javadoc * Fix a typo * Spell out abbreviated negations in English * Remove duplicate class 'TreeDeleter' * Fix indent * Reformat try-with-resources statements, remove unnecessary ';' * Rewrite childDepth() to make use of OptionalInt * Fix checkstyle * Rearrange function calls and checks The order of execution of the underlying tasks depends on the order in which they are found on the disk and is unpredictable. Reliable testing is only possible after the end of this group of tasks. * Remove support for test files before PR #5876 * Use 'ProcessTestUtils' for clean-up * Remove database IDs from test
This pull request refactors the test framework of Kitodo.Production a little bit by loading test resources like images and metadata for individual tests dynamically. This means the content of static test process directories like
Kitodo/src/test/resources/metadata/2
,Kitodo/src/test/resources/metadata/4
etc. have been moved to a test resource source directory from which they are loaded at the beginning of the corresponding test.After test execution the test process including its process directory and contents is removed. This ensures processes do not depend on test order and won't accidentally manipulate or remove resources required by other tests. It also makes adding dummy processes to the test database for those static process directories mentioned above obsolte.