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

[TEST] Feat/private endpoint #284

Merged
merged 151 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
18d9294
Add config for repo-policy-compliance-{token,url}
cbartz Apr 25, 2024
d8b928b
rename pre-job contents variables
cbartz Apr 25, 2024
c0df2e8
add config validation
cbartz Apr 26, 2024
237dba8
remove redundant catch
cbartz Apr 26, 2024
7047198
use repo policy check in openstack
cbartz Apr 26, 2024
5636795
Merge branch 'refs/heads/feat/openstack-integration' into feat/openst…
cbartz Apr 29, 2024
6413b69
generate src-docs
cbartz Apr 29, 2024
27c1ebf
fix after merge and lint
cbartz Apr 29, 2024
50e95d5
fix lint
cbartz May 2, 2024
de68eaa
fix unit tests
cbartz May 2, 2024
bfcf111
add unit test
cbartz May 2, 2024
d3e7af8
fix comment in repo policy compliance client
cbartz May 2, 2024
02c271b
temporary enable integration test
cbartz May 2, 2024
9e7a1a8
Add note to config that only the OpenStack cloud is supported
cbartz May 2, 2024
402ae10
temporary enable integration test
cbartz May 2, 2024
854db92
Revert "temporary enable integration test"
cbartz May 2, 2024
dea2c5c
Revert "temporary enable integration test"
cbartz May 2, 2024
adc845b
go in blocked state when using repo-policy without os
cbartz May 3, 2024
4becec3
define and use AnyHttpsUrl for dockerhub-mirror
cbartz May 3, 2024
1e311b5
WIP checkin
cbartz May 3, 2024
6116154
remove x64 from workflow files
cbartz May 4, 2024
34c1ba9
add labels config
cbartz May 4, 2024
4c8684e
Merge branch 'refs/heads/feat/openstack-integration' into feat/integr…
cbartz May 6, 2024
6281c3c
write_post_metrics also on error
cbartz May 6, 2024
f8b7e12
chmod and owner of ssh key
cbartz May 6, 2024
24379e6
fix write_post_metrics also on error
cbartz May 6, 2024
19a8547
Checkin adaptions to let integration test run
cbartz May 6, 2024
c7e2585
Use marker
cbartz May 6, 2024
7a42ea7
fix write_post_metrics also on error
cbartz May 6, 2024
99f8126
enable integration tests
cbartz May 6, 2024
77d6132
add OpenStackInstanceHelper
cbartz May 6, 2024
1690d88
reuse ops_test.model
cbartz May 6, 2024
3fe6895
enable integration tests
cbartz May 6, 2024
9c08ba6
deploy latest grafana agent
cbartz May 6, 2024
9952f88
request openstack_connection dynamically
cbartz May 6, 2024
5bcdecb
fix test_charm_issues_runner_installed_metric
cbartz May 6, 2024
bedabe6
revert outcommenting of proxy settings
cbartz May 6, 2024
9357f93
add instance helper fixture
cbartz May 6, 2024
950200e
lint and refactor
cbartz May 7, 2024
aad16ea
lint
cbartz May 7, 2024
0a2c85c
outcomment integration test
cbartz May 7, 2024
0bee459
fix refactor
cbartz May 7, 2024
fa158fc
add sleep
cbartz May 7, 2024
2725966
revert comment
cbartz May 7, 2024
336b18b
add explanatory comment
cbartz May 8, 2024
4be2932
fix trailing ws
cbartz May 8, 2024
a0795c6
Add more context to metrics pull errors
cbartz May 8, 2024
b0776c4
add explanatory comment
cbartz May 8, 2024
bd4f83e
add more explanations to --use-existing-app config
cbartz May 8, 2024
e95d1da
use > instead of >> in start_test_http_server
cbartz May 8, 2024
9e9b206
use wait_for in start_test_http_server
cbartz May 8, 2024
ee5128c
Add some unit test for openstack manager
yhaliaw May 9, 2024
16a1f9c
Merge branch 'feat/openstack-integration' into test/openstack-integra…
yhaliaw May 13, 2024
e24590f
Fix unit test bug
yhaliaw May 13, 2024
e46ad4c
Improve test coverage
yhaliaw May 21, 2024
b20e54f
Merge branch 'feat/openstack-integration' into test/openstack-integra…
yhaliaw May 21, 2024
d733eca
sign commits
yanksyoon May 29, 2024
fdd2e12
Merge branch 'feat/openstack-integration' into feat/private-endpoint
yanksyoon May 29, 2024
81460bb
remove duplicate option
yanksyoon May 29, 2024
b70e2d7
openstack username creds option name
yanksyoon May 29, 2024
a6a27d7
remove unsupported cores constraint
yanksyoon May 29, 2024
015e5cb
add base
yanksyoon May 29, 2024
bc7d1cd
setup lxd cloud
yanksyoon May 29, 2024
f3cec4b
add proxy args
yanksyoon May 29, 2024
e8240aa
use private endpoint clouds yaml
yanksyoon May 29, 2024
4ab0baf
no proxy to openstack svcs
yanksyoon May 30, 2024
7b13f98
Merge branch 'test/openstack-integration' into feat/private-endpoint
yhaliaw Jun 4, 2024
db39682
Merge branch 'feat/openstack-integration' into feat/private-endpoint
yhaliaw Jun 4, 2024
e62cbf7
Test
yhaliaw Jun 5, 2024
a9a50ce
Testing integration tests
yhaliaw Jun 5, 2024
b36ba3d
Test
yhaliaw Jun 5, 2024
471076d
[Test] Fix flush runner
yhaliaw Jun 5, 2024
bbf4ab1
Fix test message
yhaliaw Jun 5, 2024
3a8d8dd
Add more integration test
yhaliaw Jun 6, 2024
3100f36
Test fork repo integration test
yhaliaw Jun 6, 2024
d6cc6fc
Test integration tests
yhaliaw Jun 6, 2024
9b98071
Test e2e
yhaliaw Jun 6, 2024
bef7ef7
Test
yhaliaw Jun 6, 2024
342393e
Disable tmate
yhaliaw Jun 6, 2024
30cda17
Test
yhaliaw Jun 7, 2024
77c92a2
Merge branch 'feat/openstack-integration' into feat/private-endpoint
yhaliaw Jun 11, 2024
ffcb056
Use amd64 for integration tests
yhaliaw Jun 12, 2024
eb987bb
Increase timeout
yhaliaw Jun 12, 2024
12edfff
Test
yhaliaw Jun 12, 2024
41b7928
Test
yhaliaw Jun 13, 2024
21afb7a
Test e2e
yhaliaw Jun 13, 2024
8f0d65d
Test metric test without grafana
yhaliaw Jun 13, 2024
27f8c00
Test everything
yhaliaw Jun 13, 2024
26eb59e
test
yhaliaw Jun 14, 2024
fa04e5a
Trigger test
yhaliaw Jun 16, 2024
ace9f4f
Refactor integration test
yhaliaw Jun 17, 2024
1f39561
Test with pytest.mark
yhaliaw Jun 17, 2024
be7740f
Fix missing import
yhaliaw Jun 17, 2024
aa15c33
Fix types
yhaliaw Jun 17, 2024
8dd9aba
Fix missing awiat
yhaliaw Jun 17, 2024
b238c28
Fix workflow inputs.
yhaliaw Jun 17, 2024
7973d74
Merge branch 'feat/openstack-integration' into feat/private-endpoint
yhaliaw Jun 17, 2024
3eb732a
Format
yhaliaw Jun 17, 2024
b10d1d9
Test metric tests
yhaliaw Jun 17, 2024
1dd2ddc
Fix one unit test
yhaliaw Jun 18, 2024
c656ca4
Add openstack e2e test
yhaliaw Jun 18, 2024
84ff223
Test
yhaliaw Jun 18, 2024
d5c5b0e
Update openstack e2e name
yhaliaw Jun 18, 2024
142ab9d
Debug info for workflow dispatch
yhaliaw Jun 19, 2024
605d49e
Test using main repo for integration tests
yhaliaw Jun 19, 2024
5be32a9
Update e2e test to share between openstack and LXD
yhaliaw Jun 19, 2024
5868982
Updated the metric failure test
yhaliaw Jun 19, 2024
0f409fd
Update metrics failure
yhaliaw Jun 19, 2024
140a3f5
Test metric_log message
yhaliaw Jun 20, 2024
0b94526
Debug
yhaliaw Jun 20, 2024
2468fc0
Remove code check
yhaliaw Jun 20, 2024
d7c3617
Debug
yhaliaw Jun 20, 2024
4ef3233
Test repo policy check failure
yhaliaw Jun 21, 2024
6c8fd50
Test all openstack integration test again
yhaliaw Jun 21, 2024
489f3bc
test only the mertic failure
yhaliaw Jun 21, 2024
080c938
Test SSH remote forwarding
yhaliaw Jun 24, 2024
3e51618
Test install repo policy in runner
yhaliaw Jun 24, 2024
bab6405
Fix import error
yhaliaw Jun 24, 2024
243f98a
Print debugging info
yhaliaw Jun 24, 2024
b13d8f9
Fix assertion
yhaliaw Jun 24, 2024
389ca52
Try tee multiline write
yhaliaw Jun 24, 2024
7510609
Fix multiline write
yhaliaw Jun 24, 2024
d0341b1
Debug print
yhaliaw Jun 24, 2024
2c04110
Debug print
yhaliaw Jun 24, 2024
b675165
Fix debug print
yhaliaw Jun 24, 2024
9d31c23
Install gunicorn as root
yhaliaw Jun 24, 2024
ecf795c
Fix ready check
yhaliaw Jun 24, 2024
5afb989
Use forked repo
yhaliaw Jun 24, 2024
242cd84
Fix wrong repo
yhaliaw Jun 24, 2024
de639fe
Make repo policy fail
yhaliaw Jun 24, 2024
773c086
Use main repo
yhaliaw Jun 25, 2024
dd429b2
Revert "Use main repo"
yhaliaw Jun 25, 2024
8e8e897
Use main repo for tests
yhaliaw Jun 25, 2024
511b9cf
Fix workflow success
yhaliaw Jun 25, 2024
0dfeca6
Test out expose port approach
yhaliaw Jun 25, 2024
1f2769c
Use asyncio to spawn coro
yhaliaw Jun 25, 2024
a86c2ba
Fix IP
yhaliaw Jun 25, 2024
52920ac
Use test repo
yhaliaw Jun 25, 2024
c630c26
Test success as well
yhaliaw Jun 25, 2024
89cb897
Merge branch 'feat/openstack-integration' into feat/private-endpoint
yhaliaw Jun 26, 2024
ccf7609
Trigger test after merge
yhaliaw Jun 26, 2024
e75d692
Remove old test
yhaliaw Jun 26, 2024
de13e4f
Fix unit test
yhaliaw Jun 26, 2024
0d46baf
Fix unit test and lint
yhaliaw Jun 26, 2024
582a2c8
Add back missing test option
yhaliaw Jun 26, 2024
2e107a8
Merge branch 'feat/openstack-integration' into feat/private-endpoint
yhaliaw Jun 26, 2024
74d11b2
Fix runner issue
yhaliaw Jun 26, 2024
6773067
Test only the failure test
yhaliaw Jun 26, 2024
06eca10
Increase sleep
yhaliaw Jun 26, 2024
9d00dea
Remove repo-policy for next test
yhaliaw Jun 26, 2024
a83c42d
Re-enable all workflows
yhaliaw Jun 26, 2024
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
5 changes: 2 additions & 3 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: End-to-End Test

on:
# TODO: Re-enable
# pull_request:
workflow_dispatch:
pull_request:

jobs:
build-charm:
Expand Down Expand Up @@ -454,6 +452,7 @@ jobs:
uses: ./.github/workflows/e2e_test_run.yaml
with:
runner-tag: "pr-${{ needs.run-id.outputs.run-id }}${{ github.run_attempt}}"
runner-virt-type: "lxd"

required_status_checks:
name: Required E2E Test Status Checks
Expand Down
462 changes: 0 additions & 462 deletions .github/workflows/e2e_test_openstack.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/e2e_test_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,25 @@ on:
description: The e2e test runner tag to run the workflow on.
type: string
required: true
runner-virt-type:
description: The e2e test runner virtualization type. E.g. lxd, or openstack.
# workflow_call does not support choice type.
type: string
required: true
workflow_dispatch:
inputs:
runner-tag:
description: The e2e test runner tag to run the workflow on.
type: string
required: true
runner-virt-type:
description: The e2e test runner virtualization type.
type: choice
required: true
options:
- lxd
- openstack

jobs:
e2e-test:
name: End-to-End Test Run
Expand Down Expand Up @@ -89,8 +102,10 @@ jobs:
- name: test check-jsonschema
run: check-jsonschema --version
- name: Test Firewall
if: "${{ github.event.inputs.runner-virt-type == 'lxd' }}"
run: |
HOST_IP=$(ip route | grep default | cut -f 3 -d" ")
[ $((ping $HOST_IP -c 5 || :) | grep "Destination Port Unreachable" | wc -l) -eq 5 ]
- name: Test sctp support
if: "${{ github.event.inputs.runner-virt-type == 'lxd' }}"
run: sudo apt-get install lksctp-tools -yq && checksctp
19 changes: 15 additions & 4 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: integration-tests

on:
# TODO: Re-enable
# pull_request:
workflow_dispatch:
pull_request:

jobs:
# test option values defined at test/conftest.py are passed on via repository secret
Expand All @@ -27,4 +25,17 @@ jobs:
pre-run-script: scripts/pre-integration-test.sh
provider: lxd
test-tox-env: integration-juju3.1
modules: '["test_charm_base_image", "test_charm_fork_repo", "test_charm_no_runner", "test_charm_scheduled_events", "test_charm_one_runner", "test_charm_metrics_success", "test_charm_metrics_failure", "test_self_hosted_runner", "test_charm_with_proxy", "test_charm_with_juju_storage", "test_debug_ssh", "test_charm_upgrade"]'
modules: '["test_charm_base_image", "test_charm_fork_repo", "test_charm_no_runner", "test_charm_scheduled_events", "test_charm_one_runner", "test_charm_metrics_success", "test_charm_metrics_failure", "test_self_hosted_runner", "test_charm_with_proxy", "test_charm_with_juju_storage", "test_debug_ssh", "test_charm_upgrade"]'
openstack-integration-tests-private-endpoint:
name: Integration test using private-endpoint
uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
secrets: inherit
with:
juju-channel: 3.2/stable
pre-run-script: scripts/setup-lxd.sh
provider: lxd
test-tox-env: integration-juju3.2
modules: '["test_charm_metrics_failure", "test_charm_metrics_success", "test_charm_fork_repo", "test_charm_runner", "test_e2e"]'
extra-arguments: "-m openstack --openstack-flavor-name=builder-cpu4-ram8-disk50 --http-proxy=http://squid.internal:3128 --https-proxy=http://squid.internal:3128 --no-proxy=keystone.ps6.canonical.com,glance.ps6.canonical.com,nova.ps6.canonical.com,neutron.ps6.canonical.com"
self-hosted-runner: true
self-hosted-runner-label: stg-private-endpoint
24 changes: 0 additions & 24 deletions .github/workflows/manual_test_env.yaml

This file was deleted.

4 changes: 1 addition & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Tests

on:
# TODO: Re-enable
# pull_request:
workflow_dispatch:
pull_request:

jobs:
unit-tests:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ omit = [
"src/repo_policy_compliance_client.py",
# 2024/04/17: These files are pending a major refactor. The refactor includes a RunnerManager
# interface class which will include a complete re-organization of the code in these files.
"src/openstack_cloud/openstack_manager.py",
"src/runner.py",
"src/runner_manager.py",
]
Expand Down
8 changes: 8 additions & 0 deletions scripts/setup-lxd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

# Script to setup LXD for testing

juju bootstrap localhost lxd
36 changes: 18 additions & 18 deletions src-docs/charm_state.py.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ State of the Charm.

---

<a href="../src/charm_state.py#L117"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L121"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `parse_github_path`

Expand Down Expand Up @@ -137,7 +137,7 @@ Some charm configurations are grouped into other configuration models.

---

<a href="../src/charm_state.py#L450"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L454"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `check_reconcile_interval`

Expand Down Expand Up @@ -166,7 +166,7 @@ Validate the general charm configuration.

---

<a href="../src/charm_state.py#L477"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L481"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `from_charm`

Expand Down Expand Up @@ -205,7 +205,7 @@ Raised when charm config is invalid.

- <b>`msg`</b>: Explanation of the error.

<a href="../src/charm_state.py#L241"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L245"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down Expand Up @@ -247,7 +247,7 @@ The charm state.

---

<a href="../src/charm_state.py#L1038"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L1042"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `from_charm`

Expand Down Expand Up @@ -292,7 +292,7 @@ Charm configuration related to GitHub.

---

<a href="../src/charm_state.py#L153"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L157"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `from_charm`

Expand Down Expand Up @@ -337,7 +337,7 @@ Represent GitHub organization.

---

<a href="../src/charm_state.py#L105"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L109"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `path`

Expand Down Expand Up @@ -370,7 +370,7 @@ Represent GitHub repository.

---

<a href="../src/charm_state.py#L84"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L88"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `path`

Expand All @@ -391,7 +391,7 @@ Return a string representing the path.
## <kbd>class</kbd> `ImmutableConfigChangedError`
Represents an error when changing immutable charm state.

<a href="../src/charm_state.py#L938"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L942"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down Expand Up @@ -446,7 +446,7 @@ Runner configurations for local LXD instances.

---

<a href="../src/charm_state.py#L712"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L716"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `check_virtual_machine_resources`

Expand Down Expand Up @@ -477,7 +477,7 @@ Validate the virtual_machine_resources field values.

---

<a href="../src/charm_state.py#L690"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L694"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `check_virtual_machines`

Expand Down Expand Up @@ -506,7 +506,7 @@ Validate the virtual machines configuration value.

---

<a href="../src/charm_state.py#L638"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L642"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `from_charm`

Expand Down Expand Up @@ -553,7 +553,7 @@ Runner configuration for OpenStack Instances.

---

<a href="../src/charm_state.py#L587"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L591"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `from_charm`

Expand Down Expand Up @@ -607,7 +607,7 @@ Return the aproxy address.

---

<a href="../src/charm_state.py#L782"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L786"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `check_use_aproxy`

Expand Down Expand Up @@ -637,7 +637,7 @@ Validate the proxy configuration.

---

<a href="../src/charm_state.py#L810"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L814"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `from_charm`

Expand Down Expand Up @@ -676,7 +676,7 @@ Configuration for the repo policy compliance service.

---

<a href="../src/charm_state.py#L308"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L312"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `from_charm`

Expand Down Expand Up @@ -739,7 +739,7 @@ SSH connection information for debug workflow.

---

<a href="../src/charm_state.py#L896"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L900"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>classmethod</kbd> `from_charm`

Expand Down Expand Up @@ -772,7 +772,7 @@ Raised when given machine charm architecture is unsupported.

- <b>`arch`</b>: The current machine architecture.

<a href="../src/charm_state.py#L853"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/charm_state.py#L857"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>function</kbd> `__init__`

Expand Down
4 changes: 4 additions & 0 deletions src/charm_state.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.

# 2024/06/26 The charm contains a lot of states and configuration. The upcoming refactor will
# split each/related class to a file.
# pylint: disable=too-many-lines

"""State of the Charm."""

import dataclasses
Expand Down
2 changes: 1 addition & 1 deletion src/openstack_cloud/openstack_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def _get_ssh_connection(
An SSH connection to OpenStack server instance.
"""
server: Server | None = conn.get_server(name_or_id=server_name)
if not server:
if server is None:
raise _SSHError(f"Server gone while trying to get SSH connection: {server_name}.")
if not server.key_name:
raise _SSHError(
Expand Down
9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,44 +71,53 @@ def pytest_addoption(parser: Parser):
"--openstack-network-name",
action="store",
help="The Openstack network to create testing instances under.",
default=None,
)
parser.addoption(
"--openstack-flavor-name",
action="store",
help="The Openstack flavor to create testing instances with.",
default=None,
)
parser.addoption(
"--openstack-auth-url",
action="store",
help="The URL to Openstack authentication service, i.e. keystone.",
default=None,
)
parser.addoption(
"--openstack-password",
action="store",
help="The password to authenticate to Openstack service.",
default=None,
)
parser.addoption(
"--openstack-project-domain-name",
action="store",
help="The Openstack project domain name to use.",
default=None,
)
parser.addoption(
"--openstack-project-name",
action="store",
help="The Openstack project name to use.",
default=None,
)
parser.addoption(
"--openstack-user-domain-name",
action="store",
help="The Openstack user domain name to use.",
default=None,
)
parser.addoption(
"--openstack-username",
action="store",
help="The Openstack user to authenticate as.",
default=None,
)
parser.addoption(
"--openstack-region-name",
action="store",
help="The Openstack region to authenticate to.",
default=None,
)
Loading
Loading