Skip to content

Commit

Permalink
fix: reports in SQA
Browse files Browse the repository at this point in the history
  • Loading branch information
vykozlov committed Aug 23, 2024
1 parent 5a533b1 commit e185135
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 29 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.3
2.1.5
4 changes: 2 additions & 2 deletions {{ cookiecutter.__repo_name }}/.sqa/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: "3.6"

services:
thisrepo-testing:
image: "indigodatacloud/ci-images:python3.8"
image: "ai4oshub/ci-images:python3.10"
container_name: "${BUILD_TAG}"
hostname: "${BUILD_TAG}"
working_dir: /srv
command: >
sh -c "git config --global --add safe.directory /srv &&
/usr/sbin/sshd -D"
tail -f /dev/null"
volumes:
- type: bind
source: ./
Expand Down
52 changes: 30 additions & 22 deletions {{ cookiecutter.__repo_name }}/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,37 @@ pipeline {
post {
// publish results and clean-up
always {
// file locations are defined in tox.ini
// publish results of the style analysis
recordIssues(tools: [flake8(pattern: 'flake8.log',
name: 'PEP8 report',
id: "flake8_pylint")])
// publish results of the coverage test
publishHTML([allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: "htmlcov",
reportFiles: 'index.html',
reportName: 'Coverage report',
reportTitles: ''])
// publish results of the security check
publishHTML([allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: "bandit",
reportFiles: 'index.html',
reportName: 'Bandit report',
reportTitles: ''])
script {
if (fileExists("flake8.log")) {
// file locations are defined in tox.ini
// publish results of the style analysis
recordIssues(tools: [flake8(pattern: 'flake8.log',
name: 'PEP8 report',
id: "flake8_pylint")])
}
if (fileExists("htmlcov/index.html")) {
// publish results of the coverage test
publishHTML([allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: "htmlcov",
reportFiles: 'index.html',
reportName: 'Coverage report',
reportTitles: ''])
}
if (fileExists("bandit/index.html")) {
// publish results of the security check
publishHTML([allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: "bandit",
reportFiles: 'index.html',
reportName: 'Bandit report',
reportTitles: ''])
}
}
// Clean after build
cleanWs()
}
}
}
}
2 changes: 1 addition & 1 deletion {{ cookiecutter.__repo_name }}/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"license": "{{ cookiecutter.open_source_license }}",
"date_creation": "{% now 'utc', '%Y-%m-%d' %}",
"dataset_url": "https://zenodo.org/",
"dataset_url": "http://add-some-url-pointing-to-your-dataset.com",
"sources": {
"dockerfile_repo": "{{ cookiecutter.git_base_url }}/{{ cookiecutter.__repo_name }}",
"docker_registry_repo": "ai4oshub/{{ cookiecutter.__repo_name }}",
Expand Down
8 changes: 5 additions & 3 deletions {{ cookiecutter.__repo_name }}/tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[tox]
minversion = 3.25.0
minversion = 3.26.0
isolated_build = True
envlist = qc.sty,qc.cov,qc.sec,py310,py39,py38
envlist = qc.sty,qc.cov,qc.sec,py310

[testenv]
install_command = pip install -U {opts} {packages}
# if recreating envdir fails in tox>=4, comment the following line
envdir = {toxworkdir}/shared
commands = pytest --numprocesses=auto {posargs}
allowlist_externals =
mkdir
Expand Down Expand Up @@ -34,4 +36,4 @@ commands =
[testenv:qc.sec]
commands =
mkdir -p {toxinidir}/bandit
bandit -r {{ cookiecutter.__app_name }} -x tests -o {toxinidir}/bandit/index.html
bandit -r {{ cookiecutter.__app_name }} -x tests -f html -o {toxinidir}/bandit/index.html

0 comments on commit e185135

Please sign in to comment.