Skip to content

Commit d6f4f86

Browse files
authored
Merge pull request #4 from lmlg/ci-migration-reef
Ci migration (Reef)
2 parents 3c289d2 + 7debf36 commit d6f4f86

9 files changed

+150
-107
lines changed

.github/workflows/build-and-test.yml

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Build/Test
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
lint:
8+
name: Lint
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install dependencies
15+
run: python3 -m pip install tox
16+
17+
- name: Run linters
18+
run: tox -e pep8
19+
20+
unit-test:
21+
name: Unit tests
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Install dependencies
29+
run: |
30+
sudo apt-get -qq install libxslt-dev libxml2-dev python3-lxml
31+
python -m pip install tox
32+
33+
- name: Run tests
34+
run: tox -e py3
35+
36+
build:
37+
name: Build the charm
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 1
44+
45+
- name: Setup LXD
46+
uses: canonical/setup-lxd@v0.1.1
47+
with:
48+
channel: 5.20/stable
49+
50+
- name: Install dependencies
51+
run: python -m pip install tox
52+
53+
- name: Build charm(s)
54+
id: builder
55+
run: |
56+
sudo snap install charmcraft --classic
57+
tox -e build
58+
59+
- name: Upload built charm
60+
uses: actions/upload-artifact@v3
61+
with:
62+
name: charms
63+
path: "*.charm"
64+
65+
functional-test:
66+
needs:
67+
- lint
68+
- unit-test
69+
- build
70+
name: Functional tests
71+
runs-on: ubuntu-latest
72+
steps:
73+
74+
- name: Download charm
75+
uses: actions/download-artifact@v3
76+
with:
77+
name: charms
78+
path: ~/artifacts/
79+
80+
- name: Checkout code
81+
uses: actions/checkout@v3
82+
with:
83+
fetch-depth: 0
84+
85+
- name: Setup LXD
86+
uses: canonical/setup-lxd@v0.1.1
87+
with:
88+
# pin lxd to LTS release.
89+
channel: 5.21/stable
90+
91+
- name: Install dependencies
92+
run: |
93+
python -m pip install tox
94+
sudo snap install juju
95+
mkdir -p ~/.local/share/juju
96+
juju bootstrap localhost
97+
98+
- name: Run jammy-antelope tests
99+
run: |
100+
date
101+
mv ~/artifacts/ceph-fs.charm ./
102+
tox -c src -e func-target -- jammy-antelope

.github/workflows/pr.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
uses: ./.github/workflows/build-and-test.yml

src/test-requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ tox
99

1010
# Functional Test Requirements (let Zaza's dependencies solve all dependencies here!)
1111
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
12-
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
12+
#git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
13+
git+https://github.com/lmlg/zaza-openstack-tests.git@ceph-fs-standalone#egg=zaza.openstack

src/tests/bundles/focal-yoga.yaml

-44
This file was deleted.

src/tests/bundles/jammy-antelope.yaml

+22-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,23 @@ local_overlay_enabled: False
55

66
series: &series jammy
77

8+
machines:
9+
'0':
10+
'1':
11+
constraints: virt-type=virtual-machine mem=4G
12+
'2':
13+
constraints: virt-type=virtual-machine mem=4G
14+
'3':
15+
constraints: virt-type=virtual-machine mem=4G
16+
817
applications:
918
ubuntu: # used to test mounts
1019
charm: ch:ubuntu
1120
num_units: 2
21+
to:
22+
- '2'
23+
- '3'
24+
1225
ceph-fs:
1326
charm: ../../../ceph-fs.charm
1427
num_units: 1
@@ -17,24 +30,28 @@ applications:
1730
pool-type: erasure-coded
1831
ec-profile-k: 4
1932
ec-profile-m: 2
33+
to:
34+
- '2'
2035

2136
ceph-osd:
2237
charm: ch:ceph-osd
23-
num_units: 6
24-
storage:
25-
osd-devices: 'cinder,10G'
38+
num_units: 1
2639
options:
2740
osd-devices: '/dev/test-non-existent'
2841
source: *openstack-origin
29-
channel: quincy/edge
42+
channel: latest/edge
43+
to:
44+
- '1'
3045

3146
ceph-mon:
3247
charm: ch:ceph-mon
3348
num_units: 3
3449
options:
3550
monitor-count: '3'
3651
source: *openstack-origin
37-
channel: quincy/edge
52+
channel: latest/edge
53+
to:
54+
- '0'
3855

3956
relations:
4057
- - 'ceph-mon:mds'

src/tests/bundles/jammy-bobcat.yaml

-44
This file was deleted.

src/tests/tests.yaml

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
charm_name: ceph-fs
2-
gate_bundles:
3-
- focal-xena
4-
- focal-yoga
5-
- jammy-yoga
6-
- jammy-bobcat
7-
smoke_bundles:
8-
- focal-xena
9-
# configure:
10-
# - zaza.openstack.charm_tests.glance.setup.add_lts_image
11-
# - zaza.openstack.charm_tests.neutron.setup.basic_overcloud_network
12-
# - zaza.openstack.charm_tests.nova.setup.create_flavors
13-
# - zaza.openstack.charm_tests.nova.setup.manage_ssh_key
14-
# - zaza.openstack.charm_tests.keystone.setup.add_demo_user
2+
configure:
3+
- zaza.openstack.charm_tests.ceph.osd.tests.setup_osd_standalone
154
tests:
165
- zaza.openstack.charm_tests.ceph.fs.tests.CephFSTests
176
- zaza.openstack.charm_tests.ceph.fs.tests.CharmOperationTest
@@ -21,3 +10,15 @@ target_deploy_status:
2110
ubuntu:
2211
workload-status: active
2312
workload-status-message-prefix: ''
13+
14+
ceph-osd:
15+
workload-status: blocked
16+
workload-status-message: 'No block devices detected using current configuration'
17+
18+
ceph-fs:
19+
workload-status: waiting
20+
workload-status-message: "'ceph-mds' incomplete"
21+
22+
ceph-mon:
23+
workload-status: waiting
24+
workload-status-message: 'Monitor bootstrapped but waiting'

src/tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ minversion = 3.18.0
2727
[testenv]
2828
setenv = VIRTUAL_ENV={envdir}
2929
PYTHONHASHSEED=0
30+
TEST_JUJU3=1
3031
allowlist_externals = juju
3132
passenv = HOME TERM CS_* OS_* TEST_*
3233
deps = -r{toxinidir}/test-requirements.txt

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ commands =
6868
basepython = python3
6969
deps = -r{toxinidir}/test-requirements.txt
7070
commands = stestr run --slowest {posargs}
71+
sitepackages = True
7172

7273
[testenv:py35]
7374
basepython = python3.5

0 commit comments

Comments
 (0)