Skip to content
Snippets Groups Projects
Commit 2b738e89 authored by Stéphane Schoorens's avatar Stéphane Schoorens
Browse files

build base of pod-client refs #29848

parents
No related branches found
No related tags found
No related merge requests found
*.py[cod]
# C extensions
*.so
# Editors
.vscode
# Packages
*.egg
*.egg-info
eggs
develop-eggs
.installed.cfg
__pycache__
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
# Virtualenvs
.virtualenv
.venv
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# secrets
.env
image: registry.ubicast.net/pod-client
stages:
- build_docker
- check_code
- test
build_docker_img:
image: registry.ubicast.net/docker/dind-compose
stage: build_docker
rules:
- changes:
- Dockerfile
when: always
- if: '$CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"'
when: always
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.ubicast.net
- make publish_docker_img
flake8:
stage: check_code
tags:
- docker
script:
- make lint
dead_code:
stage: check_code
tags:
- docker
script:
- make deadcode
allow_failure: true
unit_test:
tags:
- docker
stage: test
script:
- make test
coverage: '/TOTAL.*\s+(\d+%)$/'
FROM debian:buster
ENV LANG="C.UTF-8" LC_ALL="C.UTF-8"
ENV DEBIAN_FRONTEND noninteractive
RUN apt update
RUN apt -qy install --no-install-recommends python3 python3-pip
RUN pip3 install -U pip
COPY pip-requirements-docker.txt /tmp/pip-requirements-docker.txt
RUN pip install --no-cache-dir -r /tmp/pip-requirements-docker.txt tox
\ No newline at end of file
Makefile 0 → 100644
DOCKER_REGISTRY ?= registry.ubicast.net
DOCKER_IMG ?= ${DOCKER_REGISTRY}/pod-client
build:
docker build -t ${DOCKER_IMG} .
lint:
docker run -e TOXENV=lint -v ${CURDIR}:/src -w /src ${DOCKER_IMG}:latest tox
deadcode:
docker run -e TOXENV=deadcode -v ${CURDIR}:/src -w /src ${DOCKER_IMG}:latest tox
test:
docker run -e TOXENV=test -v ${CURDIR}:/src -w /src ${DOCKER_IMG}:latest tox -- ${PYTEST_ARGS}
shell:
docker run -it -v ${CURDIR}:/src -w /src --rm ${DOCKER_IMG} /bin/bash
pull_docker_img:
docker pull ${DOCKER_IMG}
publish_docker_img: build
docker push ${DOCKER_IMG}
flake8
pytest
pytest-cov
vulture
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from unittest import TestCase
def setUpModule():
pass
def tearDownModule():
pass
class BaseTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_init(self):
pass
tox.ini 0 → 100644
[tox]
envlist = lint, deadcode, test
toxworkdir = /tmp/tox_workdir
temp_dir = /tmp/tox_tmp
skipsdist = true
[vulture]
parameters = --exclude *settings.py,*config.py --min-confidence 90
[pytest]
addopts = --verbose --tb=long --showlocals --color=yes --cov=pod-client
testpaths = pod-client/
[testenv:lint]
deps = flake8
commands = flake8
[testenv:deadcode]
deps = vulture
commands = vulture . {[vulture]parameters}
[testenv:test]
deps =
pytest >= 4.5.0
pytest-cov >= 2.7.1
commands = pytest
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment