Commit graph

38 commits

Author SHA1 Message Date
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
Ole Laursen 7aa3737c3b Reenable RemoteUserMiddleware, it turns out the Secretariat tests are
using REMOTE_USER to auth instead of logging in - instead include a
little middleware class that adds the REMOTE_USER header during
testing.

Also fix problem with the empty test_label hack not working with
double-dotted Secretariat apps.
 - Legacy-Id: 6935
2013-12-16 12:59:27 +00:00
Ole Laursen b4706af925 Fix problem with tests and RemoteUserMiddleware - it interferes with
the tests, also fix bug in previous test runner refactor
 - Legacy-Id: 6914
2013-12-13 15:37:04 +00:00
Ole Laursen dec6862787 Make GLOBAL_TEST_FIXTURES support Python functions as fixtures
- Legacy-Id: 6906
2013-12-13 13:13:03 +00:00
Ole Laursen c470e57dae Port test runner to new Django interface
- Legacy-Id: 6903
2013-12-13 11:22:40 +00:00
Ole Laursen 3053bef4cc Resurrect URL coverage making it work with all tests, and move it to the test runner together with the template coverage report
- Legacy-Id: 6844
2013-12-07 19:31:32 +00:00
Henrik Levkowetz d8e3e32ee7 Set TEMPLATE_STRING_TO_INVALID to '' during testing.
- Legacy-Id: 6493
2013-10-27 10:02:21 +00:00
Henrik Levkowetz a07f47a4a0 Added a new TestCase class, subclassing django.test.TestCase, in order to
be able to add fixtures once and for all for all tests, instead of loading
them again and again for each test, if running on a database that supports
transaction rollbacks.  In this case, fixtures specified in the perma_fixtures
class attribute will be loaded permanently, and not re-loaded.  Fixtures
specifice as before, in a fixtures class attribute, will be treated as
before.

The downside of this is that as fixtures are loaded and not unloaded, they
can conflict with each other.  The requirements on consistency becomes much
greater.  The effect of this has been to require quite a bit of changes to
the simplified creations of various objects in make_test_data() in cases
where identically named objects occur in fixtures.  Where completely
fictitious objects are created, no conflicts appear.

Also re-wrote parts of test_runner.py to permit global fixtures, loaded
before any tests are run and shared by all.
 - Legacy-Id: 6318
2013-09-30 20:22:24 +00:00
Henrik Levkowetz 6baea429aa Merged in the nomcom app from ejimenez@yaco.es and esanchez@yaco.es, and accompanying dbtemplate app and the (standard) docutils module. Added some tweaks to get all tests to pass and migrations to run.
- Legacy-Id: 5948
2013-08-06 10:09:29 +00:00
Henrik Levkowetz 3105101cc5 Changed test running and test data generation to work with database rollback
(for instance with InnoDB).

Added settings.DATABASE_TEST_OPTIONS which can be used to force for instance
InnoDB use during testing.

Using this has the potential of reducing the time it takes to run the test
suite substantially; a few test runs indicate a reduction in test run time by
50% on a run-of-the-mill linux server.
 - Legacy-Id: 5823
2013-07-15 07:21:34 +00:00
Henrik Levkowetz 9d9e2851e0 Test the argument list, not the tuple of argument tuple.
- Legacy-Id: 5134
2012-12-16 18:30:25 +00:00
Henrik Levkowetz 97a7ab30db Added simple logging of test runs, to make it easier to be sure that tests has been run successfully on the latest code.
- Legacy-Id: 5131
2012-12-15 22:47:11 +00:00
Henrik Levkowetz d0214d3b25 Merged [4806] from rjsparks@nostrum.com:
Better handling for BoFs, particularly those that won't create WGs
 - Legacy-Id: 4939
2012-10-21 14:40:02 +00:00
Henrik Levkowetz 1bc2f7daa2 Tweak test setup message for site_id change.
- Legacy-Id: 4567
2012-07-03 13:42:36 +00:00
Henrik Levkowetz 350914da15 Minor cleanup of test_runner.py. Added guards against settings which can make tests inexplicably fail. Updated check to avoid running tests on production server.
- Legacy-Id: 4564
2012-07-03 11:31:11 +00:00
Ole Laursen 9ae5f6a456 Make test runner multi-DB-aware
- Legacy-Id: 3786
2011-12-23 13:15:27 +00:00
Ole Laursen ce74be89ef Use the test mode in the mail code when running automated tests instead of
reinventing the wheel in test_runner
 - Legacy-Id: 3620
2011-11-15 11:24:33 +00:00
Ole Laursen f7eefe8ee2 Finally get the mail system during automated test to send the real
message (i.e. pretend to do) instead of sending a copy, should make it
a bit easier to write tests
 - Legacy-Id: 3595
2011-11-08 11:48:57 +00:00
Henrik Levkowetz 266b7820d0 Merged from log:branch/2.00@2363: Current release branch head to trunk.
- Legacy-Id: 2365
2010-07-21 12:48:05 +00:00