Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

chore: fix CI pipeline #26

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 20 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,16 @@ jobs:

integration-test:
strategy:
fail-fast: true
fail-fast: false
matrix:
bases:
bases:
- [email protected]
name: Integration tests (LXD) | ${{ matrix.bases }}
local: [true, false]
name: Integration tests (LXD) ${{ matrix.local && '|' || '| Charmhub (edge) |'}} ${{ matrix.bases }}
runs-on: ubuntu-latest
# Testing against Charmhub will probably yield errors when doing breaking changes, so don't
# block CI on that.
continue-on-error: ${{ !matrix.local }}
needs:
- inclusive-naming-check
- lint
Expand All @@ -78,10 +82,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: main
- name: Fetch slurmctld
uses: actions/checkout@v4
if: ${{ matrix.local }}
with:
repository: charmed-hpc/slurmctld-operator
path: slurmctld-operator
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3.1/stable
juju-channel: 3.4/stable
- name: Run tests
run: tox run -e integration -- --charm-base=${{ matrix.bases }}
run: |
cd main && tox run -e integration -- \
--charm-base=${{ matrix.bases }} \
${{ matrix.local && '--use-local' || '' }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Select charmhub channel
uses: canonical/charming-actions/channel@2.2.0
uses: canonical/charming-actions/channel@2.5.0-rc
id: channel
- name: Upload charm to charmhub
uses: canonical/charming-actions/upload-charm@2.2.0
uses: canonical/charming-actions/upload-charm@2.5.0-rc
with:
credentials: "${{ secrets.CHARMCRAFT_AUTH }}"
github-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down
7 changes: 6 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ def _on_slurmctld_available(self, event: SlurmctldAvailableEvent) -> None:
self._slurmdbd_ops_manager.write_munge_key(munge_key)
self._slurmdbd_ops_manager.start_munge()

self._write_config_and_restart_slurmdbd(event)
# Don't try to write the config before the database has been created.
# Otherwise, this will trigger a defer on this event, which we don't really need
# or the munge service will restart too many times, triggering a restart limit on
# systemctl.
if self._stored.db_info:
self._write_config_and_restart_slurmdbd(event)

def _on_database_created(self, event: DatabaseCreatedEvent) -> None:
"""Process the DatabaseCreatedEvent and updates the database parameters.
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def test_build_and_deploy_against_edge(
),
)
# Set relations for charmed applications.
await ops_test.model.integrate(f"{SLURMDBD}:{SLURMDBD}", f"{SLURMCTLD}:{SLURMDBD}")
await ops_test.model.integrate(f"{SLURMDBD}:{SLURMCTLD}", f"{SLURMCTLD}:{SLURMDBD}")
await ops_test.model.integrate(f"{ROUTER}:backend-database", f"{DATABASE}:database")
await ops_test.model.integrate(f"{SLURMDBD}:database", f"{ROUTER}:database")
# Reduce the update status frequency to accelerate the triggering of deferred events.
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env_list = lint, type, unit
[vars]
src_path = {toxinidir}/src
tst_path = {toxinidir}/tests
all_path = {[vars]src_path} {[vars]tst_path}
all_path = {[vars]src_path} {[vars]tst_path}

[testenv]
setenv =
Expand Down