Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci migration (Reef) #4

Merged
merged 1 commit into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build/Test

on:
workflow_call:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: python3 -m pip install tox

- name: Run linters
run: tox -e pep8

unit-test:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get -qq install libxslt-dev libxml2-dev python3-lxml
python -m pip install tox

- name: Run tests
run: tox -e py3

build:
name: Build the charm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup LXD
uses: canonical/setup-lxd@v0.1.1
with:
channel: 5.20/stable

- name: Install dependencies
run: python -m pip install tox

- name: Build charm(s)
id: builder
run: |
sudo snap install charmcraft --classic
tox -e build

- name: Upload built charm
uses: actions/upload-artifact@v3
with:
name: charms
path: "*.charm"

functional-test:
needs:
- lint
- unit-test
- build
name: Functional tests
runs-on: ubuntu-latest
steps:

- name: Download charm
uses: actions/download-artifact@v3
with:
name: charms
path: ~/artifacts/

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup LXD
uses: canonical/setup-lxd@v0.1.1
with:
# pin lxd to LTS release.
channel: 5.21/stable

- name: Install dependencies
run: |
python -m pip install tox
sudo snap install juju
mkdir -p ~/.local/share/juju
juju bootstrap localhost

- name: Run jammy-antelope tests
run: |
date
mv ~/artifacts/ceph-fs.charm ./
tox -c src -e func-target -- jammy-antelope
8 changes: 8 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: PR

on:
pull_request:

jobs:
build:
uses: ./.github/workflows/build-and-test.yml
3 changes: 2 additions & 1 deletion src/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ tox

# Functional Test Requirements (let Zaza's dependencies solve all dependencies here!)
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
#git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
git+https://github.com/lmlg/zaza-openstack-tests.git@ceph-fs-standalone#egg=zaza.openstack
44 changes: 0 additions & 44 deletions src/tests/bundles/focal-yoga.yaml

This file was deleted.

27 changes: 22 additions & 5 deletions src/tests/bundles/jammy-antelope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,23 @@ local_overlay_enabled: False

series: &series jammy

machines:
'0':
'1':
constraints: virt-type=virtual-machine mem=4G
'2':
constraints: virt-type=virtual-machine mem=4G
'3':
constraints: virt-type=virtual-machine mem=4G

applications:
ubuntu: # used to test mounts
charm: ch:ubuntu
num_units: 2
to:
- '2'
- '3'

ceph-fs:
charm: ../../../ceph-fs.charm
num_units: 1
Expand All @@ -17,24 +30,28 @@ applications:
pool-type: erasure-coded
ec-profile-k: 4
ec-profile-m: 2
to:
- '2'

ceph-osd:
charm: ch:ceph-osd
num_units: 6
storage:
osd-devices: 'cinder,10G'
num_units: 1
options:
osd-devices: '/dev/test-non-existent'
source: *openstack-origin
channel: quincy/edge
channel: latest/edge
to:
- '1'

ceph-mon:
charm: ch:ceph-mon
num_units: 3
options:
monitor-count: '3'
source: *openstack-origin
channel: quincy/edge
channel: latest/edge
to:
- '0'

relations:
- - 'ceph-mon:mds'
Expand Down
44 changes: 0 additions & 44 deletions src/tests/bundles/jammy-bobcat.yaml

This file was deleted.

27 changes: 14 additions & 13 deletions src/tests/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
charm_name: ceph-fs
gate_bundles:
- focal-xena
- focal-yoga
- jammy-yoga
- jammy-bobcat
smoke_bundles:
- focal-xena
# configure:
# - zaza.openstack.charm_tests.glance.setup.add_lts_image
# - zaza.openstack.charm_tests.neutron.setup.basic_overcloud_network
# - zaza.openstack.charm_tests.nova.setup.create_flavors
# - zaza.openstack.charm_tests.nova.setup.manage_ssh_key
# - zaza.openstack.charm_tests.keystone.setup.add_demo_user
configure:
- zaza.openstack.charm_tests.ceph.osd.tests.setup_osd_standalone
tests:
- zaza.openstack.charm_tests.ceph.fs.tests.CephFSTests
- zaza.openstack.charm_tests.ceph.fs.tests.CharmOperationTest
Expand All @@ -21,3 +10,15 @@ target_deploy_status:
ubuntu:
workload-status: active
workload-status-message-prefix: ''

ceph-osd:
workload-status: blocked
workload-status-message: 'No block devices detected using current configuration'

ceph-fs:
workload-status: waiting
workload-status-message: "'ceph-mds' incomplete"

ceph-mon:
workload-status: waiting
workload-status-message: 'Monitor bootstrapped but waiting'
1 change: 1 addition & 0 deletions src/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ minversion = 3.18.0
[testenv]
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
TEST_JUJU3=1
allowlist_externals = juju
passenv = HOME TERM CS_* OS_* TEST_*
deps = -r{toxinidir}/test-requirements.txt
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ commands =
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
sitepackages = True

[testenv:py35]
basepython = python3.5
Expand Down
Loading