From b24b16b30af8e98c52edf3fead9ff8982c3c273e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 12 Aug 2016 14:51:26 +0200 Subject: [PATCH] Add coverage, update logging --- .travis.yml | 35 +++++++++++++++++++++-------------- README.md | 2 ++ misp_modules/__init__.py | 2 ++ tests/test.py | 0 4 files changed, 25 insertions(+), 14 deletions(-) mode change 100755 => 100644 tests/test.py diff --git a/.travis.yml b/.travis.yml index ebe717fd..fbe3487c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,28 +5,35 @@ cache: pip services: - redis-server -addons: - apt: - packages: - - libpq5 - python: - "3.3" - "3.4" - "3.5" + - "3.5-dev" - "nightly" install: - - python setup.py install + - pip install -U nose + - pip install coveralls + - pip install codecov + - pip install -U -r REQUIREMENTS + - pip install . script: - - misp-modules & - - sleep 15 - - python setup.py test - - pkill misp-modules + - coverage run -m --parallel-mode --source=misp_modules misp_modules.__init__ & + - pid=$! + - sleep 5 + - nosetests --with-coverage --cover-package=misp_modules + - kill -s INT $pid - pushd ~/ - - misp-modules -s & + - coverage run -m --parallel-mode --source=misp_modules misp_modules.__init__ -s & + - pid=$! - popd - - sleep 15 - - python setup.py test - - pkill misp-modules + - sleep 5 + - nosetests --with-coverage --cover-package=misp_modules + - kill -s INT $pid + +after_success: + - coverage combine .coverage* + - codecov + - coveralls diff --git a/README.md b/README.md index 87fe69f5..a59dd0f3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # MISP modules [![Build Status](https://travis-ci.org/MISP/misp-modules.svg?branch=master)](https://travis-ci.org/MISP/misp-modules) +[![Coverage Status](https://coveralls.io/repos/github/MISP/misp-modules/badge.svg?branch=master)](https://coveralls.io/github/MISP/misp-modules?branch=master) +[![codecov](https://codecov.io/gh/MISP/misp-modules/branch/master/graph/badge.svg)](https://codecov.io/gh/MISP/misp-modules) MISP modules are autonomous modules that can be used for expansion and other services in [MISP](https://github.com/MISP/MISP). diff --git a/misp_modules/__init__.py b/misp_modules/__init__.py index 2617faeb..ba4f8ec2 100644 --- a/misp_modules/__init__.py +++ b/misp_modules/__init__.py @@ -188,9 +188,11 @@ def main(): listen = args.l log = init_logger() if args.s: + log.info('Launch MISP modules server from package.') load_package_helpers() mhandlers, loaded_modules = load_package_modules() else: + log.info('Launch MISP modules server from current directory.') os.chdir(os.path.dirname(__file__)) modulesdir = 'modules' helpersdir = 'helpers' diff --git a/tests/test.py b/tests/test.py old mode 100755 new mode 100644