Skip to content

Commit

Permalink
Merge branch 'main' into fix-emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer authored May 16, 2024
2 parents 2f6b819 + 9bc1f17 commit d27c299
Show file tree
Hide file tree
Showing 17 changed files with 1,777 additions and 1,566 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/charmcraft-pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

steps:
- name: Checkout test charm repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: jnsgruk/hello-kubecon

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/db-charm-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:

steps:
- name: Checkout the ${{ matrix.charm-repo }} repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ matrix.charm-repo }}

- name: Checkout the operator repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: myops

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/framework-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
Expand All @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5

Expand All @@ -43,7 +43,7 @@ jobs:
- {python-version: "3.8", os: "macos-latest"} # macos-14 is arm64, and there's no Python 3.8 build for arm64

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -64,14 +64,14 @@ jobs:
python-version: ["3.8", "3.10"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Go 1.20
uses: actions/setup-go@v1
uses: actions/setup-go@v5
with:
go-version: "1.20"

Expand Down Expand Up @@ -103,9 +103,10 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- {python-version: "3.8", os: "macos-latest"} # macos-14 is arm64, and there's no Python 3.8 build for arm64
- {python-version: "3.9", os: "macos-latest"} # macos-14 is arm64, and there's no Python 3.9 build for arm64

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hello-charm-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: "3.8"

- name: Checkout the ${{ matrix.charm-repo }} repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ matrix.charm-repo }}

Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/observability-charm-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ jobs:
fail-fast: false
matrix:
charm-repo:
# Disabled until the type checking passes (ops#1183)
# https://github.com/canonical/alertmanager-k8s-operator/pull/241
# https://github.com/canonical/prometheus-k8s-operator/pull/587
# - "canonical/alertmanager-k8s-operator"
# - "canonical/prometheus-k8s-operator"
- "canonical/alertmanager-k8s-operator"
- "canonical/prometheus-k8s-operator"
- "canonical/grafana-k8s-operator"

steps:
- name: Checkout the ${{ matrix.charm-repo }} repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ matrix.charm-repo }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id-token: write
needs: [framework-tests, observability-charm-tests, hello-charm-tests]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install build dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
id-token: write
needs: [framework-tests, observability-charm-tests, hello-charm-tests]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down
22 changes: 22 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# 2.13.0 - 30 Apr 2024

## Features

* Added support for user secrets in Harness (#1176)

## Fixes

* Corrected the model config types (#1183)
* In Harness, only inspect the source file if it will be used - this fixed using Harness in a Python REPL (#1181)

## Documentation

* Updated publishing a release in HACKING.md (#1173)
* Added `tox -e docs-deps` to compile requirements.txt (#1172)
* Updated doc to note deprecated functionality in (#1178)

## Tests

* First stage of converting tests from unittest to pytest (#1191, #1192, #1196, #1193, #1195)
* Added `pebble.CheckInfo.change_id` field (#1197)

# 2.12.0 - 28 Mar 2024

## Features
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
jinja2==3.1.3
jinja2==3.1.4
# via
# myst-parser
# sphinx
Expand Down
5 changes: 5 additions & 0 deletions ops/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ def __init__(self, message: str, output: ActionOutput):
self.message = message
self.output = output

def __str__(self):
if self.message:
return self.message
return "Event handler called `fail()` with no additional details."


@dataclasses.dataclass()
class _RunningAction:
Expand Down
2 changes: 1 addition & 1 deletion ops/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
This module is NOT to be used when developing charms using ops.
"""

version: str = '2.13.0.dev0'
version: str = '2.13.0'
35 changes: 0 additions & 35 deletions test/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,38 +201,3 @@ def test_fake_script_clear(self):
assert fake_script_calls(self, clear=True) == [['bar', 'd e', 'f']]

assert fake_script_calls(self, clear=True) == []


class BaseTestCase(unittest.TestCase):

def create_framework(self,
*,
model: typing.Optional[ops.Model] = None,
tmpdir: typing.Optional[pathlib.Path] = None):
"""Create a Framework object.
By default operate in-memory; pass a temporary directory via the 'tmpdir'
parameter if you wish to instantiate several frameworks sharing the
same dir (e.g. for storing state).
"""
if tmpdir is None:
data_fpath = ":memory:"
charm_dir = 'non-existant'
else:
data_fpath = tmpdir / "framework.data"
charm_dir = tmpdir

framework = ops.Framework(
SQLiteStorage(data_fpath),
charm_dir,
meta=model._cache._meta if model else ops.CharmMeta(),
model=model) # type: ignore
self.addCleanup(framework.close)
return framework

def create_model(self):
"""Create a Model object."""
backend = _ModelBackend(unit_name='myapp/0')
meta = ops.CharmMeta()
model = ops.Model(meta, backend)
return model
Loading

0 comments on commit d27c299

Please sign in to comment.