Commit f138bd55 authored by Jason Frisvold's avatar Jason Frisvold
Browse files

- Add coverage rc file

- Add unit testing to gitlab ci
- Create first test
parent dadaaed0
# .coveragerc to control coverage.py
[run]
branch = False
omit =
.gitlab/*
.tox/*
compose/*
data/*
docs/*
envs/*
logs/*
requires/*
setup.py
src/sandbox/*
src/tests/*
[report]
exclude_lines =
pragma: no cover
def __repr__
raise NotImplementedError
if 0:
if __name__ == .__main__.:
[html]
directory = htmlcov
......@@ -8,8 +8,33 @@ variables:
DOCKER_DRIVER: overlay
stages:
- test
- analysis
unit-test:
stage: test
image: python:3-alpine
variables:
PYTHONPATH: src/
script:
- pip install pytest pytest-cov
- ls src
- ls tests
- cd src/tests/libs/
- pytest
--cov-config .coveragerc
--junitxml=result.xml
--cov=.
--cov-report term
--cov-report xml
--cov-report term-missing
artifacts:
when: on_success
untracked: True
paths:
- coverage.xml
- result.xml
sonarqube:
stage: analysis
image: ciricihq/gitlab-sonar-scanner
......
#!/usr/bin/env python
# * Skynet - Automated "Cloud" Security Scanner * #
# * Copyright (C) 2014-present Jason Frisvold <friz@godshell.com> * #
# * * #
# * This program is free software; you can redistribute it and/or modify * #
# * it under the terms of the GNU General Public License as published by * #
# * the Free Software Foundation; either version 2 of the License, or * #
# * (at your option) any later version. * #
# * * #
# * This program is distributed in the hope that it will be useful, * #
# * but WITHOUT ANY WARRANTY; without even the implied warranty of * #
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * #
# * GNU General Public License for more details. * #
# * * #
# * You should have received a copy of the GNU General Public License * #
# * along with this program; if not, write to the Free Software * #
# * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * #
# * 02110-1301 USA * #
import pytest
from libs.config import SkynetConfig
def test_instantiation():
configobject = SkynetConfig()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment