Commit graph

168 commits

Author SHA1 Message Date
Jennifer Richards c390fe012e Use live_server_url as IDTRACKER_BASE_URL in IetfLiveServerTestCase. Fixes #3203. Commit ready for merge.
- Legacy-Id: 19353
2021-09-07 18:18:13 +00:00
Robert Sparks 3697180cc1 Reverted merge of timezone-aware migration efforts.
- Legacy-Id: 18792
2021-01-12 16:54:20 +00:00
Henrik Levkowetz 59b49c846b Fixed a number of TimeSlot-related issues, in particular related to getting the correct date from a timeslot. Also fixed the displayed slot times in the new schedule editors to show local times, not UTC times.
- Legacy-Id: 18785
2020-12-19 22:55:11 +00:00
Henrik Levkowetz 774e752a54 Snapshot of timezone-aware datatracker code. Tests pass, and the test-crawler shows only expected differences. Trunk changes merged in up to r18768.
- Legacy-Id: 18770
2020-12-16 23:53:37 +00:00
Henrik Levkowetz 020d560190 Grammar fix.
- Legacy-Id: 18562
2020-10-05 13:20:18 +00:00
Jennifer Richards ea3882034a Use querystring instead of URL hash for agenda filters
- Legacy-Id: 18353
2020-08-11 13:45:41 +00:00
Henrik Levkowetz bf230a738b Added a test suite switch to optionally show logging output. Normally this is suppressed while running tests. In production, it goes to syslog's user facility. With --show-logging, it will go to the console when running tests.
- Legacy-Id: 18010
2020-06-17 15:05:57 +00:00
Henrik Levkowetz 6d7c5b52ee Django 2.0 conversion. Test suite passes, except for javascript tests.
- Legacy-Id: 17762
2020-05-08 13:07:07 +00:00
Henrik Levkowetz 42995fadea Merged in ^/branch/iola/meeting-improvement-r17214@17617, which provides a new meeting schedule editor.
- Legacy-Id: 17701
2020-04-28 14:34:34 +00:00
Henrik Levkowetz 3054b8cf58 Removed usage of maybe_create_svn_symlinks()
- Legacy-Id: 17668
2020-04-20 18:03:25 +00:00
Ole Laursen e5943f814d Add support for displaying constraint hints when scheduling a task and
for displaying violated constraints in the new schedule editor, with
the old of a new field, ConstraintName.editor_label.

Add support for displaying room capacity violations.

Add support for selecting a session and displaying information about
it similar to the existing scheduling editor.

Add support for sorting unassigned sessions.

Clean up markup and styles a bit, and fix some bugs.

Expand HTML-based test and add JS test that exercises the
Javascript-based functionality.

Switch to using Chrome driver instead of PhantomJS since the HTML
engine in PhantomJS is apparently too old to support the constructs in
the new schema editor.

Add a workaround for LiveServerTestCase clashing with IetfTestRunner
fixture loading.
 - Legacy-Id: 17519
2020-03-23 17:55:36 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz 8f0eca5032 Added a newline to test run output, to separate dot progress indication from teardown message.
- Legacy-Id: 17253
2020-01-22 23:17:44 +00:00
Henrik Levkowetz 288f4135e3 Added (currently inactive) code to trigger exceptions on failure to resolve template variables during tests, and added fixes for a couple of places that triggered such exceptions.
- Legacy-Id: 17226
2020-01-13 17:16:43 +00:00
Henrik Levkowetz 447525de73 Tweaked the output of mypy_test().
- Legacy-Id: 16865
2019-10-15 16:48:23 +00:00
Henrik Levkowetz 2d858f2e0a Added mypy and django-stubs to Py3 requirements, and added a mypy test case.
- Legacy-Id: 16768
2019-09-30 15:37:32 +00:00
Ryan Cross d332bfd91d Added encoding='utf-8' parameter to io.open operations in tests that starting failing since adding unicode_literals. Commit ready to merge
- Legacy-Id: 16562
2019-07-20 22:54:14 +00:00
Henrik Levkowetz fb3d4ddb0b Added information about versions (Datatracker, Python, and Django) at the beginning of test suite runs.
- Legacy-Id: 16516
2019-07-17 20:54:51 +00:00
Henrik Levkowetz 627f8a7eab Modified code to write release coverage json data to gzip file under both Py2 and Py3.
- Legacy-Id: 16475
2019-07-16 21:58:38 +00:00
Henrik Levkowetz 8c6eb3a30a Python2/3 compatibility: Changed the use of open() and StringIO to io.open() etc.
- Legacy-Id: 16458
2019-07-15 19:14:04 +00:00
Henrik Levkowetz 6732e7acff Fixed an issue with a gzip file mode.
- Legacy-Id: 16436
2019-07-08 18:30:34 +00:00
Henrik Levkowetz 0679eaa8d4 Removed unused imports.
- Legacy-Id: 16402
2019-07-04 21:06:57 +00:00
Henrik Levkowetz f480799af9 Undid unintentional bulk commit
- Legacy-Id: 16401
2019-07-04 21:04:46 +00:00
Henrik Levkowetz fc09a59950 Added decode() of command pipe output.
- Legacy-Id: 16400
2019-07-04 21:01:39 +00:00
Henrik Levkowetz d7f5c84182 Initial 2to3 patch with added copyright statement updates.
- Legacy-Id: 16309
2019-06-27 14:40:54 +00:00
Henrik Levkowetz ba528a0c5e Adjusted the test_runner to generate migration coverage data also when permitting mixed migrations.
- Legacy-Id: 16280
2019-06-17 18:24:17 +00:00
Henrik Levkowetz 815602351f This is a series of 50 migrations that changes the Document and DocAlias
primary keys from character strings to integers, and makes corresponding code
changes.

This was prompted by database limitations discovered when trying to make
DocAlias use a m2m document field; with 255 long strings as primary keys for
Document and DocAlias this violated the MySQL database limitations.

Changing the primary keys to integers should also improve efficiency.  

Due to the data migrations which create the new integer primary keys and adds
corresponding integer foreign keys matching the previous string foreign keys
in all tables having foreign keys to Document and DocAlias, some of these
migrations take a long time.  The total set of migrations are expected to have
a runtime on the order of 2 hours.
 - Legacy-Id: 16237
2019-06-10 11:32:46 +00:00
Henrik Levkowetz fd62a25f4e Added a missing variable initialization.
- Legacy-Id: 15925
2019-02-04 11:26:29 +00:00
Henrik Levkowetz 57a4c9f41f Added 9 new group features, and changed list-like char fields to json fields, to get better support for using the values as lists. Modified code to use the group features instead of explicit lists of group types in many places in the code.
- Legacy-Id: 15908
2019-01-22 18:11:46 +00:00
Henrik Levkowetz 0cc7f73d58 Additional tweaks to submission yang testing and the test runner
- Legacy-Id: 15870
2019-01-07 13:38:44 +00:00
Henrik Levkowetz a96c6c4c5b Tweaked the test runner to more consistently force the test coverage tests to be run last.
- Legacy-Id: 15030
2018-04-08 12:42:03 +00:00
Henrik Levkowetz d6e4404d63 Only do coverage set/reset operations if we're in test mode. Fixes a 500 error during draft submission yang checking.
- Legacy-Id: 14569
2018-01-25 11:31:38 +00:00
Henrik Levkowetz 9be7d57a03 Tweaked the test-runner random state handling to display the correct random state filename and make sure to set the same random state.
- Legacy-Id: 14209
2017-10-14 12:05:01 +00:00
Henrik Levkowetz 2c1438c240 Moved unidecode_name from utils.text to person.name.
Modified UserFactory to use a new locale for each new user, instead of the
same locale for a whole test run.  This (almost) ensures the exercise of
code to deal with non-ascii names, something which would not happen if a
locale with ascii names was chosen at the start of a run.

Modified name.initials() to not use non-word characters as initials.

Modified unidecode_name() to do more normalization, to conform to the
conventions used in internet-drafts.

Added saving of the factory-boy random state in order to be able to re-run
a test suite with the same pseudo-random sequence as in a previous failed
run.

Fixed an issue with email formatting in test_api_submit_ok().

Modified the draft author extraction code to deal better with names with
embedded apostrophes.
 - Legacy-Id: 14141
2017-09-20 15:36:30 +00:00
Henrik Levkowetz 1eeaf49c5c Added an error exit when the test runner is invoked with incompatible switches (--parallel and --html-report)
- Legacy-Id: 14024
2017-08-02 13:00:16 +00:00
Henrik Levkowetz d00921b94b Added a new release-coverage format which whould make it easier to show line-by-line code test coverage changes in the future.
- Legacy-Id: 13967
2017-07-24 17:38:00 +00:00
Henrik Levkowetz eceed7476d Added the html_report switch setting to the test runner object.
- Legacy-Id: 13822
2017-07-09 18:10:51 +00:00
Henrik Levkowetz ca921fe45d Added a switch to control generation of the code coverage html report, which now defaults to false. The report can be generated post-testing with "coverage html -d static/coverage/".
- Legacy-Id: 13821
2017-07-09 16:50:38 +00:00
Henrik Levkowetz d26c7085c6 Added code coverage settings and configuration to ignore debug-related lines of code.
- Legacy-Id: 13817
2017-07-09 15:00:22 +00:00
Henrik Levkowetz f6f0278859 Changed the url coverage code to handle deeper chains of url includes, and to handle url includes through url lists in addition to url modules. Added information in the release coverage dictionaries about the view functions coupled to the urls.
- Legacy-Id: 13706
2017-06-22 15:07:06 +00:00
Henrik Levkowetz 4dcdda08d2 Added a test to the test suite which checks if there are interleaved schema and data migrations that have not been released yet. Having split migrations, first all schema and then all data, will permit doing 2 sequential releases; but if the data and schema migrations are interleaved (beyond this) it is problematic to arrange for release without ending up with a prolonged period when running code and table structure is out of sync (while the normally more time-consuming data migrations run).
- Legacy-Id: 13576
2017-06-09 21:37:14 +00:00
Henrik Levkowetz 76628be3fd Merged in ^/branch/iola/author-stats-r13145 from olau@iola.dk, and fixed some tests in code which moved after the latest merge with trunk. The test suite passes, but the migrations are _not_ ready to run, because of numbering conflicts (again due to code changes on trunk since the latest sync).
- Legacy-Id: 13479
2017-05-31 20:59:26 +00:00
Henrik Levkowetz d6b9392f72 Fixed an if-statement which incorrectly disabled coverage testing when the parallel testing count was set to 1.
- Legacy-Id: 13231
2017-04-18 16:47:28 +00:00
Ole Laursen a1ba9dfb0a Remove accidentally committed debug
- Legacy-Id: 13160
2017-03-28 14:56:06 +00:00
Ole Laursen 5b677dc6ba Merge author stats branch into new branch from trunk
- Legacy-Id: 13159
2017-03-28 14:36:40 +00:00
Henrik Levkowetz 14c748df98 Changed the creation of temporary test dirs to use names which include the test class name, in order to make it possible to run test cases in parallel. Disabled coverage testing when running in parallel (those classes cannot be pickled and distributed to the test runner threads, and also won't pass coverage data back). Tweaked the TestCase.tempdir() method.
- Legacy-Id: 13157
2017-03-27 21:41:18 +00:00
Ole Laursen 5608ad0061 Move the assert on new X in the test coverage up before the percentage
to try get the list of URLs out before the percentage
 - Legacy-Id: 13144
2017-03-27 08:45:20 +00:00
Lars Eggert 8a70e9773d Fix various "RemovedInDjango20Warning" warnings. Commit ready for merge.
- Legacy-Id: 13112
2017-03-25 19:16:45 +00:00
Henrik Levkowetz 5928bd9faa Added svn symlink check and creation to test setup. Forced test settings to use an empty INTERNAL_IPS list for consistency in code coverage figures.
- Legacy-Id: 12929
2017-02-28 18:02:30 +00:00
Henrik Levkowetz 8930d29a8e Merged in Django-1.10 upgrade work from ^/personal/henrik/6.43.1-django-1.10
- Legacy-Id: 12881
2017-02-19 18:18:00 +00:00
Henrik Levkowetz 7f607c51d2 Changed from old-style to new-style middleware.
- Legacy-Id: 12824
2017-02-12 17:07:48 +00:00
Henrik Levkowetz aa5e61d958 Updated all urlpatterns to use ietf.utils.urls.url() instead of django's,
in order to autogenerate dotted path url pattern names.  Updated a number
of url reverses to use dotted path, and removed explicit url pattern names
as needed.

Changed some imports to prevent import of ietf.urls before django
initialization was complete.


Changed 3 cases of form classes being curried to functions; django 1.10
didn't accept that.

Started converting old-style middleware classes to new-style middleware
functions (incomplete).

Tweaked a nomcom decorator to preserve function names and attributes, like
a good decorator should.

Replaced the removed django templatetag 'removetags' with our own version
which uses bleach, and does sanitizing in addition to removing explicitly
mentionied html tags.

Rewrote the filename argument handling in a management command which had
broken with the upgrade.
 - Legacy-Id: 12818
2017-02-11 14:43:01 +00:00
Henrik Levkowetz 40e8380751 Merged django 1.9 work forward to copy of trunk @6.41.0
- Legacy-Id: 12756
2017-01-30 23:13:02 +00:00
Henrik Levkowetz 79c44d25ea Changed settings_sqlitetest so that local developer additions to context processors and middleware classes are avoided.
- Legacy-Id: 12723
2017-01-24 20:42:51 +00:00
Henrik Levkowetz 450c39af23 Changed the failure leeway of the code coverage test percentage from 0.005% back to 0.02%.
- Legacy-Id: 12707
2017-01-19 20:01:19 +00:00
Henrik Levkowetz 3944ab95cc Django 1.9: Supplied a required argument to TemplateDoesNotExist()
- Legacy-Id: 12616
2016-12-22 17:14:51 +00:00
Henrik Levkowetz 65481b5df7 Moved warnings settings from manage.py and test_runner.py to one single place, settings.py. Decreased the verbosity level when invoking 'loaddata' from the test runner.
- Legacy-Id: 12535
2016-12-15 13:25:20 +00:00
Henrik Levkowetz 8e56935cfd Undid commit 12527, which contained much too much.
- Legacy-Id: 12528
2016-12-15 10:38:54 +00:00
Henrik Levkowetz e3c6e0ac6b Changed the state shown in all_id.txt for drafts which have entered IESG processing, but then been replaced, to show as 'Replaced' instead of 'In IESG Processing'. This is consistent with how they are shown in all_id2.txt.
- Legacy-Id: 12527
2016-12-15 10:36:15 +00:00
Henrik Levkowetz 6304bfda69 Fixed template_coverage_collection initialisation. Tweaked a message. Updated coverage numbers.
- Legacy-Id: 12471
2016-12-07 11:33:33 +00:00
Henrik Levkowetz 8f6e51839f Fixed some additional places to use the new settings.TEMPLATES structure.
- Legacy-Id: 12459
2016-12-05 19:04:27 +00:00
Henrik Levkowetz 0bb7854591 Merged django18 work forward to 6.39
- Legacy-Id: 12449
2016-12-05 14:01:25 +00:00
Henrik Levkowetz b897519fff Changed the test runner to use the verbosity set on the command line when loading fixtures.
- Legacy-Id: 12446
2016-12-05 12:56:53 +00:00
Henrik Levkowetz 554ec2d78c Removed an unused import
- Legacy-Id: 12406
2016-11-28 21:04:15 +00:00
Henrik Levkowetz 623ce0e1bd Merged in [12378] from rjsparks@nostrum.com:
Change the lines saying that a test has failed to make it easier to cut-paste to run the failed test again.
 - Legacy-Id: 12386
Note: SVN reference [12378] has been migrated to Git commit be51bc2e78
2016-11-18 10:45:40 +00:00
Robert Sparks be51bc2e78 Change the lines saying that a test has failed to make it easier to cut-paste to run the failed test again. Commit ready for merge.
- Legacy-Id: 12378
2016-11-17 02:52:45 +00:00
Henrik Levkowetz 964d34282f Added common patterns for template file names to ignore when testing template parsing and template test coverage.
- Legacy-Id: 12354
2016-11-16 02:14:32 +00:00
Henrik Levkowetz 888bd44a10 Stash the test results summary in ./.testresults instead of ./testresults, to avoid visual littering.
- Legacy-Id: 12272
2016-11-07 17:11:48 +00:00
Henrik Levkowetz 8d1aca19cc Rewrote the template coverage loader function to a proper template loader class.
- Legacy-Id: 12261
2016-11-03 20:51:06 +00:00
Henrik Levkowetz 7b6407dfed Rewrote the test runner command-line switch declarations to use parser.add_argument() instead of the now unsupported option_list class attribute.
- Legacy-Id: 12251
2016-11-03 20:07:22 +00:00
Henrik Levkowetz 3854c832a0 Change things so that the reorder_by setting has an effect on the test ordering. It didn't before, as CoverageTest was a subclass of the earlier entries in the reorder_by setting.
- Legacy-Id: 12039
2016-09-26 17:48:26 +00:00
Henrik Levkowetz e3020686a8 Added a global declaration
- Legacy-Id: 11647
2016-07-13 16:00:41 +00:00
Henrik Levkowetz a405449150 Cached the list of template paths in test_runner.py so we can call it multiple times cheaply.
- Legacy-Id: 11482
2016-06-28 04:44:25 +00:00
Henrik Levkowetz a36cf95572 Refactored the code to skip coverage testing a bit, and added skipping of template and url coverage.
- Legacy-Id: 11472
2016-06-24 15:39:59 +00:00
Henrik Levkowetz 6fa181763b Changed the code test coverage checking to never register coverage counts for tests that are sometimes skipped. Removed now unwanted skip settings from the releasetest settings.
- Legacy-Id: 11453
2016-06-21 20:39:28 +00:00
Henrik Levkowetz 2191ec3cbd Removed logging through ietf.utils.log.log when running tests -- should shave another 15% off the test suite run time.
- Legacy-Id: 10454
2015-11-08 14:26:41 +00:00
Henrik Levkowetz fdc7dea3df Merged in [10097] from olau@iola.dk, in order to speed up the test suite.
- Legacy-Id: 10453
Note: SVN reference [10097] has been migrated to Git commit 99a9cb5569
2015-11-08 14:24:19 +00:00
Henrik Levkowetz bfa222b782 Added a switch to the 'test' command, to write short test results to file, changing the default which used to be to always write these.
- Legacy-Id: 10270
2015-10-22 20:37:03 +00:00
Henrik Levkowetz c17ea94b08 Updated the code to use version 4.0.1 of coverage.py for code coverage measurements. Moved the code which starts coverage measurement to settings_sqlitetest.py to avoid coverage measurements running when not doing tests. Did some additional coveage measurement refactoring.
- Legacy-Id: 10238
2015-10-18 20:01:57 +00:00
Henrik Levkowetz 90b97468a9 Changed to use a gzipped release coverage JSON file, instead of a plain JSON file, if the name given in settings.py ends in .gz. Reduces the current release coverage file size from ~1.6MB to ~200kB. This is a preparation for saving more information in the release coverage file than we currently do.
- Legacy-Id: 10235
2015-10-18 14:32:36 +00:00
Henrik Levkowetz a23846c8be Changed the storage format for code coverage in *coverage.json, in order to be able to calculate code coverage percentages for a subset of tested files.
- Legacy-Id: 9953
2015-08-01 15:07:21 +00:00
Henrik Levkowetz 9cec8a0587 Added code to the test_runner to force SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE to True during testing, to avoid triggering the system checks error which doesn't find the CDN symlink expected when serving static files via CDN.
- Legacy-Id: 9910
2015-07-28 11:02:00 +00:00
Henrik Levkowetz 0b971f635d Added test coverage data to the release pages if available for the release. Added saving of html pages for the code coverage to a directory in the static files area. If a code coverage report is available, a link to it will be shown on the release page of the current release. Renamed some setting variables related to test coverage to be more explicit and precise.
- Legacy-Id: 9201
2015-03-14 19:08:37 +00:00
Henrik Levkowetz d4f0ad4955 Fixed a pyflakes nit.
- Legacy-Id: 9189
2015-03-13 16:04:40 +00:00
Henrik Levkowetz f499ba8096 Started the code coverage measurements earlier, in order to make the apparent code coverage of model files less confusing.
- Legacy-Id: 9188
2015-03-13 16:02:31 +00:00
Henrik Levkowetz f15e515baf Added a fudge factor to the coverage test, in order to make it easier to do minor code changes.
- Legacy-Id: 9187
2015-03-13 15:56:13 +00:00
Henrik Levkowetz 1d28ec8f5b Made the test runner try multiple port numbers for the SMTP server, in order to handle the case where multiple test suites are in progress on the same host (which can happen when multiple buildbot slaves are running tests at the same time).
- Legacy-Id: 9186
2015-03-13 15:47:12 +00:00
Henrik Levkowetz 5ee64000c3 Changed the test runner to read json files as utf-8.
- Legacy-Id: 9163
2015-03-07 22:28:21 +00:00
Henrik Levkowetz 0be1ad9a2d Fixed a bug in the template coverage expression. Tweaked the informative text prefacing app coverage figures.
- Legacy-Id: 9157
2015-03-06 23:22:54 +00:00
Henrik Levkowetz e94ac990fc Added per-app coverage measurements, to make the numbers shown when not running the full tests suite a bit more meaningful.
- Legacy-Id: 9156
2015-03-06 20:42:20 +00:00
Henrik Levkowetz dba3db444c Added test code coverage measurements using coverage.py, integrated as a test in the test suite. This test compares the current code coverage of tests with that saved for the latest release. Also converted the URL and template coverage measurements into tests, comparing current with the latest release. The result of this is that the coverage tests will fail if new code is added without sufficient test coverage to at least match that of the latest release. Over time, this should encourage gradually improved test coverage as seen for both code, templates, and urls. Coverage data is also saved to file, and can be read by the 'coverage' shell command to produce html or text reports.
- Legacy-Id: 9103
2015-02-19 23:42:34 +00:00
Henrik Levkowetz fe5d53fc40 Merged in [7591] from rjsparks@nostrum.com:
Adds a real (if simple) SMTP server to the test framework and tests handling of exceptions and rejected addresses. Fixes ticket #1314.
 - Legacy-Id: 7613
Note: SVN reference [7591] has been migrated to Git commit 54919f01343995ab154d27dcfaf7a60b15dd5eee
2014-04-16 19:40:57 +00:00
Henrik Levkowetz 5d1bdde730 Added control by the --verbosity switch of the not loaded template test and not tested urls test, so they only will be run for verbosity greater than 1.
- Legacy-Id: 7244
2014-02-16 16:49:34 +00:00
Henrik Levkowetz 35cadc1763 Don't show deprecation warning during tests for verbosity < 2
- Legacy-Id: 7205
2014-02-04 21:35:19 +00:00
Ole Laursen e2554a6a0c It turns out that Django resetting the user if REMOTE_USER is not passed in is a problem on live to, so switch the whole code base to using the middleware to set REMOTE_USER from the logged in user if not passed in from the outside
- Legacy-Id: 7167
2014-01-24 14:30:00 +00:00
Ole Laursen 86f2baea0a Move group feed from wgcharter (where it historically ended up) to wginfo, add test
- Legacy-Id: 7086
2014-01-09 16:24:54 +00:00
Ole Laursen 954c8fcedb Fix spelling mistake in patterns that are ignored in coverage check
- Legacy-Id: 7080
2014-01-08 17:41:40 +00:00
Ole Laursen 8dc19fd17e Improve the coverage checker, skip some trivial views (redirects and
flat templates)
 - Legacy-Id: 7078
2014-01-08 17:00:37 +00:00
Ole Laursen 72e36bde55 Don't output coverage data if there are test failures
- Legacy-Id: 6959
2013-12-17 10:08:12 +00:00
Ole Laursen beda4bafcd Fix bug with coverage testing
- Legacy-Id: 6937
2013-12-16 13:06:41 +00:00