add testing and coverage

This commit is contained in:
Robert Kaussow 2020-03-15 23:19:26 +01:00
parent 424f1c0e74
commit 5768351773
4 changed files with 86 additions and 3 deletions

View File

@ -72,6 +72,48 @@ local PipelineDeps = {
}; };
local PipelineTest = { local PipelineTest = {
kind: 'pipeline',
name: 'test',
platform: {
os: 'linux',
arch: 'amd64',
},
steps: [
{
name: 'pytest',
image: 'python:3.8',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install pipenv -qq',
'pipenv --bare install --dev --keep-outdated',
'pipenv run pytest dockertidy/tests/ --cov=dockertidy/ --no-cov-on-fail',
],
},
{
name: 'codecov',
image: 'python:3.8',
environment: {
PY_COLORS: 1,
CODECOV_TOKEN: { from_secret: 'codecov_token' },
},
commands: [
'pip install codecov',
'coverage combine .tox/py*/.coverage',
'codecov --required',
],
},
],
depends_on: [
'dependencies',
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
},
};
local PipelineVerify = {
kind: 'pipeline', kind: 'pipeline',
name: 'verify', name: 'verify',
platform: { platform: {
@ -85,7 +127,7 @@ local PipelineTest = {
PythonVersion(pyversion='3.8'), PythonVersion(pyversion='3.8'),
], ],
depends_on: [ depends_on: [
'dependencies', 'test',
], ],
trigger: { trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],
@ -368,6 +410,7 @@ local PipelineNotifications = {
PipelineLint, PipelineLint,
PipelineDeps, PipelineDeps,
PipelineTest, PipelineTest,
PipelineVerify,
PipelineSecurity, PipelineSecurity,
PipelineBuildPackage, PipelineBuildPackage,
PipelineBuildContainer(arch='amd64'), PipelineBuildContainer(arch='amd64'),

View File

@ -51,6 +51,44 @@ trigger:
depends_on: depends_on:
- lint - lint
---
kind: pipeline
name: test
platform:
os: linux
arch: amd64
steps:
- name: pytest
image: python:3.8
commands:
- pip install pipenv -qq
- pipenv --bare install --dev --keep-outdated
- pipenv run pytest dockertidy/tests/ --cov=dockertidy/ --no-cov-on-fail
environment:
PY_COLORS: 1
- name: codecov
image: python:3.8
commands:
- pip install codecov
- coverage combine .tox/py*/.coverage
- codecov --required
environment:
CODECOV_TOKEN:
from_secret: codecov_token
PY_COLORS: 1
trigger:
ref:
- refs/heads/master
- refs/tags/**
- refs/pull/**
depends_on:
- dependencies
--- ---
kind: pipeline kind: pipeline
name: verify name: verify
@ -111,7 +149,7 @@ trigger:
- refs/pull/** - refs/pull/**
depends_on: depends_on:
- dependencies - test
--- ---
kind: pipeline kind: pipeline
@ -491,6 +529,6 @@ depends_on:
--- ---
kind: signature kind: signature
hmac: 7434a5205208c8f283d2985ede241d81c2fdd629f19032f550d5173449b0c74f hmac: 5fd3ca3dfa6f98b965f927a5b3ac5e9f59d0f871fe97d018bea4ccdcd059923b
... ...

View File

@ -5,6 +5,7 @@
[![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
[![PyPi Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![PyPi Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
[![PyPi Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![PyPi Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
[![Codecov](https://img.shields.io/codecov/c/github/xoxys/docker-tidy)](https://codecov.io/gh/xoxys/docker-tidy)
[![License: MIT](https://img.shields.io/github/license/xoxys/docker-tidy)](LICENSE) [![License: MIT](https://img.shields.io/github/license/xoxys/docker-tidy)](LICENSE)
This project is a fork of [Yelp/docker-custodian](https://github.com/Yelp/docker-custodian). Keep docker hosts tidy. This project is a fork of [Yelp/docker-custodian](https://github.com/Yelp/docker-custodian). Keep docker hosts tidy.

View File

@ -7,6 +7,7 @@ title: Documentation
[![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![Python Version](https://img.shields.io/pypi/pyversions/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
[![PyPi Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![PyPi Status](https://img.shields.io/pypi/status/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
[![PyPi Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/) [![PyPi Release](https://img.shields.io/pypi/v/docker-tidy.svg)](https://pypi.org/project/docker-tidy/)
[![Codecov](https://img.shields.io/codecov/c/github/xoxys/docker-tidy)](https://codecov.io/gh/xoxys/docker-tidy)
[![License: MIT](https://img.shields.io/github/license/xoxys/docker-tidy)](LICENSE) [![License: MIT](https://img.shields.io/github/license/xoxys/docker-tidy)](LICENSE)
This project is a fork of [Yelp/docker-custodian](https://github.com/Yelp/docker-custodian). Keep docker hosts tidy. This project is a fork of [Yelp/docker-custodian](https://github.com/Yelp/docker-custodian). Keep docker hosts tidy.