Skip to content

Commit

Permalink
[DPE-3292] test mongos relation (#341)
Browse files Browse the repository at this point in the history
## Issue
Validation of mongos/cluster relation doesn't exist

## Solution
Test that relation does what its supposed to do i.e. user creation /
removal

## Files to not review
Feel free to ignore the test charm we copied over to
`tests/integration/sharding_tests/application/`, this should be removed
in the futre

## Future work
Ideally we can deploy a "Test Charm" for mongos to be hosted on instead
of this current charm that we have copied over
`tests/integration/sharding_tests/application/`. We can either:
1. test with `data-integrator` when it works with `mongos`
2. publish a [test-charm](https://charmhub.io/mysql-test-app) and deploy
it in the tests
  • Loading branch information
MiaAltieri authored Jan 26, 2024
1 parent 3652eed commit cf191c9
Show file tree
Hide file tree
Showing 19 changed files with 2,898 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ jobs:
- metric-integration
- sharding-integration
- sharding-relation-integration
- sharding-race-conditions-integration
- sharding-mongos-integration
name: ${{ matrix.tox-environments }}
needs:
- lint
Expand Down
1 change: 1 addition & 0 deletions lib/charms/mongodb/v0/mongodb.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Code for interactions with MongoDB."""

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

Expand Down
1 change: 1 addition & 0 deletions lib/charms/mongodb/v0/mongodb_secrets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Secrets related helper classes/functions."""

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

Expand Down
1 change: 1 addition & 0 deletions lib/charms/mongodb/v1/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Simple functions, which can be used in both K8s and VM charms."""

# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
import json
Expand Down
1 change: 1 addition & 0 deletions lib/charms/mongodb/v1/mongos.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Code for interactions with MongoDB."""

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

Expand Down
1 change: 1 addition & 0 deletions lib/charms/mongodb/v1/users.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Users configuration for MongoDB."""

# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
from typing import Set
Expand Down
1 change: 1 addition & 0 deletions src/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration for MongoDB Charm."""

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

Expand Down
1 change: 1 addition & 0 deletions src/machine_helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Machine Charm specific functions for operating MongoDB."""

# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
import logging
Expand Down
11 changes: 11 additions & 0 deletions tests/integration/sharding_tests/application/charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.

type: charm
bases:
- build-on:
- name: "ubuntu"
channel: "22.04"
run-on:
- name: "ubuntu"
channel: "22.04"
Loading

0 comments on commit cf191c9

Please sign in to comment.