The Move to Islandora Kit is an extensible PHP command-line tool for converting source content and metadata into packages suitable for importing into Islandora (or other digital repository and preservations systems).
Fixes the following issues with the sample content generator script:
the mappings files should map "Date taken" to <dateIssued>, not <dateCreated>
the .ini Twig template should add shutdownhooks[] = 'php extras/scripts/shutdownhooks/create_structure_files.php' to .ini files generated for compound objects
This PR also removes some cruft from the CsvBooks writer, and adds a script, extras/scripts/mik_integration_tests.php, that clones and installs MIK and IIPQA, uses MIK to generate sample input for single file, compound, book, and newspaper content models, runs MIK on this sample input, and then runs IIPQA on MIK's output. This script is related to discussion in #385 about running test content through MIK separate from unit tests.
What's new?
See above. The bug fixes are trivial. The mik_integration_tests.php script is a standalone optional test script that is independent of PHPUnit.
How should this be tested?
This PR should be smoke tested (it's not covered by PHPUnit tests) but since it modifies a writer, the PHPUnit tests should be run anyway.
Check out the issue-426 branch.
WIthin the MIK directory, run phpunit --exclude-group inputvalidators --bootstrap vendor/autoload.php tests. You should get 52 tests, 72 assertions.
Within the extras/scripts directory, run the new mik_integration_tests.php script, specifying a location in your system's /tmp directory such as /tmp/issue426test: e.g., php mik_integration_tests.php /tmp/issue426test. The script will clone and install MIK and IIPQA, then generate data and perform QA checks on the data. Once the script stops running, you should see output like this:
MIK is generating output for content model 'single' into /tmp/mjtest/output/data/single_output
IIPQA checks for 'single' are OK.
MIK is generating output for content model 'compound' into /tmp/mjtest/output/data/compound_output
IIPQA apears to have found a problem with the 'compound' packages.
MIK is generating output for content model 'newspapers' into /tmp/mjtest/output/data/newspapers_output
IIPQA checks for 'newspapers' are OK.
MIK is generating output for content model 'books' into /tmp/mjtest/output/data/books_output
IIPQA checks for 'books' are OK.
Configuration files generated by this script are in the mik directory, and MIK's temporary files have not been deleted.
As you can see, IIPQA has detected a problem with the compound ingest packages generated by MIK. This is expected because the mik_integration_tests.php script is running in mik's master branch. If you want to see what the problem is, open /tmp/issue426test/output/logs/compound/iipqa.log (spoiler alert, it's the missing structure.xml files). In preparation for rerunning the mik_integration_tests.php script in the issue-426 branch:
enter /tmp/issue426test/mik (or the mik directory in your output directory)
run git checkout issue-426
return to the extras/scripts directory and rerun mik_integration_tests.php.
This time, IIPQA should report no problems with the compound ingest packages. mik_integration_tests.php will also skip cloning and installing MIK and IIPQA since they already exist.
Additional notes
We may want to consider, at a later time, adding an option to mik_integration_tests.php that will allow cloning of a specific MIK branch, e.g., `mik_integration_tests.php -b issue-426.
Github issue: (#426)
Related: #385, #424
What does this Pull Request do?
Fixes the following issues with the sample content generator script:
<dateIssued>
, not<dateCreated>
shutdownhooks[] = 'php extras/scripts/shutdownhooks/create_structure_files.php'
to .ini files generated for compound objectsThis PR also removes some cruft from the CsvBooks writer, and adds a script,
extras/scripts/mik_integration_tests.php
, that clones and installs MIK and IIPQA, uses MIK to generate sample input for single file, compound, book, and newspaper content models, runs MIK on this sample input, and then runs IIPQA on MIK's output. This script is related to discussion in #385 about running test content through MIK separate from unit tests.What's new?
See above. The bug fixes are trivial. The
mik_integration_tests.php
script is a standalone optional test script that is independent of PHPUnit.How should this be tested?
This PR should be smoke tested (it's not covered by PHPUnit tests) but since it modifies a writer, the PHPUnit tests should be run anyway.
phpunit --exclude-group inputvalidators --bootstrap vendor/autoload.php tests
. You should get 52 tests, 72 assertions.extras/scripts
directory, run the newmik_integration_tests.php
script, specifying a location in your system's/tmp
directory such as/tmp/issue426test
: e.g.,php mik_integration_tests.php /tmp/issue426test
. The script will clone and install MIK and IIPQA, then generate data and perform QA checks on the data. Once the script stops running, you should see output like this:As you can see, IIPQA has detected a problem with the compound ingest packages generated by MIK. This is expected because the
mik_integration_tests.php
script is running in mik's master branch. If you want to see what the problem is, open/tmp/issue426test/output/logs/compound/iipqa.log
(spoiler alert, it's the missing structure.xml files). In preparation for rerunning themik_integration_tests.php
script in the issue-426 branch:/tmp/issue426test/mik
(or themik
directory in your output directory)git checkout issue-426
extras/scripts
directory and rerunmik_integration_tests.php
.This time, IIPQA should report no problems with the compound ingest packages.
mik_integration_tests.php
will also skip cloning and installing MIK and IIPQA since they already exist.Additional notes
We may want to consider, at a later time, adding an option to
mik_integration_tests.php
that will allow cloning of a specific MIK branch, e.g.,`mik_integration_tests.php -b issue-426
.