Skip to content

Commit

Permalink
fix: correct default series selection
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaqq committed Nov 15, 2024
1 parent 62585d2 commit 883012f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ jobs:
- "3.11"
- "3.12"
- "3.13"
- "3.14.0-alpha.1"
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Install dependencies
run: pip install tox
- name: Run unit tests
Expand All @@ -84,12 +86,7 @@ jobs:
- "3.3/stable"
- "3.4/stable"
- "3.5/stable"
# A bunch of tests fail with juju.errors.JujuError: base: [email protected]/stable
# * test_subordinate_units
# * test_destroy_unit
# * test_ssh
# * ...
# - "3.6/beta"
- "3.6/candidate"
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down Expand Up @@ -149,6 +146,7 @@ jobs:
- "3.3/stable"
- "3.4/stable"
- "3.5/stable"
- "3.6/candidate"
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion juju/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ def series_for_charm(requested_series, supported_series):

# use the charm default
if requested_series == "":
return supported_series[-1]
return supported_series[0]

for s in supported_series:
if requested_series == s:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_model_config(self):
)

def test_charm_list_series(self):
assert series_selector(supported_series=["focal", "jammy"]) == "jammy"
assert series_selector(supported_series=["jammy", "focal"]) == "jammy"

def test_return_lts(self):
assert series_selector() == DEFAULT_SUPPORTED_LTS
Expand Down

0 comments on commit 883012f

Please sign in to comment.