From de546ee281fb4b61ad15e2713ae9092ed4f50efd Mon Sep 17 00:00:00 2001 From: Jordan Barrett Date: Tue, 17 Oct 2023 14:31:45 +0700 Subject: [PATCH 1/2] set_leader in test_website_relation_joined --- tests/test_charm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_charm.py b/tests/test_charm.py index 6b03344..8b46f18 100644 --- a/tests/test_charm.py +++ b/tests/test_charm.py @@ -42,6 +42,7 @@ def test_website_relation_joined(self, open, ingress_address): harness = Harness(JujuControllerCharm) self.addCleanup(harness.cleanup) harness.begin() + harness.set_leader() relation_id = harness.add_relation('website', 'haproxy') harness.add_relation_unit(relation_id, 'haproxy/0') From 8635243aaa49a55822137cf5d01b67b7e311ee78 Mon Sep 17 00:00:00 2001 From: Jordan Barrett Date: Tue, 17 Oct 2023 14:42:14 +0700 Subject: [PATCH 2/2] run unit tests in CI --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3aa004..64d7d1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,29 @@ on: jobs: + unit-tests: + name: Unit tests + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + + - name: Install dependencies for testing + run: | + pip install -r requirements-dev.txt + + - name: Run tests + run: | + ./run_tests + + build: name: Build charms + needs: unit-tests uses: canonical/data-platform-workflows/.github/workflows/build_charms_with_cache.yaml@v4 with: artifact-name: charm-packed