-
Notifications
You must be signed in to change notification settings - Fork 3
/
tox.ini
63 lines (56 loc) · 2.28 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
[tox]
requires =
tox>=4
env_list = lint, integration
[testenv]
setenv =
name=charmed-mongodb
registry_namespace=ghcr.io/canonical
repo=https://github.com/canonical/mongodb-k8s-operator.git
branch=6/edge
[testenv:lint]
description = run linters
skip_install = true
deps =
yamllint
commands =
yamllint --no-warnings rockcraft.yaml
[testenv:integration]
description = run operator integration tests
skip_install = true
allowlist_externals =
tox
bash
commands =
bash -ec 'if ! [ -f {env:name}_*-$(yq .base rockcraft.yaml | cut -c 8-)_edge_amd64.rock ]; \
then rockcraft pack; ./retag_rock.sh; fi'
bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \
cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}'
bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs}
tox --workdir operator -c operator -e integration -- tests/integration/test_charm.py
[testenv:ha-integration]
description = run operator integration tests
skip_install = true
allowlist_externals =
tox
bash
commands =
bash -ec 'if ! [ -f {env:name}_*-$(yq .base rockcraft.yaml | cut -c 8-)_edge_amd64.rock ]; \
then rockcraft pack; ./retag_rock.sh; fi'
bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \
cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}'
bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs}
tox --workdir operator -c operator -e integration -- tests/integration/ha_tests/test_ha.py --deselect tests/integration/ha_tests/test_ha.py::test_network_cut
[testenv:tls-integration]
description = run operator integration tests
skip_install = true
allowlist_externals =
tox
bash
commands =
bash -ec 'if ! [ -f {env:name}_*-$(yq .base rockcraft.yaml | cut -c 8-)_edge_amd64.rock ]; \
then rockcraft pack; ./retag_rock.sh; fi'
bash -ec 'microk8s ctr image import {env:name}_*-$(yq .base rockcraft.yaml | \
cut -c 8-)_edge_amd64.rock --base-name {env:registry_namespace}/{env:name}'
bash -ec 'if ! [ -d operator ]; then git clone --single-branch --branch {env:branch} {env:repo} operator; fi' {posargs}
tox --workdir operator -c operator -e integration -- tests/integration/tls_tests/test_tls.py