Browse Source

ci: add python file checks to ci

test-rocky8
Robert Kaussow 8 months ago
parent
commit
8616d082c1
Signed by: xoxys GPG Key ID: 4E692A2EAECC03C0
  1. 22
      .drone.jsonnet
  2. 18
      .drone.yml
  3. 8
      molecule/centos7/tests/test_default.py

22
.drone.jsonnet

@ -13,6 +13,28 @@ local PipelineLinting = {
'ansible-later',
],
},
{
name: 'python-format',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -qq yapf',
'yapf -dr ./',
],
},
{
name: 'python-flake8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -qq flake8',
'flake8',
],
},
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],

18
.drone.yml

@ -12,6 +12,22 @@ steps:
commands:
- ansible-later
- name: python-format
image: python:3.9
commands:
- pip install -qq yapf
- yapf -dr ./
environment:
PY_COLORS: 1
- name: python-flake8
image: python:3.9
commands:
- pip install -qq flake8
- flake8
environment:
PY_COLORS: 1
trigger:
ref:
- refs/heads/master
@ -131,6 +147,6 @@ depends_on:
---
kind: signature
hmac: 486b4437d1503292c3917b2f28057daaa37d7cdc9765185034310d1c77ca2857
hmac: 7b92afb1e25d890fe046ea5085ee40453407187cd510982d683d045f3e173b64
...

8
molecule/centos7/tests/test_default.py

@ -2,13 +2,9 @@ import os
import testinfra.utils.ansible_runner
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
def test_postfix_is_installed(host):

Loading…
Cancel
Save