-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (54 loc) · 1.78 KB
/
tests.yaml
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
64
65
name: Tests
on:
workflow_dispatch:
workflow_call:
jobs:
unit-test:
name: Unit tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Install dependencies
run: python -m pip install tox
- name: Run tests
run: tox -e unit
integration-test-microk8s:
name: Integration tests (microk8s)
runs-on: ubuntu-24.04
needs:
- unit-test
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.28-strict/stable
juju-channel: 3.4/stable
- name: Run integration tests
# set a predictable model name so it can be consumed by charm-logdump-action
run: tox -e integration -- --model testing
- name: Get contexts
run: kubectl config view
if: failure()
- name: Get juju status
run: juju status --relations
if: failure()
- name: Get juju logs
run: juju debug-log --replay --include unit-kratos-0
if: failure()
- name: Get kratos container logs
run: kubectl logs kratos-0 -c kratos -n testing
if: failure()
# Hack to overcome lack of tools (cat, tar) in the workload container
- name: Get kratos config file
run: |
juju ssh kratos/0 "PYTHONPATH=agents/unit-kratos-0/charm/venv/ python3 -c '
from ops import pebble
p = pebble.Client(\"/charm/containers/kratos/pebble.socket\")
f = p.pull(\"/etc/config/kratos/kratos.yaml\")
print(f.read())
'"
if: failure()