charm: Add unit test jobs
Change-Id: I16fd52137dd96770e041dadeb6b4ed54e067fbef
diff --git a/playbooks/charm-cinder-storpool-iscsi/charm-tox.yaml b/playbooks/charm-cinder-storpool-iscsi/charm-tox.yaml
new file mode 100644
index 0000000..3052907
--- /dev/null
+++ b/playbooks/charm-cinder-storpool-iscsi/charm-tox.yaml
@@ -0,0 +1,15 @@
+- hosts: all
+ tasks:
+
+ - name: Install tox
+ ansible.builtin.apt:
+ name: tox
+ update_cache: yes
+ become: true
+
+ - name: Run tox
+ ansible.builtin.shell: tox -e {{ tox_env }}
+ args:
+ executable: /usr/bin/bash
+ chdir: /home/ubuntu/src/spfactory.storpool.com/charm-cinder-storpool-iscsi
+
diff --git a/zuul.d/charm-cinder-storpool-iscsi.yaml b/zuul.d/charm-cinder-storpool-iscsi.yaml
index 8cc9082..aa5031e 100644
--- a/zuul.d/charm-cinder-storpool-iscsi.yaml
+++ b/zuul.d/charm-cinder-storpool-iscsi.yaml
@@ -84,10 +84,44 @@
vars:
bundle: jammy-yoga-edge
+- job:
+ name: charm-tox
+ description: ""
+ run: playbooks/charm-cinder-storpool-iscsi/charm-tox.yaml
+ timeout: 10800
+ nodeset:
+ nodes:
+ - name: controller
+ label: os-ubuntu-focal
+
+- job:
+ name: charm-tox-black
+ parent: charm-tox
+ vars:
+ tox_env: black
+
+- job:
+ name: charm-tox-pep8
+ parent: charm-tox
+ vars:
+ tox_env: pep8
+
+- job:
+ name: charm-tox-lint
+ parent: charm-tox
+ vars:
+ tox_env: lint
+
- project:
name: charm-cinder-storpool-iscsi
check:
jobs:
+ - charm-tox-black:
+ branches: master
+ - charm-tox-pep8:
+ branches: master
+ - charm-tox-lint:
+ branches: master
- zaza-functional-focal-ussuri:
branches: master
experimental: