Were any Django, import pipeline, or table_schema files modified? Y
If YES:
Database used: opus3_test_221004
All Django tests pass:
FLAKE8 run on modified code:
Were any JavaScript or CSS files modified? N
If YES:
JSHINT run on all affected files: Y/NA
Tested on Chrome, Firefox, Safari, Edge, and iOS: Y/NA
(Remember to test all browser sizes)
Tested for race conditions (with delayed API calls if applicable): Y/NA
Was the documentation reviewed for necessary changes or additions? Y
About
Getting Started
FAQ
API Guide
Tooltips
Description of changes:
Increase Django test coverage to 100% of lines and branch directions. This required increasing the number of tests from 1480 to 1560. The previous tests ran in 130 seconds on my workstation. The new tests run in 159 seconds. Branches that can't be reached are marked with # pragma: no cover along with a reason justifying the lack of testing.
To compensate for this increase in testing time, implemented profiling of tests and then optimized the top few routines that were taking the most time. Tests now run in 127 seconds (and OPUS should run faster in general, too).
Removed parts of tests (e.g. calling status extra times in the cart tests) that weren't doing anything useful
Cache the results of get_param_info_by_slug to dramatically reduce the number of database accesses (this alone accounted for about 20% of all OPUS runtime)
Don't blindly clear the cache tables before every search test, because this is a slow operation.
Code coverage is run by using the script opus/application/run_coverage.sh. It runs all of the tests, including those in opus_support.py, and produces an HTML report. The HTML can be viewed by pointing your browser to htmlcov/index.html.
Changed the pull template to include running coverage tests and still having 100% test coverage.
Fixes #646 by implementing tests for /__cart/view.html, /__cart/download.json, /api/download/.zip
Fixes #648 by implementing tests for __api/dataimages.json, api/images/(?Pthumb|small|med|full).(?Pjson|zip|html|csv), api/images.(?Pjson|zip|html|csv), api/image/(?Pthumb|small|med|full)/(?P<opus_id>[-\w]+).(?Pjson|zip|html|csv)
Fixes #649 by implementing tests for /__menu.html, /__forms/widget/(?P[-\w]+).html, /__forms/metadata_selector.html, /__initdetail/(?P<opus_id>[-\w]+).html
Fixes #523 by ensuring 100% test coverage on caching code
Partially implements #1251 by increasing the number of tests that read their results from files; there are still a lot more to go
Cleaned up all "no requests", "no GET", and "no META" tests. The latter two are implemented for API calls marked @nevercache, and all three are implemented for the others.
Fixed a variety of bugs found during testing.
Links for describing preview images were missing after the multi-valued mult change.
Removed a variety of useless if clauses. Removed unused files, including test_return_formats.py which is now sufficiently covered by other tests.
Commented out parts of the dictionary app that are not currently used or functional, but left them around for future development.
Since Python 3 dictionaries are guaranteed to be kept in key-insertion order, removed all uses of OrderedDict, except for some in the test suite which were too much of a pain to remove and don't hurt anything.
Cleaned up search/forms.py, which was a real mess. It's still a bit of a mess, but better.
Added a new command profile to manage.py. When given, the file profile.txt is written after manage.py exits normally. Note that when running this with tests, this only happens if all of the tests pass.
Known problems:
None. But be sure memcached is running for the code coverage on the cache tests to work properly.
Description of changes:
# pragma: no cover
along with a reason justifying the lack of testing.status
extra times in the cart tests) that weren't doing anything usefulget_param_info_by_slug
to dramatically reduce the number of database accesses (this alone accounted for about 20% of all OPUS runtime)opus/application/run_coverage.sh
. It runs all of the tests, including those inopus_support.py
, and produces an HTML report. The HTML can be viewed by pointing your browser tohtmlcov/index.html
./__cart/view.html
,/__cart/download.json
,/api/download/.zip
__api/dataimages.json
,api/images/(?Pthumb|small|med|full).(?Pjson|zip|html|csv)
,api/images.(?Pjson|zip|html|csv)
,api/image/(?Pthumb|small|med|full)/(?P<opus_id>[-\w]+).(?Pjson|zip|html|csv)
/__menu.html
,/__forms/widget/(?P[-\w]+).html
,/__forms/metadata_selector.html
,/__initdetail/(?P<opus_id>[-\w]+).html
@nevercache
, and all three are implemented for the others.if
clauses. Removed unused files, includingtest_return_formats.py
which is now sufficiently covered by other tests.dictionary
app that are not currently used or functional, but left them around for future development.search/forms.py
, which was a real mess. It's still a bit of a mess, but better.profile
tomanage.py
. When given, the fileprofile.txt
is written aftermanage.py
exits normally. Note that when running this with tests, this only happens if all of the tests pass.Known problems:
None. But be sure
memcached
is running for the code coverage on the cache tests to work properly.