Skip to content

Commit

Permalink
merge main & resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
yanksyoon committed Aug 26, 2024
2 parents b0809ee + 789b3a1 commit 7e87389
Show file tree
Hide file tree
Showing 31 changed files with 3,216 additions and 154 deletions.
1 change: 1 addition & 0 deletions .github/workflows/e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: End-to-End tests

on:
pull_request:


jobs:
# test option values defined at test/conftest.py are passed on via repository secret
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/e2e_test_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
name: End-to-End Test Run
runs-on: [self-hosted, linux, "${{ inputs.runner-tag }}"]
steps:
- name: Hostname is set to "github-runner"
run: sudo hostnamectl hostname | grep github-runner
# Snapd can have some issues in privileged LXD containers without setting
# security.nesting=True and this.
- name: Fix snap issue in privileged LXD containers
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,28 @@ jobs:
# # test_debug_ssh ensures tmate SSH actions works.
# # TODO: Add OpenStack integration versions of these tests.
# modules: '["test_charm_scheduled_events", "test_debug_ssh"]'
# openstack-integration-tests-private-endpoint-amd64:
# name: Integration test using private-endpoint(AMD64)
# openstack-interface-tests-private-endpoint:
# name: openstack interface 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_runner_manager_openstack"]'
# self-hosted-runner: true
# self-hosted-runner-label: stg-private-endpoint
# openstack-integration-tests-private-endpoint:
# name: Integration test using private-endpoint
# uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main
# needs: openstack-interface-tests-private-endpoint
# 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_reactive"]'
# extra-arguments: "-m openstack"
# self-hosted-runner: true
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ skips = ["*/*test.py", "*/test_*.py", "*tests/*.py"]
[tool.coverage.run]
branch = true
omit = [
# These are covered by `tests/integration/test_runner_manager_openstack.py`.
"src/openstack_cloud/openstack_cloud.py",
"src/openstack_cloud/openstack_runner_manager.py",
# Contains interface for calling LXD. Tested in integration tests and end to end tests.
"src/lxd.py",
# Contains interface for calling repo policy compliance service. Tested in integration test
Expand Down Expand Up @@ -54,9 +57,9 @@ max-doc-length = 99
max-complexity = 10
exclude = [".git", "__pycache__", ".tox", "build", "dist", "*.egg_info", "venv"]
select = ["E", "W", "F", "C", "N", "R", "D", "H"]
# Ignore W503, E501 because using black creates errors with this
# Ignore W503, E501, E203 because using black creates errors with this
# Ignore D107 Missing docstring in __init__
ignore = ["W503", "E501", "D107"]
ignore = ["W503", "E501", "D107", "E203"]
# D100, D101, D102, D103, D104: Ignore docstring style issues in tests
# temporary disable E402 for the fix in charm.py for lp:2058335
per-file-ignores = ["src/charm.py:E402", "tests/*:D100,D101,D102,D103,D104,D205,D212"]
Expand Down
22 changes: 22 additions & 0 deletions src-docs/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,25 @@ Represents an unauthorized connection to OpenStack.



---

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

## <kbd>class</kbd> `SSHError`
Represents an error while interacting with SSH.





---

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

## <kbd>class</kbd> `KeyfileError`
Represents missing keyfile for SSH.





32 changes: 32 additions & 0 deletions src-docs/managed_requests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- markdownlint-disable -->

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

# <kbd>module</kbd> `managed_requests`
Get configured requests session instance


---

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

## <kbd>function</kbd> `get_requests_session`

```python
get_requests_session(proxy: ProxyConfig) → Session
```

Get managed requests session instance.



**Args:**

- <b>`proxy`</b>: HTTP proxy configurations.



**Returns:**
Requests session with proxy and retry setup.


8 changes: 5 additions & 3 deletions src-docs/metrics.runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Classes and function to extract the metrics from storage and issue runner metric
```python
extract(
metrics_storage_manager: StorageManager,
ignore_runners: set[str]
runners: set[str],
include: bool = False
) → Iterator[RunnerMetrics]
```

Expand All @@ -38,7 +39,8 @@ In order to avoid DoS attacks, the file size is also checked.
**Args:**

- <b>`metrics_storage_manager`</b>: The metrics storage manager.
- <b>`ignore_runners`</b>: The set of runners to ignore.
- <b>`runners`</b>: The runners to include or exclude.
- <b>`include`</b>: If true the provided runners are included for metric extraction, else the provided runners are excluded.



Expand All @@ -48,7 +50,7 @@ In order to avoid DoS attacks, the file size is also checked.

---

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

## <kbd>function</kbd> `issue_events`

Expand Down
Loading

0 comments on commit 7e87389

Please sign in to comment.