From 2f9457ae98988e9ab1217c6a41da6e3580bf1471 Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Sun, 31 Jul 2016 16:01:54 +0300 Subject: [PATCH 1/9] "make all" now also runs realtime tests --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 5670ff4e..0e4f4b2d 100644 --- a/Makefile +++ b/Makefile @@ -17,3 +17,4 @@ test: cd sniffer && python test_sniff.py cd realtime && npm run test cd client && npm run test + cd realtime && npm run test From 19021ec8bd97a3a476957e2df8ecb896c5e6ceb3 Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Sun, 31 Jul 2016 18:49:15 +0300 Subject: [PATCH 2/9] Add backend coveralls requirement --- backend/requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/requirements.txt b/backend/requirements.txt index 8103a5b5..41d93664 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -2,6 +2,9 @@ Django==1.9.2 PyYAML==3.11 argh==0.26.1 argparse==1.2.1 +coverage==4.2 +coveralls==1.1 +django-nose==1.4.4 funcsigs==0.4 mock==1.3.0 pathtools==0.1.2 From 8cc441287971bd3ed1d4acd2f032c446060dc470 Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Sun, 31 Jul 2016 18:49:29 +0300 Subject: [PATCH 3/9] Enable coverage metrics in backend --- backend/backend/settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/backend/settings.py b/backend/backend/settings.py index cf075be1..4f517f48 100644 --- a/backend/backend/settings.py +++ b/backend/backend/settings.py @@ -38,6 +38,7 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'django_nose' ] MIDDLEWARE_CLASSES = [ @@ -162,3 +163,12 @@ } } } + +# Testing settings + +TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' + +NOSE_ARGS = [ + '--with-coverage', + '--cover-package=breach' +] From 76ad4f929472f40f4d51893f7fcab7fe8e9f932c Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Sun, 31 Jul 2016 18:49:40 +0300 Subject: [PATCH 4/9] Pass backend coverage metrics to coveralls --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index b6a2b0a7..d98697a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,3 +12,5 @@ install: - gem install mdl script: - make all +after_success: + - cd backend && coveralls From 34b25fe44cb68ccb7454011008bebc44d66dd3db Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Sun, 31 Jul 2016 19:18:07 +0300 Subject: [PATCH 5/9] gitignore coverage reports --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 178a9ee1..cfb9dd8b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ env/ .DS_Store tags *.aux +.coverage From fc65e3da3e3807eeeca7406ec0543aa2d5571b4f Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Mon, 1 Aug 2016 00:53:58 +0300 Subject: [PATCH 6/9] Add nose testing requirement for sniffer --- sniffer/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/sniffer/requirements.txt b/sniffer/requirements.txt index de67d52f..e650d012 100644 --- a/sniffer/requirements.txt +++ b/sniffer/requirements.txt @@ -2,3 +2,4 @@ Flask==0.10.1 scapy==2.3.2 tl.testing==0.5 mock==1.3.0 +nose==1.3.7 From 05ca72cf82d54247d1efe54ea361b8851d241269 Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Mon, 1 Aug 2016 00:53:13 +0300 Subject: [PATCH 7/9] Run sniffer tests with coverage --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0e4f4b2d..ebcc615a 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,6 @@ syntax: mdl --rules ~MD036 etc test: cd backend && python manage.py test - cd sniffer && python test_sniff.py + cd sniffer && nosetests --with-coverage --cover-package=app,sniffer cd realtime && npm run test cd client && npm run test - cd realtime && npm run test From 56f097051d138126733a62ee07a94ea5d9f6d6ac Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Mon, 1 Aug 2016 00:54:30 +0300 Subject: [PATCH 8/9] Combine sniffer/backend coverage reports --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index ebcc615a..42888d2b 100644 --- a/Makefile +++ b/Makefile @@ -17,3 +17,4 @@ test: cd sniffer && nosetests --with-coverage --cover-package=app,sniffer cd realtime && npm run test cd client && npm run test + coverage combine backend/.coverage sniffer/.coverage From ef407bfb93a2c872fcc3dc26c6955ced71f796b8 Mon Sep 17 00:00:00 2001 From: Dionysis Zindros Date: Mon, 1 Aug 2016 00:54:41 +0300 Subject: [PATCH 9/9] Upload combined coverage report to coveralls --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d98697a6..b17a6857 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,4 +13,4 @@ install: script: - make all after_success: - - cd backend && coveralls + - coveralls