Closed mjordan closed 7 years ago
@mjordan I really like this concept as it may help reduce the burden on contributors when creating pull-requests that require smoke-testing.
@mjordan I'm OK with merging this as it's an extra to help those contributing to MIK.
@MarcusBarnes excellent! Want me to flesh out the compound, book, and newspaper sample file functions before you merge?
I'm OK with merging this and then adding the compound, book, and newspaper sample file functions as they come together.
OK, sure!
Thanks, I'll document this script on the "Information for Developers" page.
@MarcusBarnes I just pushed a fix directly to master to fix a significant typo we missed in this PR. Hope that's OK. See 3e5466e8aa700cbee334a777a5349535c03af08f for diff.
Github issue: (#393)
What does this Pull Request do?
Adds a utility script that generates sample input for MIK. Useful for contributors who need to supply sample configuration and data as part of pull requests, etc., or possibly even end users who want a set of configuration and data files to base their production files on.
Note that currently only sample data consistent with single-file content models (specifically, .jpg files) is generated. Code to generate sample data for compound, book, and newspapers content models need to be completed. This PR is intended to get consensus around the approach
generate.php
takes. If the approach is satisfactory, we can complete the work necessary to generate output for the other content models.What's new?
This PR adds the following files:
In addition to the
generate.php
script, a sample mappings file and two templates (one for the .ini file and one for the metadata CSV file) allow users to customize the sample input to their needs.How should this be tested?
There are no PHPUnit tests for this new tool, so it requires a smoke test:
php extras/scripts/samplecontentgenerator/generate.php -id issue393 /tmp/miksampletest
/tmp/miksampletest
you should see the following:The .ini file should contain values that can be used with the sample files in the
/tmp/miksampletest
directory.Run
php extras/scripts/samplecontentgenerator/generate.php --help
to see additional command-line options (e.g., using a custom .ini or metadata template).Additional Notes
Note that the sample "JPG" files are really text files. MIK doesn't care whether the files are valid JPEG or other binary files. If we want to generate real JPGs, we can borrow the approach the Islandora Sample Content Generator takes to generate valid JPG and other image files.
Interested parties
@MarcusBarnes, @jpeak5, @bondjimbond and any other current contributors