Skip to content

Commit 2aef8d7

Browse files
authored
(cephfs-server-proxy) ci: enable continuous integration
Merge pull request #2 from canonical/integration-tests
2 parents 551f294 + 9f04d98 commit 2aef8d7

File tree

22 files changed

+2593
-118
lines changed

22 files changed

+2593
-118
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Bug Report
2+
description: File a bug report
3+
labels: ["Type: Bug", "Status: Triage"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: >
8+
Thanks for taking the time to fill out this bug report! Before submitting your issue, please make
9+
sure you are using the latest version of the charm. If not, please switch to the latest version of this charm
10+
before posting your report to make sure it's not already solved.
11+
- type: textarea
12+
id: bug-description
13+
attributes:
14+
label: Bug Description
15+
description: >
16+
Provide a description of the issue you are facing. If applicable, add screenshots to help explain the problem.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: reproduction
21+
attributes:
22+
label: To Reproduce
23+
description: >
24+
Please provide a step-by-step instruction of how to reproduce the behavior.
25+
placeholder: |
26+
1. `juju deploy ...`
27+
2. `juju relate ...`
28+
3. `juju status --relations`
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: environment
33+
attributes:
34+
label: Environment
35+
description: >
36+
We need to know a bit more about the context in which you run the charm.
37+
- Are you running Juju locally, on lxd, in multipass or on some other platform?
38+
- What track and channel you deployed the charm from (ie. `latest/edge` or similar).
39+
- Version of any applicable components, like the juju snap, the model controller, lxd, microk8s, and/or multipass.
40+
validations:
41+
required: true
42+
- type: textarea
43+
id: logs
44+
attributes:
45+
label: Relevant log output
46+
description: >
47+
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
48+
Fetch the logs using `juju debug-log --replay`. Additional details on how to retrieve logs are available in the juju
49+
documentation at https://juju.is/docs/olm/juju-logs.
50+
render: shell
51+
validations:
52+
required: true
53+
- type: textarea
54+
id: additional-context
55+
attributes:
56+
label: Additional context
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Description
2+
3+
> Provide a description of the purpose of this pull request, as well as its
4+
motivation and context. Is it a new feature? A bug fix? Does it address an existing issue?
5+
6+
## How was the code tested?
7+
8+
> Describe the conditions under which the code has been tested.
9+
> * Did you run the defined integration and units under `tests/`?
10+
> * Did you write new tests? Where are they located in the repository?
11+
> * Which undercloud did you use to perform the tests? LXD, vSphere, AWS, etc.
12+
> * What operating system did you test the charms on? Ubuntu 22.04, Ubuntu 20.04, CentOS 7, etc.
13+
14+
## Related issues and/or tasks
15+
16+
> Link any related issues or project board tasks to this pull request.
17+
18+
## Checklist
19+
20+
- [ ] I am the author of these changes, or I have the rights to submit them.
21+
- [ ] I have added the relevant changes to the README and/or documentation.
22+
- [ ] I have self reviewed my own code.
23+
- [ ] All requested changes and/or review comments have been resolved.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2024 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
4+
name: cla-check
5+
on:
6+
workflow_call:
7+
pull_request:
8+
9+
jobs:
10+
cla-check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check if Canonical CLA has been signed
14+
uses: canonical/has-signed-canonical-cla@v1
15+
with:
16+
github-token: "${{ secrets.GITHUB_TOKEN }}"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 2024 Canonical Ltd.
2+
# See LICENSE for licensing details.
3+
4+
name: cephfs-server-proxy tests
5+
on:
6+
workflow_call:
7+
pull_request:
8+
9+
jobs:
10+
inclusive-naming-check:
11+
name: Inclusive naming check
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Run tests
17+
uses: get-woke/woke-action@v0
18+
with:
19+
fail-on-error: true
20+
21+
lint:
22+
name: Lint
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
- name: Install dependencies
28+
run: python3 -m pip install tox
29+
- name: Run linters
30+
run: tox -e lint
31+
32+
unit-test:
33+
name: Unit tests
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
- name: Install dependencies
39+
run: python3 -m pip install tox
40+
- name: Run tests
41+
run: tox -e unit
42+
43+
integration-test:
44+
name: Integration tests (LXD)
45+
runs-on: ubuntu-latest
46+
needs:
47+
- inclusive-naming-check
48+
- lint
49+
- unit-test
50+
timeout-minutes: 120
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
- name: Set up operator environment
55+
uses: charmed-kubernetes/actions-operator@main
56+
with:
57+
provider: lxd
58+
juju-channel: 3.1/stable
59+
- name: Run integration tests
60+
run: tox -e integration
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2024 Canonical Ltd.
2+
# See LICENSE for licensing details.
3+
4+
name: Release to latest/edge
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
ci-tests:
13+
uses: ./.github/workflows/ci.yaml
14+
15+
release-to-charmhub:
16+
name: Release cephfs-client to Charmhub
17+
needs:
18+
- ci-tests
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Select charmhub channel
24+
uses: canonical/charming-actions/[email protected]
25+
id: channel
26+
- name: Upload charm to charmhub
27+
uses: canonical/charming-actions/[email protected]
28+
with:
29+
credentials: "${{ secrets.CHARMCRAFT_AUTH }}"
30+
github-token: "${{ secrets.GITHUB_TOKEN }}"
31+
channel: "${{ steps.channel.outputs.name }}"

charms/cephfs-server-proxy/charmcraft.yaml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright 2024 Canonical Ltd.
2+
# See LICENSE file for licensing details.
13
name: cephfs-server-proxy
24
type: charm
35

@@ -19,6 +21,10 @@ bases:
1921
- name: ubuntu
2022
channel: "22.04"
2123

24+
peers:
25+
proxy:
26+
interface: proxy
27+
2228
provides:
2329
cephfs-share:
2430
interface: cephfs_share
@@ -43,4 +49,3 @@ config:
4349
description: |
4450
Username and Cephx key to authenticate against the exported CephFS share.
4551
Expected format: <username>:<cephx-base64-key>
46-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
juju ~= 3.3
2+
pylxd ~= 2.3
3+
pytest ~= 7.2
4+
pytest-operator ~= 0.34
5+
pytest-order ~= 1.1
6+
tenacity ~= 8.2

0 commit comments

Comments
 (0)