Skip to content

Commit

Permalink
fix(ci): functional test fix
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
matthew-hagemann committed Oct 11, 2023
1 parent d59e916 commit 6b022cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
name: Functional tests
runs-on: ubuntu-latest
needs:
- lib-check
- unit-test
- lint
steps:
Expand All @@ -45,7 +44,9 @@ jobs:
- name: Setup LXD
uses: canonical/setup-lxd@4e959f8e0d9c5feb27d44c5e4d9a330a782edee0
- name: Run tests
run: tox -e functional
run: |
cd vm_operator
tox -e functional
integration-test:
name: Integration tests
Expand Down
14 changes: 2 additions & 12 deletions vm_operator/tests/functional/test_ratings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,19 @@ def test_remove(self):

@mock.patch("charms.operator_libs_linux.v1.snap.Snap.restart")
def test_configure_ratings(self, _restart):
# Test set to snap defaults
self.assertEqual(self.ratings._snap.get("app-jwt-secret"), "deadbeef")
self.assertEqual(self.ratings._snap.get("app-log-level"), "info")
self.assertEqual(
self.ratings._snap.get("app-migration-postgres-uri"),
"postgresql://migration_user:strongpassword@localhost:5433/ratings",
)
self.assertEqual(
self.ratings._snap.get("app-postgres-uri"),
"postgresql://service:covfefe!1@localhost:5433/ratings",
)

self.ratings.configure(
jwt_secret="foo",
log_level="bar",
postgres_uri="foobar",
migration_postgres_uri="barfoo",
env="testenv"
)

# Test have been updated
self.assertEqual(self.ratings._snap.get("app-jwt-secret"), "foo")
self.assertEqual(self.ratings._snap.get("app-log-level"), "bar")
self.assertEqual(self.ratings._snap.get("app-migration-postgres-uri"), "barfoo")
self.assertEqual(self.ratings._snap.get("app-postgres-uri"), "foobar")
self.assertEqual(self.ratings._snap.get("app-env"), "testenv")

_restart.assert_called_once()

0 comments on commit 6b022cf

Please sign in to comment.