The purpose of this repo is to provide end-to-end testing of bookmaker content transforms for any test manuscript provided. It bypasses the flask_api now used to invoke bookmaker, but still uses a bookmaker_deploy toolchain (bookmaker_test_direct.bat) to manually invoke what is essentially a 'bookmaker_firstpass' run: plus one extra script (bookmaker_tests.rb) to diff working html, xml, css & logfiles.
To invoke the test, in cmd or Terminal window type: python run_bkmkr_tests.py
.
That launches the tests via bookmaker_test_direct.bat for any manuscript (.docx) files in the 'test_manuscripts' folder. Tests run in parallel for each manuscript. It should all be done in < 30 min.
Goto output folder to review test output for each/any testfile: "S:\bookmaker_tmp\bookmaker_tests\test_tmpdir" Each test manuscript will have its own folder. Inside each folder will be output from diffs, in a file: testoutput.txt. Review and make sure diffs reflect expected changes.
Some layout changes will not be apparent in file diffs (particularly css/js changes). It's recommended that you visually inspect the new epub and the new pdf for any significant problems as well as expected changes. You can also run Acrobat's 'Compare Documents' to compare the new pdf to the verified one in greater detail.
To update verified files to reflect your successful code updates (congrats!):
- run in cmd or Terminal window:
python update_valid_files.py
- for test-file dir folder in "S:\bookmaker_tmp\bookmaker_tests\verified_files", copy contents to their respective folders in 'bookmaker_tests\verified_files'
Then add, commit, and merge updated files.
- Put your new .docx test file in 'test_manuscripts' folder.
- If there are any accompanying images or other input files (oneoff.css, config.json, override.js) for your test manuscript: create a folder in 'test_manuscript' named after the docx filename sans extension, followed by: '_images'.
- Example: for file: test_ms.docx, create folder test_ms_images
- Put all of the aforementioned accompanying files for your new test manuscript into the folder created in step 2.
- Run the run_bkmkr_tests.py. Wait 5-10 minutes.
- Go to "S:\bookmaker_tmp\bookmaker_tests\verified_files" and look for the folder matching your new testfile's name (sans .docx extension): it should be there, with 10 files inside.
- Copy that whole folder to 'bookmaker_tests\verified_files' folder
- Run run_bkmkr_tests.py again, and check file: "S:\bookmaker_tmp\bookmaker_tests\test_tmpdir\YOUR_TESTFILE_NAME\testoutput.txt" The file should show very few (if any) diffs.
- Add, commit and push your files to the repo.
- add at least one RSuite styled manuscript as a test manuscript
- create .bat/.sh for updating verified files automatically
- create run_bookmaker-test-direct.sh for running tests in non-Windows env.