From 66200abcd0102e41148e41877e38a9a1a691e6ba Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Fri, 8 Sep 2023 15:40:41 +0000 Subject: [PATCH 1/7] ci: update juju to 3.1 and microk8s to 1.25 --- .github/workflows/integrate.yaml | 6 ++--- requirements-integration.in | 4 ++-- requirements-integration.txt | 39 +++++++++++++++----------------- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index ec1e8d2..22e7fd5 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -54,13 +54,13 @@ jobs: uses: charmed-kubernetes/actions-operator@main with: provider: microk8s - channel: 1.24/stable - juju-channel: 2.9/stable + channel: 1.25-strict/stable + juju-channel: 3.1/stable charmcraft-channel: latest/candidate - name: Run test run: | - sg microk8s -c "tox -e integration -- --model testing" + sg snap_microk8s -c "tox -e integration -- --model testing" - name: Get all run: kubectl get all -A diff --git a/requirements-integration.in b/requirements-integration.in index 09dc4b1..0c30fc6 100644 --- a/requirements-integration.in +++ b/requirements-integration.in @@ -1,7 +1,7 @@ aiohttp jinja2 -# Pinning to <3.0 due to compatibility with the 2.9 controller version and 3.0 not being maintained anymore -juju<3.0 +# Pinning to <4.0 due to compatibility with the 3.1 controller version +juju<4.0 lightkube pytest-operator requests diff --git a/requirements-integration.txt b/requirements-integration.txt index 846a36c..7b0cb8b 100644 --- a/requirements-integration.txt +++ b/requirements-integration.txt @@ -8,9 +8,9 @@ aiohttp==3.8.5 # via -r requirements-integration.in aiosignal==1.3.1 # via aiohttp -anyio==3.7.1 +anyio==4.0.0 # via httpcore -asttokens==2.2.1 +asttokens==2.4.0 # via stack-data async-timeout==4.0.3 # via aiohttp @@ -42,7 +42,7 @@ decorator==5.1.1 # via # ipdb # ipython -exceptiongroup==1.1.2 +exceptiongroup==1.1.3 # via # anyio # pytest @@ -60,6 +60,8 @@ httpcore==0.17.3 # via httpx httpx==0.24.1 # via lightkube +hvac==1.2.0 + # via juju idna==3.4 # via # anyio @@ -78,22 +80,18 @@ jinja2==3.1.2 # via # -r requirements-integration.in # pytest-operator -juju==2.9.44.0 +juju==3.2.2 # via # -r requirements-integration.in # pytest-operator -jujubundlelib==0.5.7 - # via theblues kubernetes==27.2.0 # via juju lightkube==0.14.0 # via -r requirements-integration.in -lightkube-models==1.27.1.4 +lightkube-models==1.28.1.4 # via lightkube macaroonbakery==1.3.1 - # via - # juju - # theblues + # via juju markupsafe==2.1.3 # via jinja2 matplotlib-inline==0.1.6 @@ -118,7 +116,7 @@ pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -pluggy==1.2.0 +pluggy==1.3.0 # via pytest prompt-toolkit==3.0.39 # via ipython @@ -139,6 +137,8 @@ pycparser==2.21 # via cffi pygments==2.16.1 # via ipython +pyhcl==0.4.5 + # via hvac pymacaroons==0.13.0 # via macaroonbakery pynacl==1.5.0 @@ -150,32 +150,31 @@ pyrfc3339==1.1 # via # juju # macaroonbakery -pytest==7.4.0 +pytest==7.4.2 # via # pytest-asyncio # pytest-operator pytest-asyncio==0.21.1 # via pytest-operator -pytest-operator==0.28.0 +pytest-operator==0.29.0 # via -r requirements-integration.in python-dateutil==2.8.2 # via kubernetes -pytz==2023.3 +pytz==2023.3.post1 # via pyrfc3339 pyyaml==6.0.1 # via # juju - # jujubundlelib # kubernetes # lightkube # pytest-operator requests==2.31.0 # via # -r requirements-integration.in + # hvac # kubernetes # macaroonbakery # requests-oauthlib - # theblues requests-oauthlib==1.3.1 # via kubernetes rsa==4.9 @@ -196,10 +195,8 @@ sniffio==1.3.0 # httpx stack-data==0.6.2 # via ipython -tenacity==8.2.2 +tenacity==8.2.3 # via -r requirements-integration.in -theblues==0.5.2 - # via juju tomli==2.0.1 # via # ipdb @@ -223,9 +220,9 @@ urllib3==1.26.16 # requests wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.1 +websocket-client==1.6.2 # via kubernetes -websockets==7.0 +websockets==8.1 # via juju yarl==1.9.2 # via aiohttp From 633516cace76c7b06e8b58ac4b28043c426e9d99 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Tue, 12 Sep 2023 07:51:42 +0000 Subject: [PATCH 2/7] test: refresh dependencies --- requirements-integration.txt | 11 +++++------ requirements-unit.txt | 22 +++++++++++----------- requirements.txt | 16 ++++++++-------- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/requirements-integration.txt b/requirements-integration.txt index 7b0cb8b..90ab6d2 100644 --- a/requirements-integration.txt +++ b/requirements-integration.txt @@ -52,15 +52,15 @@ frozenlist==1.4.0 # via # aiohttp # aiosignal -google-auth==2.22.0 +google-auth==2.23.0 # via kubernetes h11==0.14.0 # via httpcore -httpcore==0.17.3 +httpcore==0.18.0 # via httpx -httpx==0.24.1 +httpx==0.25.0 # via lightkube -hvac==1.2.0 +hvac==1.2.1 # via juju idna==3.4 # via @@ -182,7 +182,6 @@ rsa==4.9 six==1.16.0 # via # asttokens - # google-auth # kubernetes # macaroonbakery # paramiko @@ -220,7 +219,7 @@ urllib3==1.26.16 # requests wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.2 +websocket-client==1.6.3 # via kubernetes websockets==8.1 # via juju diff --git a/requirements-unit.txt b/requirements-unit.txt index 9b45f59..14f4c9e 100644 --- a/requirements-unit.txt +++ b/requirements-unit.txt @@ -4,7 +4,7 @@ # # pip-compile requirements-unit.in # -anyio==3.7.1 +anyio==4.0.0 # via httpcore attrs==23.1.0 # via jsonschema @@ -17,19 +17,19 @@ charmed-kubeflow-chisme==0.2.0 # via -r requirements.in charset-normalizer==3.2.0 # via requests -coverage==7.3.0 +coverage==7.3.1 # via -r requirements-unit.in deepdiff==6.2.1 # via charmed-kubeflow-chisme -exceptiongroup==1.1.2 +exceptiongroup==1.1.3 # via # anyio # pytest h11==0.14.0 # via httpcore -httpcore==0.17.3 +httpcore==0.18.0 # via httpx -httpx==0.24.1 +httpx==0.25.0 # via lightkube idna==3.4 # via @@ -49,11 +49,11 @@ lightkube==0.14.0 # -r requirements-unit.in # -r requirements.in # charmed-kubeflow-chisme -lightkube-models==1.27.1.4 +lightkube-models==1.28.1.4 # via lightkube markupsafe==2.1.3 # via jinja2 -ops==2.5.0 +ops==2.6.0 # via # -r requirements-unit.in # -r requirements.in @@ -65,11 +65,11 @@ packaging==23.1 # via pytest pkgutil-resolve-name==1.3.10 # via jsonschema -pluggy==1.2.0 +pluggy==1.3.0 # via pytest pyrsistent==0.19.3 # via jsonschema -pytest==7.4.0 +pytest==7.4.2 # via # -r requirements-unit.in # pytest-lazy-fixture @@ -98,7 +98,7 @@ sniffio==1.3.0 # anyio # httpcore # httpx -tenacity==8.2.2 +tenacity==8.2.3 # via # -r requirements.in # charmed-kubeflow-chisme @@ -106,7 +106,7 @@ tomli==2.0.1 # via pytest urllib3==2.0.4 # via requests -websocket-client==1.6.1 +websocket-client==1.6.3 # via ops zipp==3.16.2 # via importlib-resources diff --git a/requirements.txt b/requirements.txt index ac739f3..91da2c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ # # pip-compile requirements.in # -anyio==3.7.1 +anyio==4.0.0 # via httpcore attrs==23.1.0 # via jsonschema @@ -19,13 +19,13 @@ charset-normalizer==3.2.0 # via requests deepdiff==6.2.1 # via charmed-kubeflow-chisme -exceptiongroup==1.1.2 +exceptiongroup==1.1.3 # via anyio h11==0.14.0 # via httpcore -httpcore==0.17.3 +httpcore==0.18.0 # via httpx -httpx==0.24.1 +httpx==0.25.0 # via lightkube idna==3.4 # via @@ -42,11 +42,11 @@ lightkube==0.14.0 # via # -r requirements.in # charmed-kubeflow-chisme -lightkube-models==1.27.1.4 +lightkube-models==1.28.1.4 # via lightkube markupsafe==2.1.3 # via jinja2 -ops==2.5.0 +ops==2.6.0 # via # -r requirements.in # charmed-kubeflow-chisme @@ -77,13 +77,13 @@ sniffio==1.3.0 # anyio # httpcore # httpx -tenacity==8.2.2 +tenacity==8.2.3 # via # -r requirements.in # charmed-kubeflow-chisme urllib3==2.0.4 # via requests -websocket-client==1.6.1 +websocket-client==1.6.3 # via ops zipp==3.16.2 # via importlib-resources From 1221c9c7e8225a95625fbd1a990fcd34a1baeed6 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Tue, 12 Sep 2023 08:28:44 +0000 Subject: [PATCH 3/7] [skip] debug: setup upterm --- .github/workflows/integrate.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 22e7fd5..b052a38 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -49,7 +49,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v3 - + - name: Setup upterm session + uses: lhotari/action-upterm@v1 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: From adb26991fa8dbe070f9b84097c14968005003b9f Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Tue, 12 Sep 2023 09:00:32 +0000 Subject: [PATCH 4/7] [skip] debug: tmate --- .github/workflows/integrate.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index b052a38..45a2711 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -49,8 +49,6 @@ jobs: steps: - name: Check out code uses: actions/checkout@v3 - - name: Setup upterm session - uses: lhotari/action-upterm@v1 - name: Setup operator environment uses: charmed-kubernetes/actions-operator@main with: @@ -58,7 +56,8 @@ jobs: channel: 1.25-strict/stable juju-channel: 3.1/stable charmcraft-channel: latest/candidate - + - name: Setup upterm session + uses: lhotari/action-upterm@v1 - name: Run test run: | sg snap_microk8s -c "tox -e integration -- --model testing" From 8edad2024fe34661296978a704d2690d6a0fc7c8 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Tue, 12 Sep 2023 15:25:00 +0000 Subject: [PATCH 5/7] fix: wait for idle charm in integration test --- tests/integration/test_charm.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index f108e82..f1db024 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -42,14 +42,9 @@ async def test_build_and_deploy(ops_test): await ops_test.model.deploy(my_charm, resources=resources, trust=True) - await ops_test.model.block_until( - lambda: all( - (unit.workload_status == "active") and unit.agent_status == "idle" - for _, application in ops_test.model.applications.items() - for unit in application.units - ), - timeout=600, - ) + await ops_test.model.wait_for_idle( + apps=[CHARM_NAME], status="active", raise_on_blocked=True, timeout=600 + ) async def test_status(ops_test): From 94f9dbea719fbf7bcb52a03e1e22dce5fd3cfee9 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Tue, 12 Sep 2023 15:38:34 +0000 Subject: [PATCH 6/7] fix: format --- tests/integration/test_charm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index f1db024..ef2a4ae 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -43,8 +43,8 @@ async def test_build_and_deploy(ops_test): await ops_test.model.deploy(my_charm, resources=resources, trust=True) await ops_test.model.wait_for_idle( - apps=[CHARM_NAME], status="active", raise_on_blocked=True, timeout=600 - ) + apps=[CHARM_NAME], status="active", raise_on_blocked=True, timeout=600 + ) async def test_status(ops_test): From 2284adaf7ed836982ea3cd341c787caec94ce0d3 Mon Sep 17 00:00:00 2001 From: NohaIhab Date: Tue, 12 Sep 2023 15:39:17 +0000 Subject: [PATCH 7/7] fix: remove upterm session from the ci --- .github/workflows/integrate.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 45a2711..aaa6a3d 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -56,8 +56,6 @@ jobs: channel: 1.25-strict/stable juju-channel: 3.1/stable charmcraft-channel: latest/candidate - - name: Setup upterm session - uses: lhotari/action-upterm@v1 - name: Run test run: | sg snap_microk8s -c "tox -e integration -- --model testing"