Commit 37a19388 authored by BorjaEst's avatar BorjaEst
Browse files

Merge branch '28-integrate-sqa'

parents f2d16e67 c9188a3f
......@@ -62,6 +62,7 @@ htmlcov/
.coverage
.coverage.*
.cache
.stestr
nosetests.xml
coverage.xml
*.cover
......@@ -69,4 +70,4 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
flake8.log
config:
project_repos:
o3skim:
repo: 'https://git.scc.kit.edu/synergy.o3as/o3skim.git'
branch: master
dockerhub: synergyimk/o3as
dockertag: latest
sqa_criteria:
qc_style:
repos:
o3as:
container: o3skim-testing
tox:
tox_file: /o3skim-testing/tox.ini
testenv:
- pep8
qc_coverage:
repos:
o3as:
container: o3skim-testing
tox:
tox_file: /o3skim-testing/tox.ini
testenv:
- cover
- cobertura
qc_security:
repos:
o3as:
container: o3skim-testing
tox:
tox_file: /o3skim-testing/tox.ini
testenv:
- bandit
#environment:
# LANG: C.UTF-8
timeout: 900
version: "3.6"
services:
o3skim-testing:
image: "indigodatacloud/ci-images:python3.6"
hostname: "o3skim-testing"
volumes:
- type: bind
source: ./o3skim
target: /o3skim-testing
[DEFAULT]
test_path=./tests/
top_dir=./
......@@ -11,9 +11,9 @@
# set the base image. default is python
ARG base=python
# set the tag (e.g. latest, 3.8, 3.7 : for python)
ARG tag=3.8-slim
ARG tag=3.6-slim
# Base image, e.g. python:3.8-slim
# Base image, e.g. python:3.6-slim
FROM ${base}:${tag}
LABEL maintainer='B.Esteban, T.Kerzenmacher, V.Kozlov (KIT)'
......
#!/usr/bin/groovy
@Library(['github.com/indigo-dc/jenkins-pipeline-library@2.0.0']) _
def projectConfig
pipeline {
environment {
registry = "synergyimk/o3skim"
registryCredential = 'dockerhub_id'
}
agent any
stages {
stage('Image build') {
steps {
echo '====================building image===================================='
script { customImage = docker.build(registry) }
}
}
stage('Unit testing') {
stage('SQA baseline dynamic stages') {
steps {
echo '====================executing unittest================================'
script { customImage.inside("--entrypoint=''") {sh 'tox'} }
script {
projectConfig = pipelineConfig()
buildStages(projectConfig)
}
}
}
stage('Docker-hub upload') {
steps {
echo '====================uploading docker-hub=============================='
script { docker.withRegistry('', registryCredential) { customImage.push() } }
post {
cleanup {
cleanWs()
}
}
}
}
}
\ No newline at end of file
}
......@@ -7,6 +7,8 @@
<div align="center">
[![Build Status](https://jenkins.eosc-synergy.eu/buildStatus/icon?job=eosc-synergy-org%2Fo3skim%2Ftest)](https://jenkins.eosc-synergy.eu/job/eosc-synergy-org/job/o3skim/job/test/)
[![Documentation Status](https://readthedocs.org/projects/o3as/badge/?version=latest)](https://o3as.readthedocs.io/en/latest/?badge=latest)
[![pipeline status](https://git.scc.kit.edu/synergy.o3as/o3skim/badges/master/pipeline.svg)](https://git.scc.kit.edu/synergy.o3as/o3skim/-/commits/master)
[![coverage status](https://git.scc.kit.edu/synergy.o3as/o3skim/badges/master/coverage.svg)](https://git.scc.kit.edu/synergy.o3as/o3skim/-/commits/master)
[![License](https://img.shields.io/badge/license-GPL-blue.svg)](https://git.scc.kit.edu/synergy.o3as/o3skim/-/commits/master)
......
......@@ -4,7 +4,7 @@ Local installation
To run tests, you need to install the tool in your system without docker.
As first step ensure you have the following dependencies:
- python_ > 3.8
- python_ > 3.6
- pip_ > 20.0.2
- gcc_
- g++_
......
......@@ -19,6 +19,5 @@ To start testing simply run:
$ tox
...
py37: commands succeeded
py38: commands succeeded
py36: commands succeeded
......@@ -13,7 +13,7 @@ authors_email =
B.Esteban Sanchis <borja.sanchis@kit.edu>
classifiers =
License :: OSI Approved :: GNU General Public License (GPL)
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.6
[options]
packages = find:
......
flake8
bandit>=1.1.0 # Apache-2.0
# Remove once we rely on coverage 4.3+
# https://bitbucket.org/ned/coveragepy/issues/519/
coverage!=4.4,>=4.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testtools>=1.4.0
pytest
pytest-cov
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py38
minversion = 1.6
envlist = py36,pep8
skipsdist = True
[testenv]
deps =
pytest
usedevelop = True
basepython = python3
whitelist_externals = find
install_command = pip install -U {opts} {packages}
# use en_US.UTF-8 as C.UTF-8 doesn't exist in RHEL7
setenv =
VIRTUAL_ENV={envdir}
LC_ALL=C.UTF-8
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=160
deps = -r{toxinidir}/test-requirements.txt
commands = find . -type f -name "*.pyc" -delete
[testenv:cover]
# TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage]
# section once we rely on coverage 4.3+
#
# https://bitbucket.org/ned/coveragepy/issues/519/
envdir = {toxworkdir}/shared
setenv =
{[testenv]setenv}
PYTHON=coverage run --source o3skim --parallel-mode
commands =
{[testenv]commands}
coverage erase
stestr -v run --serial {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:py36]
# TODO(efried): Remove this once https://github.com/tox-dev/tox/issues/425 is fixed.
basepython = python3.6
commands =
pytest
{[testenv]commands}
stestr -v run --serial {posargs}
[testenv:pep8]
envdir = {toxworkdir}/shared
commands = - flake8 --format=pylint --output-file=flake8.log
[testenv:bandit]
envdir = {toxworkdir}/shared
commands = bandit -r o3skim -x tests -s B110,B410
[flake8]
# H803 skipped on purpose per list discussion.
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125,H803,H405
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[testenv:cobertura]
commands = py.test --cov=o3skim --cov-report=xml --cov-report=term-missing tests
[testenv:bandit-report]
#basepython = python2.7
commands =
- mkdir /tmp/bandit
- bandit -r o3skim -x tests -s B110,B410 -f html -o /tmp/bandit/index.html
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