From 04558234cb9d13deab1d9cc5dd3af6c454f4f119 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Wed, 25 Mar 2015 20:06:12 +0000 Subject: [PATCH] Updated release data and mkrelease support, which calculates the release coverage snapshot without invoking tests that developers won't ordinarily be able to run on their laptops/work machines. - Legacy-Id: 9339 --- bin/mkrelease | 10 ++++---- ietf/settings_releasetest.py | 44 ++++++++++++++++++++++++++++++++++++ release-coverage.json | 18 +++++++-------- 3 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 ietf/settings_releasetest.py diff --git a/bin/mkrelease b/bin/mkrelease index 283c42ca7..89a61f022 100755 --- a/bin/mkrelease +++ b/bin/mkrelease @@ -167,15 +167,15 @@ DEV="$(printf %d.%d.%d.dev0 $MAJOR $MINOR $NEXT)" #cd $DIR ?? note "Running the tests suite and writing release coverage data ..." -$do ietf/manage.py test --settings=ietf.settings_sqlitetest --save-version-coverage=$VER +$do ietf/manage.py test --settings=ietf.settings_releasetest --save-version-coverage=$VER note "Committing the release coverage data ..." $do svn commit release-coverage.json -m "Code coverage data for release $VER" -note "Checking that there's a recent test-crawler log" -touch -d $RDATE .svn/.latest-commit -TCLOG=$(ls -t ../test-crawl-*.log | head -n 1) -[ $TCLOG -nt .svn/.latest-commit ] || die "Looked for ../test-crawl-*.log, but didn't find one newer than the latest repository commit ($RDATE)" +# note "Checking that there's a recent test-crawler log" +# touch -d $RDATE .svn/.latest-commit +# TCLOG=$(ls -t ../test-crawl-*.log | head -n 1) +# [ $TCLOG -nt .svn/.latest-commit ] || die "Looked for ../test-crawl-*.log, but didn't find one newer than the latest repository commit ($RDATE)" note "Checking that changelog information is available" changes=$( sed -n "/^$PROJ ($VER.*)/,/^ -- /p" changelog ) diff --git a/ietf/settings_releasetest.py b/ietf/settings_releasetest.py new file mode 100644 index 000000000..e85774eef --- /dev/null +++ b/ietf/settings_releasetest.py @@ -0,0 +1,44 @@ +# Standard settings except we use SQLite, this is useful for speeding +# up tests that depend on the test database, try for instance: +# +# ./manage.py test --settings=settings_sqlitetest doc.ChangeStateTestCase +# + +from settings import * # pyflakes:ignore + +# Workaround to avoid spending minutes stepping through the migrations in +# every test run. The result of this is to use the 'syncdb' way of creating +# the test database instead of doing it through the migrations. Taken from +# https://gist.github.com/NotSqrt/5f3c76cd15e40ef62d09 + +## To be removed after upgrade to Django 1.8 ## + +class DisableMigrations(object): + + def __contains__(self, item): + return True + + def __getitem__(self, item): + # The string below is significant. It has to include the value of + # django.db.migrations.loader.MIGRATIONS_MODULE_NAME. Used by django + # 1.7 code in django.db.migrations.loader.MigrationLoader to + # determine whether or not to run migrations for a given module + from django.db.migrations.loader import MIGRATIONS_MODULE_NAME + return "no " + MIGRATIONS_MODULE_NAME + +MIGRATION_MODULES = DisableMigrations() + +# Set the SKIP_* variables to True in order to disable tests which won't +# normally run on developer's laptop, in order to not create +# release-coverage.json data which sets people up for test suite failures on a +# clean checkout + +SKIP_DOT_TO_PDF = True +SKIP_SELENIUM = True + +DATABASES = { + 'default': { + 'NAME': 'test.db', + 'ENGINE': 'django.db.backends.sqlite3', + }, + } diff --git a/release-coverage.json b/release-coverage.json index 813d775f8..e99c7b8ef 100644 --- a/release-coverage.json +++ b/release-coverage.json @@ -6494,9 +6494,9 @@ }, "5.13.0": { "code": { - "coverage": 0.6796908049071262, + "coverage": 0.6783063492673922, "covered": { - "ietf/__init__": 0.0, + "ietf/__init__": 1.0, "ietf/api/__init__": 0.7012987012987013, "ietf/api/management/__init__": 1.0, "ietf/api/management/commands/__init__": 1.0, @@ -6570,7 +6570,7 @@ "ietf/group/edit": 0.862876254180602, "ietf/group/features": 1.0, "ietf/group/feeds": 0.9736842105263157, - "ietf/group/info": 0.787128712871287, + "ietf/group/info": 0.6881188118811882, "ietf/group/mails": 0.9425287356321839, "ietf/group/milestones": 0.8595744680851064, "ietf/group/models": 0.9161676646706587, @@ -6829,7 +6829,7 @@ } }, "template": { - "coverage": 0.6728624535315985, + "coverage": 0.671003717472119, "covered": { "401.html": false, "404.html": true, @@ -7032,7 +7032,7 @@ "group/conclude.html": true, "group/concluded_groups.html": true, "group/customize_workflow.html": true, - "group/dot.txt": true, + "group/dot.txt": false, "group/edit.html": true, "group/edit_milestones.html": true, "group/email_aliases.html": true, @@ -7371,9 +7371,9 @@ "utils/header_change_content.txt": false } }, - "time": "2015-03-25T19:00:54Z", + "time": "2015-03-25T19:48:25Z", "url": { - "coverage": 0.569672131147541, + "coverage": 0.5655737704918032, "covered": { "^$": true, "^(?P(wg|rg))/$": true, @@ -7562,8 +7562,8 @@ "^group/(?P[a-zA-Z0-9-._]+)/ajax/searchdocs/$": false, "^group/(?P[a-zA-Z0-9-._]+)/charter/$": false, "^group/(?P[a-zA-Z0-9-._]+)/conclude/$": false, - "^group/(?P[a-zA-Z0-9-._]+)/deps/dot/$": true, - "^group/(?P[a-zA-Z0-9-._]+)/deps/pdf/$": true, + "^group/(?P[a-zA-Z0-9-._]+)/deps/dot/$": false, + "^group/(?P[a-zA-Z0-9-._]+)/deps/pdf/$": false, "^group/(?P[a-zA-Z0-9-._]+)/documents/$": false, "^group/(?P[a-zA-Z0-9-._]+)/edit/$": false, "^group/(?P[a-zA-Z0-9-._]+)/history/$": false,