From aae0623360a8bd1863b8f9e2939e62974f5a1e76 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Mon, 30 Oct 2023 11:57:34 +0000 Subject: [PATCH 01/14] DO NOT MERGE test self-hsoted runners --- .github/workflows/ci.yaml | 100 ++++++-------------------------------- 1 file changed, 15 insertions(+), 85 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 93eea81c3f..8caf29a319 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,90 +46,20 @@ jobs: permissions: actions: write # Needed to manage GitHub Actions cache - gh-hosted-integration-test: - strategy: - fail-fast: false - matrix: - tox-environment: - - backup-integration - - charm-integration - - database-relation-integration - - db-relation-integration - - db-admin-relation-integration - - ha-replication-integration - - ha-self-healing-integration - - ha-restore-cluster-integration - - password-rotation-integration - - plugins-integration - - tls-integration - - upgrade-integration - - upgrade-from-stable-integration - juju-snap-channel: ["2.9/stable", "3.1/stable"] - exclude: - # Admin tests need landscape on juju 2 - - tox-environment: db-admin-relation-integration - juju-snap-channel: "3.1/stable" - include: - - juju-snap-channel: "3.1/stable" - agent-version: "3.1.6" - libjuju-version: "3.2.2" - exclude-mark: "juju2" - - juju-snap-channel: "2.9/stable" - agent-version: "2.9.45" - libjuju-version: "2.9.45.0" - exclude-mark: "juju3" - name: ${{ matrix.juju-snap-channel }} - (GH hosted) ${{ matrix.tox-environment }} + integration-test: + name: Integration test charm needs: - - lint - - unit-test - build - runs-on: ubuntu-latest - timeout-minutes: 120 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install tox & poetry - run: | - pipx install tox - pipx install poetry - - name: Free up disk space - run: | - # From https://github.com/actions/runner-images/issues/2840#issuecomment-790492173 - sudo rm -rf /usr/share/dotnet - sudo rm -rf /opt/ghc - sudo rm -rf /usr/local/share/boost - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - - name: Setup operator environment - uses: charmed-kubernetes/actions-operator@main - with: - provider: lxd - bootstrap-options: "--agent-version ${{ matrix.agent-version }}" - juju-channel: ${{ matrix.juju-snap-channel }} - - name: Update python-libjuju version - if: ${{ matrix.juju-snap-channel == '2.9/stable' }} - run: poetry add --lock --group integration juju@'${{ matrix.libjuju-version }}' - - name: Download packed charm(s) - uses: actions/download-artifact@v3 - with: - name: ${{ needs.build.outputs.artifact-name }} - - name: Select test stability level - id: select-test-stability - run: | - if [[ "${{ github.event_name }}" == "schedule" ]] - then - echo Running unstable and stable tests - echo "mark_expression=" >> "$GITHUB_OUTPUT" - else - echo Skipping unstable tests - echo "mark_expression=and not unstable" >> "$GITHUB_OUTPUT" - fi - - name: Run integration tests - run: tox run -e ${{ matrix.tox-environment }} -- -m 'not ${{ matrix.exclude-mark }} ${{ steps.select-test-stability.outputs.mark_expression }}' --keep-models - env: - SECRETS_FROM_GITHUB: | - { - "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", - "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", - "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", - "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", - } + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large + with: + artifact-name: ${{ needs.build.outputs.artifact-name }} + cloud: lxd + juju-agent-version: 3.1.6 + secrets: + integration-test: | + { + "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", + "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", + "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", + "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", + } From 086e1c824a71416282b66d4cf0483973d75d8c04 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Mon, 30 Oct 2023 12:34:10 +0000 Subject: [PATCH 02/14] Remove groups --- poetry.lock | 272 ++++++++++++++++++++++++---------------------------- 1 file changed, 124 insertions(+), 148 deletions(-) diff --git a/poetry.lock b/poetry.lock index 666832c96c..e4bf6c0042 100644 --- a/poetry.lock +++ b/poetry.lock @@ -47,17 +47,6 @@ docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib- tests = ["attrs[tests-no-zope]", "zope-interface"] tests-no-zope = ["cloudpickle", "hypothesis", "mypy (>=1.1.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -[[package]] -name = "backcall" -version = "0.2.0" -description = "Specifications for callback functions passed in to an API" -optional = false -python-versions = "*" -files = [ - {file = "backcall-0.2.0-py2.py3-none-any.whl", hash = "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255"}, - {file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"}, -] - [[package]] name = "bcrypt" version = "4.0.1" @@ -136,17 +125,17 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "boto3" -version = "1.28.73" +version = "1.28.75" description = "The AWS SDK for Python" optional = false python-versions = ">= 3.7" files = [ - {file = "boto3-1.28.73-py3-none-any.whl", hash = "sha256:bbe377a288b6b12b526fae3b3d743318c6868626cf67e1e97f104345a5194b1e"}, - {file = "boto3-1.28.73.tar.gz", hash = "sha256:a61cf96f7e196b1450afdf4856b7ea0e58080752e687b0011157be96934489be"}, + {file = "boto3-1.28.75-py3-none-any.whl", hash = "sha256:b959decd588982bc919bfcbebc7916926b05003a0093e7f2845362da4f5dd9fc"}, + {file = "boto3-1.28.75.tar.gz", hash = "sha256:63d772a784e8e35ee51974eb1c20dff5faa51b007d22c5647783f18966bf4042"}, ] [package.dependencies] -botocore = ">=1.31.73,<1.32.0" +botocore = ">=1.31.75,<1.32.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.7.0,<0.8.0" @@ -155,13 +144,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.31.73" +version = "1.31.75" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">= 3.7" files = [ - {file = "botocore-1.31.73-py3-none-any.whl", hash = "sha256:6e9caaa7205e0c0505f4868a4053e96eaf3f4b6bce0368a46970a8efeeacb492"}, - {file = "botocore-1.31.73.tar.gz", hash = "sha256:5334c22d5a3f4643931896137c57b2496fef005b039d87d8740e7a28eb31519d"}, + {file = "botocore-1.31.75-py3-none-any.whl", hash = "sha256:fa078c4aa9a5777b3ede756540e62fec551e13d39cf7abf9a37bb81981496d68"}, + {file = "botocore-1.31.75.tar.gz", hash = "sha256:d704ea9867b2227de0350bc2a5ca2543349e164ecb5d15edbfacbb05f2056482"}, ] [package.dependencies] @@ -260,101 +249,101 @@ pycparser = "*" [[package]] name = "charset-normalizer" -version = "3.3.1" +version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7.0" files = [ - {file = "charset-normalizer-3.3.1.tar.gz", hash = "sha256:d9137a876020661972ca6eec0766d81aef8a5627df628b664b234b73396e727e"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8aee051c89e13565c6bd366813c386939f8e928af93c29fda4af86d25b73d8f8"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:352a88c3df0d1fa886562384b86f9a9e27563d4704ee0e9d56ec6fcd270ea690"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:223b4d54561c01048f657fa6ce41461d5ad8ff128b9678cfe8b2ecd951e3f8a2"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f861d94c2a450b974b86093c6c027888627b8082f1299dfd5a4bae8e2292821"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1171ef1fc5ab4693c5d151ae0fdad7f7349920eabbaca6271f95969fa0756c2d"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28f512b9a33235545fbbdac6a330a510b63be278a50071a336afc1b78781b147"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0e842112fe3f1a4ffcf64b06dc4c61a88441c2f02f373367f7b4c1aa9be2ad5"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3f9bc2ce123637a60ebe819f9fccc614da1bcc05798bbbaf2dd4ec91f3e08846"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:f194cce575e59ffe442c10a360182a986535fd90b57f7debfaa5c845c409ecc3"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:9a74041ba0bfa9bc9b9bb2cd3238a6ab3b7618e759b41bd15b5f6ad958d17605"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:b578cbe580e3b41ad17b1c428f382c814b32a6ce90f2d8e39e2e635d49e498d1"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:6db3cfb9b4fcecb4390db154e75b49578c87a3b9979b40cdf90d7e4b945656e1"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:debb633f3f7856f95ad957d9b9c781f8e2c6303ef21724ec94bea2ce2fcbd056"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-win32.whl", hash = "sha256:87071618d3d8ec8b186d53cb6e66955ef2a0e4fa63ccd3709c0c90ac5a43520f"}, - {file = "charset_normalizer-3.3.1-cp310-cp310-win_amd64.whl", hash = "sha256:e372d7dfd154009142631de2d316adad3cc1c36c32a38b16a4751ba78da2a397"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ae4070f741f8d809075ef697877fd350ecf0b7c5837ed68738607ee0a2c572cf"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:58e875eb7016fd014c0eea46c6fa92b87b62c0cb31b9feae25cbbe62c919f54d"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dbd95e300367aa0827496fe75a1766d198d34385a58f97683fe6e07f89ca3e3c"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:de0b4caa1c8a21394e8ce971997614a17648f94e1cd0640fbd6b4d14cab13a72"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:985c7965f62f6f32bf432e2681173db41336a9c2611693247069288bcb0c7f8b"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a15c1fe6d26e83fd2e5972425a772cca158eae58b05d4a25a4e474c221053e2d"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ae55d592b02c4349525b6ed8f74c692509e5adffa842e582c0f861751701a673"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:be4d9c2770044a59715eb57c1144dedea7c5d5ae80c68fb9959515037cde2008"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:851cf693fb3aaef71031237cd68699dded198657ec1e76a76eb8be58c03a5d1f"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:31bbaba7218904d2eabecf4feec0d07469284e952a27400f23b6628439439fa7"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:871d045d6ccc181fd863a3cd66ee8e395523ebfbc57f85f91f035f50cee8e3d4"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:501adc5eb6cd5f40a6f77fbd90e5ab915c8fd6e8c614af2db5561e16c600d6f3"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f5fb672c396d826ca16a022ac04c9dce74e00a1c344f6ad1a0fdc1ba1f332213"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-win32.whl", hash = "sha256:bb06098d019766ca16fc915ecaa455c1f1cd594204e7f840cd6258237b5079a8"}, - {file = "charset_normalizer-3.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:8af5a8917b8af42295e86b64903156b4f110a30dca5f3b5aedea123fbd638bff"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:7ae8e5142dcc7a49168f4055255dbcced01dc1714a90a21f87448dc8d90617d1"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5b70bab78accbc672f50e878a5b73ca692f45f5b5e25c8066d748c09405e6a55"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5ceca5876032362ae73b83347be8b5dbd2d1faf3358deb38c9c88776779b2e2f"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34d95638ff3613849f473afc33f65c401a89f3b9528d0d213c7037c398a51296"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9edbe6a5bf8b56a4a84533ba2b2f489d0046e755c29616ef8830f9e7d9cf5728"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f6a02a3c7950cafaadcd46a226ad9e12fc9744652cc69f9e5534f98b47f3bbcf"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10b8dd31e10f32410751b3430996f9807fc4d1587ca69772e2aa940a82ab571a"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edc0202099ea1d82844316604e17d2b175044f9bcb6b398aab781eba957224bd"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b891a2f68e09c5ef989007fac11476ed33c5c9994449a4e2c3386529d703dc8b"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:71ef3b9be10070360f289aea4838c784f8b851be3ba58cf796262b57775c2f14"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:55602981b2dbf8184c098bc10287e8c245e351cd4fdcad050bd7199d5a8bf514"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:46fb9970aa5eeca547d7aa0de5d4b124a288b42eaefac677bde805013c95725c"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:520b7a142d2524f999447b3a0cf95115df81c4f33003c51a6ab637cbda9d0bf4"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-win32.whl", hash = "sha256:8ec8ef42c6cd5856a7613dcd1eaf21e5573b2185263d87d27c8edcae33b62a61"}, - {file = "charset_normalizer-3.3.1-cp312-cp312-win_amd64.whl", hash = "sha256:baec8148d6b8bd5cee1ae138ba658c71f5b03e0d69d5907703e3e1df96db5e41"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:63a6f59e2d01310f754c270e4a257426fe5a591dc487f1983b3bbe793cf6bac6"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d6bfc32a68bc0933819cfdfe45f9abc3cae3877e1d90aac7259d57e6e0f85b1"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4f3100d86dcd03c03f7e9c3fdb23d92e32abbca07e7c13ebd7ddfbcb06f5991f"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:39b70a6f88eebe239fa775190796d55a33cfb6d36b9ffdd37843f7c4c1b5dc67"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4e12f8ee80aa35e746230a2af83e81bd6b52daa92a8afaef4fea4a2ce9b9f4fa"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7b6cefa579e1237ce198619b76eaa148b71894fb0d6bcf9024460f9bf30fd228"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:61f1e3fb621f5420523abb71f5771a204b33c21d31e7d9d86881b2cffe92c47c"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:4f6e2a839f83a6a76854d12dbebde50e4b1afa63e27761549d006fa53e9aa80e"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:1ec937546cad86d0dce5396748bf392bb7b62a9eeb8c66efac60e947697f0e58"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:82ca51ff0fc5b641a2d4e1cc8c5ff108699b7a56d7f3ad6f6da9dbb6f0145b48"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:633968254f8d421e70f91c6ebe71ed0ab140220469cf87a9857e21c16687c034"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-win32.whl", hash = "sha256:c0c72d34e7de5604df0fde3644cc079feee5e55464967d10b24b1de268deceb9"}, - {file = "charset_normalizer-3.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:63accd11149c0f9a99e3bc095bbdb5a464862d77a7e309ad5938fbc8721235ae"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5a3580a4fdc4ac05f9e53c57f965e3594b2f99796231380adb2baaab96e22761"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2465aa50c9299d615d757c1c888bc6fef384b7c4aec81c05a0172b4400f98557"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cb7cd68814308aade9d0c93c5bd2ade9f9441666f8ba5aa9c2d4b389cb5e2a45"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:91e43805ccafa0a91831f9cd5443aa34528c0c3f2cc48c4cb3d9a7721053874b"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:854cc74367180beb327ab9d00f964f6d91da06450b0855cbbb09187bcdb02de5"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c15070ebf11b8b7fd1bfff7217e9324963c82dbdf6182ff7050519e350e7ad9f"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c4c99f98fc3a1835af8179dcc9013f93594d0670e2fa80c83aa36346ee763d2"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3fb765362688821404ad6cf86772fc54993ec11577cd5a92ac44b4c2ba52155b"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:dced27917823df984fe0c80a5c4ad75cf58df0fbfae890bc08004cd3888922a2"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a66bcdf19c1a523e41b8e9d53d0cedbfbac2e93c649a2e9502cb26c014d0980c"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ecd26be9f112c4f96718290c10f4caea6cc798459a3a76636b817a0ed7874e42"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:3f70fd716855cd3b855316b226a1ac8bdb3caf4f7ea96edcccc6f484217c9597"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:17a866d61259c7de1bdadef418a37755050ddb4b922df8b356503234fff7932c"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-win32.whl", hash = "sha256:548eefad783ed787b38cb6f9a574bd8664468cc76d1538215d510a3cd41406cb"}, - {file = "charset_normalizer-3.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:45f053a0ece92c734d874861ffe6e3cc92150e32136dd59ab1fb070575189c97"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bc791ec3fd0c4309a753f95bb6c749ef0d8ea3aea91f07ee1cf06b7b02118f2f"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0c8c61fb505c7dad1d251c284e712d4e0372cef3b067f7ddf82a7fa82e1e9a93"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2c092be3885a1b7899cd85ce24acedc1034199d6fca1483fa2c3a35c86e43041"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c2000c54c395d9e5e44c99dc7c20a64dc371f777faf8bae4919ad3e99ce5253e"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4cb50a0335382aac15c31b61d8531bc9bb657cfd848b1d7158009472189f3d62"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c30187840d36d0ba2893bc3271a36a517a717f9fd383a98e2697ee890a37c273"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe81b35c33772e56f4b6cf62cf4aedc1762ef7162a31e6ac7fe5e40d0149eb67"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d0bf89afcbcf4d1bb2652f6580e5e55a840fdf87384f6063c4a4f0c95e378656"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:06cf46bdff72f58645434d467bf5228080801298fbba19fe268a01b4534467f5"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:3c66df3f41abee950d6638adc7eac4730a306b022570f71dd0bd6ba53503ab57"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:cd805513198304026bd379d1d516afbf6c3c13f4382134a2c526b8b854da1c2e"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:9505dc359edb6a330efcd2be825fdb73ee3e628d9010597aa1aee5aa63442e97"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:31445f38053476a0c4e6d12b047b08ced81e2c7c712e5a1ad97bc913256f91b2"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-win32.whl", hash = "sha256:bd28b31730f0e982ace8663d108e01199098432a30a4c410d06fe08fdb9e93f4"}, - {file = "charset_normalizer-3.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:555fe186da0068d3354cdf4bbcbc609b0ecae4d04c921cc13e209eece7720727"}, - {file = "charset_normalizer-3.3.1-py3-none-any.whl", hash = "sha256:800561453acdecedaac137bf09cd719c7a440b6800ec182f077bb8e7025fb708"}, + {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, + {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, ] [[package]] @@ -554,13 +543,13 @@ test = ["pytest (>=6)"] [[package]] name = "executing" -version = "2.0.0" +version = "2.0.1" description = "Get the currently executing AST node of a frame, and other information" optional = false -python-versions = "*" +python-versions = ">=3.5" files = [ - {file = "executing-2.0.0-py2.py3-none-any.whl", hash = "sha256:06df6183df67389625f4e763921c6cf978944721abf3e714000200aab95b0657"}, - {file = "executing-2.0.0.tar.gz", hash = "sha256:0ff053696fdeef426cda5bd18eacd94f82c91f49823a2e9090124212ceea9b08"}, + {file = "executing-2.0.1-py2.py3-none-any.whl", hash = "sha256:eac49ca94516ccc753f9fb5ce82603156e590b27525a8bc32cce8ae302eb61bc"}, + {file = "executing-2.0.1.tar.gz", hash = "sha256:35afe2ce3affba8ee97f2d69927fa823b08b472b7b994e36a52a964b93d16147"}, ] [package.extras] @@ -568,13 +557,13 @@ tests = ["asttokens (>=2.1.0)", "coverage", "coverage-enable-subprocess", "ipyth [[package]] name = "google-auth" -version = "2.23.3" +version = "2.23.4" description = "Google Authentication Library" optional = false python-versions = ">=3.7" files = [ - {file = "google-auth-2.23.3.tar.gz", hash = "sha256:6864247895eea5d13b9c57c9e03abb49cb94ce2dc7c58e91cba3248c7477c9e3"}, - {file = "google_auth-2.23.3-py2.py3-none-any.whl", hash = "sha256:a8f4608e65c244ead9e0538f181a96c6e11199ec114d41f1d7b1bffa96937bda"}, + {file = "google-auth-2.23.4.tar.gz", hash = "sha256:79905d6b1652187def79d491d6e23d0cbb3a21d3c7ba0dbaa9c8a01906b13ff3"}, + {file = "google_auth-2.23.4-py2.py3-none-any.whl", hash = "sha256:d4bbc92fe4b8bfd2f3e8d88e5ba7085935da208ee38a134fc280e7ce682a05f2"}, ] [package.dependencies] @@ -646,42 +635,40 @@ tomli = {version = "*", markers = "python_version > \"3.6\" and python_version < [[package]] name = "ipython" -version = "8.16.1" +version = "8.17.2" description = "IPython: Productive Interactive Computing" optional = false python-versions = ">=3.9" files = [ - {file = "ipython-8.16.1-py3-none-any.whl", hash = "sha256:0852469d4d579d9cd613c220af7bf0c9cc251813e12be647cb9d463939db9b1e"}, - {file = "ipython-8.16.1.tar.gz", hash = "sha256:ad52f58fca8f9f848e256c629eff888efc0528c12fe0f8ec14f33205f23ef938"}, + {file = "ipython-8.17.2-py3-none-any.whl", hash = "sha256:1e4d1d666a023e3c93585ba0d8e962867f7a111af322efff6b9c58062b3e5444"}, + {file = "ipython-8.17.2.tar.gz", hash = "sha256:126bb57e1895594bb0d91ea3090bbd39384f6fe87c3d57fd558d0670f50339bb"}, ] [package.dependencies] appnope = {version = "*", markers = "sys_platform == \"darwin\""} -backcall = "*" colorama = {version = "*", markers = "sys_platform == \"win32\""} decorator = "*" exceptiongroup = {version = "*", markers = "python_version < \"3.11\""} jedi = ">=0.16" matplotlib-inline = "*" pexpect = {version = ">4.3", markers = "sys_platform != \"win32\""} -pickleshare = "*" prompt-toolkit = ">=3.0.30,<3.0.37 || >3.0.37,<3.1.0" pygments = ">=2.4.0" stack-data = "*" traitlets = ">=5" [package.extras] -all = ["black", "curio", "docrepr", "exceptiongroup", "ipykernel", "ipyparallel", "ipywidgets", "matplotlib", "matplotlib (!=3.2.0)", "nbconvert", "nbformat", "notebook", "numpy (>=1.21)", "pandas", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio", "qtconsole", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "trio", "typing-extensions"] +all = ["black", "curio", "docrepr", "exceptiongroup", "ipykernel", "ipyparallel", "ipywidgets", "matplotlib", "matplotlib (!=3.2.0)", "nbconvert", "nbformat", "notebook", "numpy (>=1.22)", "pandas", "pickleshare", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio (<0.22)", "qtconsole", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "trio", "typing-extensions"] black = ["black"] -doc = ["docrepr", "exceptiongroup", "ipykernel", "matplotlib", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "typing-extensions"] +doc = ["docrepr", "exceptiongroup", "ipykernel", "matplotlib", "pickleshare", "pytest (<7)", "pytest (<7.1)", "pytest-asyncio (<0.22)", "setuptools (>=18.5)", "sphinx (>=1.3)", "sphinx-rtd-theme", "stack-data", "testpath", "typing-extensions"] kernel = ["ipykernel"] nbconvert = ["nbconvert"] nbformat = ["nbformat"] notebook = ["ipywidgets", "notebook"] parallel = ["ipyparallel"] qtconsole = ["qtconsole"] -test = ["pytest (<7.1)", "pytest-asyncio", "testpath"] -test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.21)", "pandas", "pytest (<7.1)", "pytest-asyncio", "testpath", "trio"] +test = ["pickleshare", "pytest (<7.1)", "pytest-asyncio (<0.22)", "testpath"] +test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.22)", "pandas", "pickleshare", "pytest (<7.1)", "pytest-asyncio (<0.22)", "testpath", "trio"] [[package]] name = "jedi" @@ -732,13 +719,13 @@ files = [ [[package]] name = "jsonschema" -version = "4.19.1" +version = "4.19.2" description = "An implementation of JSON Schema validation for Python" optional = false python-versions = ">=3.8" files = [ - {file = "jsonschema-4.19.1-py3-none-any.whl", hash = "sha256:cd5f1f9ed9444e554b38ba003af06c0a8c2868131e56bfbef0550fb450c0330e"}, - {file = "jsonschema-4.19.1.tar.gz", hash = "sha256:ec84cc37cfa703ef7cd4928db24f9cb31428a5d0fa77747b8b51a847458e0bbf"}, + {file = "jsonschema-4.19.2-py3-none-any.whl", hash = "sha256:eee9e502c788e89cb166d4d37f43084e3b64ab405c795c03d343a4dbc2c810fc"}, + {file = "jsonschema-4.19.2.tar.gz", hash = "sha256:c9ff4d7447eed9592c23a12ccee508baf0dd0d59650615e847feb6cdca74f392"}, ] [package.dependencies] @@ -1063,17 +1050,6 @@ files = [ {file = "pgconnstr-1.0.1.zip", hash = "sha256:0656129961ae879675d0842f5237db82d31ce59c7b3211b051c33e37a864826e"}, ] -[[package]] -name = "pickleshare" -version = "0.7.5" -description = "Tiny 'shelve'-like database with concurrency support" -optional = false -python-versions = "*" -files = [ - {file = "pickleshare-0.7.5-py2.py3-none-any.whl", hash = "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"}, - {file = "pickleshare-0.7.5.tar.gz", hash = "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca"}, -] - [[package]] name = "platformdirs" version = "3.11.0" @@ -1106,13 +1082,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "poetry-core" -version = "1.7.0" +version = "1.8.1" description = "Poetry PEP 517 Build Backend" optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "poetry_core-1.7.0-py3-none-any.whl", hash = "sha256:38e174cdb00a84ee4a1cab66a378b435747f72414f5573bc18cfc3850a94df38"}, - {file = "poetry_core-1.7.0.tar.gz", hash = "sha256:8f679b83bd9c820082637beca1204124d5d2a786e4818da47ec8acefd0353b74"}, + {file = "poetry_core-1.8.1-py3-none-any.whl", hash = "sha256:194832b24f3283e01c5402eae71a6aae850ecdfe53f50a979c76bf7aa5010ffa"}, + {file = "poetry_core-1.8.1.tar.gz", hash = "sha256:67a76c671da2a70e55047cddda83566035b701f7e463b32a2abfeac6e2a16376"}, ] [[package]] @@ -1854,13 +1830,13 @@ files = [ [[package]] name = "traitlets" -version = "5.12.0" +version = "5.13.0" description = "Traitlets Python configuration system" optional = false python-versions = ">=3.8" files = [ - {file = "traitlets-5.12.0-py3-none-any.whl", hash = "sha256:81539f07f7aebcde2e4b5ab76727f53eabf18ad155c6ed7979a681411602fa47"}, - {file = "traitlets-5.12.0.tar.gz", hash = "sha256:833273bf645d8ce31dcb613c56999e2e055b1ffe6d09168a164bcd91c36d5d35"}, + {file = "traitlets-5.13.0-py3-none-any.whl", hash = "sha256:baf991e61542da48fe8aef8b779a9ea0aa38d8a54166ee250d5af5ecf4486619"}, + {file = "traitlets-5.13.0.tar.gz", hash = "sha256:9b232b9430c8f57288c1024b34a8f0251ddcc47268927367a0dd3eeaca40deb5"}, ] [package.extras] @@ -1912,13 +1888,13 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "wcwidth" -version = "0.2.8" +version = "0.2.9" description = "Measures the displayed width of unicode strings in a terminal" optional = false python-versions = "*" files = [ - {file = "wcwidth-0.2.8-py2.py3-none-any.whl", hash = "sha256:77f719e01648ed600dfa5402c347481c0992263b81a027344f3e1ba25493a704"}, - {file = "wcwidth-0.2.8.tar.gz", hash = "sha256:8705c569999ffbb4f6a87c6d1b80f324bd6db952f5eb0b95bc07517f4c1813d4"}, + {file = "wcwidth-0.2.9-py2.py3-none-any.whl", hash = "sha256:9a929bd8380f6cd9571a968a9c8f4353ca58d7cd812a4822bba831f8d685b223"}, + {file = "wcwidth-0.2.9.tar.gz", hash = "sha256:a675d1a4a2d24ef67096a04b85b02deeecd8e226f57b5e3a72dbb9ed99d27da8"}, ] [[package]] From fe57a4b5fd89fbe7e8ec1764e3b912d7bcc25576 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Mon, 30 Oct 2023 14:21:04 +0000 Subject: [PATCH 03/14] Add group markers --- poetry.lock | 2 ++ tests/integration/ha_tests/test_replication.py | 4 ++++ tests/integration/ha_tests/test_restore_cluster.py | 2 ++ tests/integration/ha_tests/test_self_healing.py | 9 +++++++++ tests/integration/ha_tests/test_upgrade.py | 4 ++++ .../ha_tests/test_upgrade_from_stable.py | 3 +++ .../integration/new_relations/test_new_relations.py | 13 +++++++++++++ tests/integration/test_backups.py | 3 +++ tests/integration/test_charm.py | 7 +++++++ tests/integration/test_db.py | 6 ++++++ tests/integration/test_db_admin.py | 2 ++ tests/integration/test_password_rotation.py | 2 ++ tests/integration/test_plugins.py | 1 + tests/integration/test_tls.py | 3 +++ 14 files changed, 61 insertions(+) diff --git a/poetry.lock b/poetry.lock index e4bf6c0042..ffc74cddeb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1147,6 +1147,8 @@ files = [ {file = "psycopg2-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:426f9f29bde126913a20a96ff8ce7d73fd8a216cfb323b1f04da402d452853c3"}, {file = "psycopg2-2.9.9-cp311-cp311-win32.whl", hash = "sha256:ade01303ccf7ae12c356a5e10911c9e1c51136003a9a1d92f7aa9d010fb98372"}, {file = "psycopg2-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:121081ea2e76729acfb0673ff33755e8703d45e926e416cb59bae3a86c6a4981"}, + {file = "psycopg2-2.9.9-cp312-cp312-win32.whl", hash = "sha256:d735786acc7dd25815e89cc4ad529a43af779db2e25aa7c626de864127e5a024"}, + {file = "psycopg2-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:a7653d00b732afb6fc597e29c50ad28087dcb4fbfb28e86092277a559ae4e693"}, {file = "psycopg2-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:5e0d98cade4f0e0304d7d6f25bbfbc5bd186e07b38eac65379309c4ca3193efa"}, {file = "psycopg2-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:7e2dacf8b009a1c1e843b5213a87f7c544b2b042476ed7755be813eaf4e8347a"}, {file = "psycopg2-2.9.9-cp38-cp38-win32.whl", hash = "sha256:ff432630e510709564c01dafdbe996cb552e0b9f3f065eb89bdce5bd31fabf4c"}, diff --git a/tests/integration/ha_tests/test_replication.py b/tests/integration/ha_tests/test_replication.py index a579aad58b..72924ba5e5 100644 --- a/tests/integration/ha_tests/test_replication.py +++ b/tests/integration/ha_tests/test_replication.py @@ -19,6 +19,7 @@ from tests.integration.helpers import CHARM_SERIES, db_connect, scale_application +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_build_and_deploy(ops_test: OpsTest) -> None: """Build and deploy three unit of PostgreSQL.""" @@ -51,6 +52,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: await ops_test.model.wait_for_idle(status="active", timeout=1000) +@pytest.mark.group(1) async def test_reelection(ops_test: OpsTest, continuous_writes, primary_start_timeout) -> None: """Kill primary unit, check reelection.""" app = await app_name(ops_test) @@ -88,6 +90,7 @@ async def test_reelection(ops_test: OpsTest, continuous_writes, primary_start_ti await check_writes(ops_test) +@pytest.mark.group(1) async def test_consistency(ops_test: OpsTest, continuous_writes) -> None: """Write to primary, read data from secondaries (check consistency).""" # Locate primary unit. @@ -104,6 +107,7 @@ async def test_consistency(ops_test: OpsTest, continuous_writes) -> None: await check_writes(ops_test) +@pytest.mark.group(1) async def test_no_data_replicated_between_clusters(ops_test: OpsTest, continuous_writes) -> None: """Check that writes in one cluster are not replicated to another cluster.""" # Locate primary unit. diff --git a/tests/integration/ha_tests/test_restore_cluster.py b/tests/integration/ha_tests/test_restore_cluster.py index ce9fd99f86..6bd1e173e6 100644 --- a/tests/integration/ha_tests/test_restore_cluster.py +++ b/tests/integration/ha_tests/test_restore_cluster.py @@ -29,6 +29,7 @@ charm = None +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_build_and_deploy(ops_test: OpsTest) -> None: """Build and deploy two PostgreSQL clusters.""" @@ -66,6 +67,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: await ops_test.model.destroy_unit(second_primary) +@pytest.mark.group(1) async def test_cluster_restore(ops_test): """Recreates the cluster from storage volumes.""" # Write some data. diff --git a/tests/integration/ha_tests/test_self_healing.py b/tests/integration/ha_tests/test_self_healing.py index bb68fa8541..3930de9b45 100644 --- a/tests/integration/ha_tests/test_self_healing.py +++ b/tests/integration/ha_tests/test_self_healing.py @@ -60,6 +60,7 @@ DB_PROCESSES = [POSTGRESQL_PROCESS, PATRONI_PROCESS] +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_build_and_deploy(ops_test: OpsTest) -> None: """Build and deploy three unit of PostgreSQL.""" @@ -93,6 +94,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: await ops_test.model.wait_for_idle(status="active", timeout=1000) +@pytest.mark.group(1) async def test_storage_re_use(ops_test, continuous_writes): """Verifies that database units with attached storage correctly repurpose storage. @@ -139,6 +141,7 @@ async def test_storage_re_use(ops_test, continuous_writes): ), "new instance not up to date." +@pytest.mark.group(1) @pytest.mark.parametrize("process", DB_PROCESSES) async def test_kill_db_process( ops_test: OpsTest, process: str, continuous_writes, primary_start_timeout @@ -166,6 +169,7 @@ async def test_kill_db_process( await is_cluster_updated(ops_test, primary_name) +@pytest.mark.group(1) @pytest.mark.parametrize("process", DB_PROCESSES) async def test_freeze_db_process( ops_test: OpsTest, process: str, continuous_writes, primary_start_timeout @@ -203,6 +207,7 @@ async def test_freeze_db_process( await is_cluster_updated(ops_test, primary_name) +@pytest.mark.group(1) @pytest.mark.parametrize("process", DB_PROCESSES) async def test_restart_db_process( ops_test: OpsTest, process: str, continuous_writes, primary_start_timeout @@ -230,6 +235,7 @@ async def test_restart_db_process( await is_cluster_updated(ops_test, primary_name) +@pytest.mark.group(1) @pytest.mark.parametrize("process", DB_PROCESSES) @pytest.mark.parametrize("signal", ["SIGTERM", "SIGKILL"]) async def test_full_cluster_restart( @@ -299,6 +305,7 @@ async def test_full_cluster_restart( await check_writes(ops_test) +@pytest.mark.group(1) @pytest.mark.unstable async def test_forceful_restart_without_data_and_transaction_logs( ops_test: OpsTest, @@ -374,6 +381,7 @@ async def test_forceful_restart_without_data_and_transaction_logs( await is_cluster_updated(ops_test, primary_name) +@pytest.mark.group(1) @pytest.mark.unstable async def test_network_cut(ops_test: OpsTest, continuous_writes, primary_start_timeout): """Completely cut and restore network.""" @@ -458,6 +466,7 @@ async def test_network_cut(ops_test: OpsTest, continuous_writes, primary_start_t await is_cluster_updated(ops_test, primary_name) +@pytest.mark.group(1) @pytest.mark.unstable async def test_network_cut_without_ip_change( ops_test: OpsTest, continuous_writes, primary_start_timeout diff --git a/tests/integration/ha_tests/test_upgrade.py b/tests/integration/ha_tests/test_upgrade.py index c58572428f..735085599d 100644 --- a/tests/integration/ha_tests/test_upgrade.py +++ b/tests/integration/ha_tests/test_upgrade.py @@ -30,6 +30,7 @@ TIMEOUT = 5 * 60 +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_deploy_latest(ops_test: OpsTest) -> None: """Simple test to ensure that the PostgreSQL and application charms get deployed.""" @@ -52,6 +53,7 @@ async def test_deploy_latest(ops_test: OpsTest) -> None: assert len(ops_test.model.applications[DATABASE_APP_NAME].units) == 3 +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_pre_upgrade_check(ops_test: OpsTest) -> None: """Test that the pre-upgrade-check action runs successfully.""" @@ -64,6 +66,7 @@ async def test_pre_upgrade_check(ops_test: OpsTest) -> None: await action.wait() +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_upgrade_from_edge(ops_test: OpsTest, continuous_writes) -> None: # Start an application that continuously writes data to the database. @@ -113,6 +116,7 @@ async def test_upgrade_from_edge(ops_test: OpsTest, continuous_writes) -> None: ) <= 2, "Number of switchovers is greater than 2" +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_fail_and_rollback(ops_test, continuous_writes) -> None: # Start an application that continuously writes data to the database. diff --git a/tests/integration/ha_tests/test_upgrade_from_stable.py b/tests/integration/ha_tests/test_upgrade_from_stable.py index 5d20fcfa50..88e137a597 100644 --- a/tests/integration/ha_tests/test_upgrade_from_stable.py +++ b/tests/integration/ha_tests/test_upgrade_from_stable.py @@ -25,6 +25,7 @@ TIMEOUT = 5 * 60 +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_deploy_stable(ops_test: OpsTest) -> None: """Simple test to ensure that the PostgreSQL and application charms get deployed.""" @@ -75,6 +76,7 @@ async def test_deploy_stable(ops_test: OpsTest) -> None: assert len(ops_test.model.applications[DATABASE_APP_NAME].units) == 3 +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_pre_upgrade_check(ops_test: OpsTest) -> None: """Test that the pre-upgrade-check action runs successfully.""" @@ -92,6 +94,7 @@ async def test_pre_upgrade_check(ops_test: OpsTest) -> None: await action.wait() +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_upgrade_from_stable(ops_test: OpsTest): """Test updating from stable channel.""" diff --git a/tests/integration/new_relations/test_new_relations.py b/tests/integration/new_relations/test_new_relations.py index 5362a40904..88266cb366 100644 --- a/tests/integration/new_relations/test_new_relations.py +++ b/tests/integration/new_relations/test_new_relations.py @@ -35,6 +35,7 @@ INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE = "invalid role(s) for extra user roles" +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_deploy_charms(ops_test: OpsTest, charm): """Deploy both charms (application and database) to use in the tests.""" @@ -68,6 +69,7 @@ async def test_deploy_charms(ops_test: OpsTest, charm): await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", timeout=3000) +@pytest.mark.group(1) async def test_no_read_only_endpoint_in_standalone_cluster(ops_test: OpsTest): """Test that there is no read-only endpoint in a standalone cluster.""" async with ops_test.fast_forward(): @@ -114,6 +116,7 @@ async def test_no_read_only_endpoint_in_standalone_cluster(ops_test: OpsTest): ) +@pytest.mark.group(1) async def test_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest): """Test that there is read-only endpoint in a scaled up cluster.""" async with ops_test.fast_forward(): @@ -131,6 +134,7 @@ async def test_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest): ) +@pytest.mark.group(1) async def test_database_relation_with_charm_libraries(ops_test: OpsTest): """Test basic functionality of database relation interface.""" # Get the connection string to connect to the database using the read/write endpoint. @@ -178,6 +182,7 @@ async def test_database_relation_with_charm_libraries(ops_test: OpsTest): cursor.execute("DROP TABLE test;") +@pytest.mark.group(1) async def test_user_with_extra_roles(ops_test: OpsTest): """Test superuser actions and the request for more permissions.""" # Get the connection string to connect to the database. @@ -198,6 +203,7 @@ async def test_user_with_extra_roles(ops_test: OpsTest): connection.close() +@pytest.mark.group(1) async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: OpsTest): """Test that two different application connect to the database with different credentials.""" # Set some variables to use in this test. @@ -250,6 +256,7 @@ async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: Op psycopg2.connect(connection_string) +@pytest.mark.group(1) async def test_an_application_can_connect_to_multiple_database_clusters(ops_test: OpsTest): """Test that an application can connect to different clusters of the same database.""" # Relate the application with both database clusters @@ -280,6 +287,7 @@ async def test_an_application_can_connect_to_multiple_database_clusters(ops_test assert application_connection_string != another_application_connection_string +@pytest.mark.group(1) async def test_an_application_can_connect_to_multiple_aliased_database_clusters(ops_test: OpsTest): """Test that an application can connect to different clusters of the same database.""" # Relate the application with both database clusters @@ -313,6 +321,7 @@ async def test_an_application_can_connect_to_multiple_aliased_database_clusters( assert application_connection_string != another_application_connection_string +@pytest.mark.group(1) async def test_an_application_can_request_multiple_databases(ops_test: OpsTest): """Test that an application can request additional databases using the same interface.""" # Relate the charms using another relation and wait for them exchanging some connection data. @@ -333,6 +342,7 @@ async def test_an_application_can_request_multiple_databases(ops_test: OpsTest): assert first_database_connection_string != second_database_connection_string +@pytest.mark.group(1) async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest): """Test that relation data, like connection data, is updated correctly when scaling.""" # Retrieve the list of current database unit names. @@ -399,6 +409,7 @@ async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest psycopg2.connect(primary_connection_string) +@pytest.mark.group(1) async def test_relation_with_no_database_name(ops_test: OpsTest): """Test that a relation with no database name doesn't block the charm.""" async with ops_test.fast_forward(): @@ -415,6 +426,7 @@ async def test_relation_with_no_database_name(ops_test: OpsTest): await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", raise_on_blocked=True) +@pytest.mark.group(1) async def test_admin_role(ops_test: OpsTest): """Test that the admin role gives access to all the databases.""" all_app_names = [DATA_INTEGRATOR_APP_NAME] @@ -499,6 +511,7 @@ async def test_admin_role(ops_test: OpsTest): connection.close() +@pytest.mark.group(1) async def test_invalid_extra_user_roles(ops_test: OpsTest): async with ops_test.fast_forward(): # Remove the relation between the database and the first data integrator. diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index 07ee7a218a..1a943e9aa1 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -79,6 +79,7 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: bucket_object.delete() +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: """Build and deploy two units of PostgreSQL and then test the backup and restore actions.""" @@ -216,6 +217,7 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No await ops_test.model.remove_application(TLS_CERTIFICATES_APP_NAME, block_until_done=True) +@pytest.mark.group(1) async def test_restore_on_new_cluster(ops_test: OpsTest) -> None: """Test that is possible to restore a backup to another PostgreSQL cluster.""" charm = await ops_test.build_charm(".") @@ -293,6 +295,7 @@ async def test_restore_on_new_cluster(ops_test: OpsTest) -> None: connection.close() +@pytest.mark.group(1) async def test_invalid_config_and_recovery_after_fixing_it( ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict] ) -> None: diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index 011c0b46a8..a693a2c802 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -32,6 +32,7 @@ UNIT_IDS = [0, 1, 2] +@pytest.mark.group(1) @pytest.mark.abort_on_fail @pytest.mark.skip_if_deployed async def test_deploy(ops_test: OpsTest, charm: str): @@ -55,6 +56,7 @@ async def test_deploy(ops_test: OpsTest, charm: str): assert ops_test.model.applications[DATABASE_APP_NAME].units[0].workload_status == "active" +@pytest.mark.group(1) @pytest.mark.abort_on_fail @pytest.mark.parametrize("unit_id", UNIT_IDS) async def test_database_is_up(ops_test: OpsTest, unit_id: int): @@ -65,6 +67,7 @@ async def test_database_is_up(ops_test: OpsTest, unit_id: int): assert result.status_code == 200 +@pytest.mark.group(1) @pytest.mark.parametrize("unit_id", UNIT_IDS) async def test_exporter_is_up(ops_test: OpsTest, unit_id: int): # Query Patroni REST API and check the status that indicates @@ -77,6 +80,7 @@ async def test_exporter_is_up(ops_test: OpsTest, unit_id: int): ), "Scrape error in postgresql_prometheus_exporter" +@pytest.mark.group(1) @pytest.mark.parametrize("unit_id", UNIT_IDS) async def test_settings_are_correct(ops_test: OpsTest, unit_id: int): # Connect to the PostgreSQL instance. @@ -162,6 +166,7 @@ async def test_settings_are_correct(ops_test: OpsTest, unit_id: int): assert unit.data["port-ranges"][0]["protocol"] == "tcp" +@pytest.mark.group(1) async def test_postgresql_parameters_change(ops_test: OpsTest) -> None: """Test that's possible to change PostgreSQL parameters.""" await ops_test.model.applications[DATABASE_APP_NAME].set_config( @@ -198,6 +203,7 @@ async def test_postgresql_parameters_change(ops_test: OpsTest) -> None: assert settings["lc_monetary"] == "en_GB.utf8" +@pytest.mark.group(1) async def test_scale_down_and_up(ops_test: OpsTest): """Test data is replicated to new units after a scale up.""" # Ensure the initial number of units in the application. @@ -279,6 +285,7 @@ async def test_scale_down_and_up(ops_test: OpsTest): await scale_application(ops_test, DATABASE_APP_NAME, initial_scale) +@pytest.mark.group(1) async def test_persist_data_through_primary_deletion(ops_test: OpsTest): """Test data persists through a primary deletion.""" # Set a composite application name in order to test in more than one series at the same time. diff --git a/tests/integration/test_db.py b/tests/integration/test_db.py index 6002f39020..9ee3a62b94 100644 --- a/tests/integration/test_db.py +++ b/tests/integration/test_db.py @@ -32,6 +32,7 @@ RELATION_NAME = "db" +@pytest.mark.group(1) async def test_mailman3_core_db(ops_test: OpsTest, charm: str) -> None: """Deploy Mailman3 Core to test the 'db' relation.""" async with ops_test.fast_forward(): @@ -97,6 +98,7 @@ async def test_mailman3_core_db(ops_test: OpsTest, charm: str) -> None: assert domain_name not in [domain.mail_host for domain in client.domains] +@pytest.mark.group(1) async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest): """Test that relation data, like connection data, is updated correctly when scaling.""" # Retrieve the list of current database unit names. @@ -169,6 +171,7 @@ async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest psycopg2.connect(primary_connection_string) +@pytest.mark.group(1) @pytest.mark.unstable async def test_nextcloud_db_blocked(ops_test: OpsTest, charm: str) -> None: async with ops_test.fast_forward(): @@ -210,6 +213,7 @@ async def test_nextcloud_db_blocked(ops_test: OpsTest, charm: str) -> None: await ops_test.model.remove_application("nextcloud", block_until_done=True) +@pytest.mark.group(1) async def test_sentry_db_blocked(ops_test: OpsTest, charm: str) -> None: async with ops_test.fast_forward(): # Deploy Sentry and its dependencies. @@ -289,6 +293,7 @@ async def test_sentry_db_blocked(ops_test: OpsTest, charm: str) -> None: ) +@pytest.mark.group(1) @pytest.mark.unstable async def test_weebl_db(ops_test: OpsTest, charm: str) -> None: async with ops_test.fast_forward(): @@ -316,6 +321,7 @@ async def test_weebl_db(ops_test: OpsTest, charm: str) -> None: await ops_test.model.remove_application("weebl", block_until_done=True) +@pytest.mark.group(1) @pytest.mark.juju2 async def test_canonical_livepatch_onprem_bundle_db(ops_test: OpsTest) -> None: # Deploy and test the Livepatch onprem bundle (using this PostgreSQL charm diff --git a/tests/integration/test_db_admin.py b/tests/integration/test_db_admin.py index fc588ba3c7..8103516e38 100644 --- a/tests/integration/test_db_admin.py +++ b/tests/integration/test_db_admin.py @@ -4,6 +4,7 @@ import json import logging +import pytest from landscape_api.base import HTTPError, run_query from pytest_operator.plugin import OpsTest @@ -32,6 +33,7 @@ RELATION_NAME = "db-admin" +@pytest.mark.group(1) async def test_landscape_scalable_bundle_db(ops_test: OpsTest, charm: str) -> None: """Deploy Landscape Scalable Bundle to test the 'db-admin' relation.""" await ops_test.model.deploy( diff --git a/tests/integration/test_password_rotation.py b/tests/integration/test_password_rotation.py index cada825418..543b4bb368 100644 --- a/tests/integration/test_password_rotation.py +++ b/tests/integration/test_password_rotation.py @@ -18,6 +18,7 @@ APP_NAME = METADATA["name"] +@pytest.mark.group(1) @pytest.mark.abort_on_fail @pytest.mark.skip_if_deployed async def test_deploy_active(ops_test: OpsTest): @@ -34,6 +35,7 @@ async def test_deploy_active(ops_test: OpsTest): await ops_test.model.wait_for_idle(apps=[APP_NAME], status="active", timeout=1000) +@pytest.mark.group(1) async def test_password_rotation(ops_test: OpsTest): """Test password rotation action.""" # Get the initial passwords set for the system users. diff --git a/tests/integration/test_plugins.py b/tests/integration/test_plugins.py index 60a6e99ff0..65e2679b3e 100644 --- a/tests/integration/test_plugins.py +++ b/tests/integration/test_plugins.py @@ -26,6 +26,7 @@ UNACCENT_EXTENSION_STATEMENT = "SELECT ts_lexize('unaccent','Hôtel');" +@pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_plugins(ops_test: OpsTest) -> None: """Build and deploy one unit of PostgreSQL and then test the available plugins.""" diff --git a/tests/integration/test_tls.py b/tests/integration/test_tls.py index 963afe13f1..eff22e6e0b 100644 --- a/tests/integration/test_tls.py +++ b/tests/integration/test_tls.py @@ -30,6 +30,7 @@ TLS_CERTIFICATES_APP_NAME = "tls-certificates-operator" +@pytest.mark.group(1) @pytest.mark.abort_on_fail @pytest.mark.skip_if_deployed async def test_deploy_active(ops_test: OpsTest): @@ -47,6 +48,7 @@ async def test_deploy_active(ops_test: OpsTest): # bundles don't wait between deploying charms. +@pytest.mark.group(1) async def test_tls_enabled(ops_test: OpsTest) -> None: """Test that TLS is enabled when relating to the TLS Certificates Operator.""" async with ops_test.fast_forward(): @@ -156,6 +158,7 @@ async def test_tls_enabled(ops_test: OpsTest) -> None: assert await check_tls_patroni_api(ops_test, unit.name, enabled=False) +@pytest.mark.group(1) @pytest.mark.skipif( not os.environ.get("RESTART_MACHINE_TEST"), reason="RESTART_MACHINE_TEST environment variable not set", From eaa88eb9dcc2b0eb9303067d4c8e07f6ed74e9c2 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Tue, 31 Oct 2023 12:00:38 +0000 Subject: [PATCH 04/14] fix pythonpath --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 27aed443fe..9042efbda3 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ all_path = {[vars]src_path} {[vars]tests_path} [testenv] set_env = - PYTHONPATH = {tox_root}:{tox_root}/lib:{[vars]src_path} + PYTHONPATH = {tox_root}/lib:{[vars]src_path} PY_COLORS = 1 allowlist_externals = poetry From ae4ab8e75c193a9ed40e05088504b52323476ece Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Wed, 1 Nov 2023 20:09:39 +0200 Subject: [PATCH 05/14] Switch to relative imports --- poetry.lock | 2 -- tests/integration/__init__.py | 2 ++ tests/integration/ha_tests/__init__.py | 2 ++ tests/integration/ha_tests/conftest.py | 4 ++-- tests/integration/ha_tests/helpers.py | 2 +- .../integration/ha_tests/test_replication.py | 4 ++-- .../ha_tests/test_restore_cluster.py | 14 ++++++------- .../integration/ha_tests/test_self_healing.py | 20 +++++++++---------- tests/integration/ha_tests/test_upgrade.py | 16 +++++++-------- .../ha_tests/test_upgrade_from_stable.py | 14 ++++++------- tests/integration/helpers.py | 1 + tests/integration/new_relations/__init__.py | 2 ++ .../new_relations/test_new_relations.py | 4 ++-- tests/integration/test_backups.py | 2 +- tests/integration/test_charm.py | 4 ++-- tests/integration/test_db.py | 2 +- tests/integration/test_db_admin.py | 2 +- tests/integration/test_password_rotation.py | 4 ++-- tests/integration/test_plugins.py | 2 +- tests/integration/test_tls.py | 4 ++-- 20 files changed, 56 insertions(+), 51 deletions(-) create mode 100644 tests/integration/__init__.py create mode 100644 tests/integration/ha_tests/__init__.py create mode 100644 tests/integration/new_relations/__init__.py diff --git a/poetry.lock b/poetry.lock index ffc74cddeb..e4bf6c0042 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1147,8 +1147,6 @@ files = [ {file = "psycopg2-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:426f9f29bde126913a20a96ff8ce7d73fd8a216cfb323b1f04da402d452853c3"}, {file = "psycopg2-2.9.9-cp311-cp311-win32.whl", hash = "sha256:ade01303ccf7ae12c356a5e10911c9e1c51136003a9a1d92f7aa9d010fb98372"}, {file = "psycopg2-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:121081ea2e76729acfb0673ff33755e8703d45e926e416cb59bae3a86c6a4981"}, - {file = "psycopg2-2.9.9-cp312-cp312-win32.whl", hash = "sha256:d735786acc7dd25815e89cc4ad529a43af779db2e25aa7c626de864127e5a024"}, - {file = "psycopg2-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:a7653d00b732afb6fc597e29c50ad28087dcb4fbfb28e86092277a559ae4e693"}, {file = "psycopg2-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:5e0d98cade4f0e0304d7d6f25bbfbc5bd186e07b38eac65379309c4ca3193efa"}, {file = "psycopg2-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:7e2dacf8b009a1c1e843b5213a87f7c544b2b042476ed7755be813eaf4e8347a"}, {file = "psycopg2-2.9.9-cp38-cp38-win32.whl", hash = "sha256:ff432630e510709564c01dafdbe996cb552e0b9f3f065eb89bdce5bd31fabf4c"}, diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 0000000000..db3bfe1a65 --- /dev/null +++ b/tests/integration/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2023 Canonical Ltd. +# See LICENSE file for licensing details. diff --git a/tests/integration/ha_tests/__init__.py b/tests/integration/ha_tests/__init__.py new file mode 100644 index 0000000000..db3bfe1a65 --- /dev/null +++ b/tests/integration/ha_tests/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2023 Canonical Ltd. +# See LICENSE file for licensing details. diff --git a/tests/integration/ha_tests/conftest.py b/tests/integration/ha_tests/conftest.py index 1a8d8f1192..83836743da 100644 --- a/tests/integration/ha_tests/conftest.py +++ b/tests/integration/ha_tests/conftest.py @@ -7,7 +7,8 @@ from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_delay, wait_fixed -from tests.integration.ha_tests.helpers import ( +from ..helpers import run_command_on_unit +from .helpers import ( APPLICATION_NAME, ORIGINAL_RESTART_CONDITION, RESTART_CONDITION, @@ -18,7 +19,6 @@ get_postgresql_parameter, update_restart_condition, ) -from tests.integration.helpers import run_command_on_unit @pytest.fixture() diff --git a/tests/integration/ha_tests/helpers.py b/tests/integration/ha_tests/helpers.py index e4b4010309..4bc6288c7e 100644 --- a/tests/integration/ha_tests/helpers.py +++ b/tests/integration/ha_tests/helpers.py @@ -20,7 +20,7 @@ wait_fixed, ) -from tests.integration.helpers import db_connect, get_unit_address, run_command_on_unit +from ..helpers import db_connect, get_unit_address, run_command_on_unit APPLICATION_NAME = "postgresql-test-app" METADATA = yaml.safe_load(Path("./metadata.yaml").read_text()) diff --git a/tests/integration/ha_tests/test_replication.py b/tests/integration/ha_tests/test_replication.py index 72924ba5e5..262f876e2b 100644 --- a/tests/integration/ha_tests/test_replication.py +++ b/tests/integration/ha_tests/test_replication.py @@ -6,7 +6,8 @@ from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_delay, wait_fixed -from tests.integration.ha_tests.helpers import ( +from ..helpers import CHARM_SERIES, db_connect, scale_application +from .helpers import ( APPLICATION_NAME, app_name, are_writes_increasing, @@ -16,7 +17,6 @@ get_primary, start_continuous_writes, ) -from tests.integration.helpers import CHARM_SERIES, db_connect, scale_application @pytest.mark.group(1) diff --git a/tests/integration/ha_tests/test_restore_cluster.py b/tests/integration/ha_tests/test_restore_cluster.py index 6bd1e173e6..0eb55246f5 100644 --- a/tests/integration/ha_tests/test_restore_cluster.py +++ b/tests/integration/ha_tests/test_restore_cluster.py @@ -6,13 +6,7 @@ import pytest from pytest_operator.plugin import OpsTest -from tests.integration.ha_tests.helpers import ( - add_unit_with_storage, - get_patroni_cluster, - reused_full_cluster_recovery_storage, - storage_id, -) -from tests.integration.helpers import ( +from ..helpers import ( CHARM_SERIES, db_connect, get_password, @@ -20,6 +14,12 @@ get_unit_address, set_password, ) +from .helpers import ( + add_unit_with_storage, + get_patroni_cluster, + reused_full_cluster_recovery_storage, + storage_id, +) FIRST_APPLICATION = "first-cluster" SECOND_APPLICATION = "second-cluster" diff --git a/tests/integration/ha_tests/test_self_healing.py b/tests/integration/ha_tests/test_self_healing.py index 3930de9b45..4327ac9a9c 100644 --- a/tests/integration/ha_tests/test_self_healing.py +++ b/tests/integration/ha_tests/test_self_healing.py @@ -8,8 +8,16 @@ from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_delay, wait_fixed -from tests.integration.ha_tests.conftest import APPLICATION_NAME -from tests.integration.ha_tests.helpers import ( +from ..helpers import ( + CHARM_SERIES, + db_connect, + get_machine_from_unit, + get_password, + get_unit_address, + run_command_on_unit, +) +from .conftest import APPLICATION_NAME +from .helpers import ( METADATA, ORIGINAL_RESTART_CONDITION, add_unit_with_storage, @@ -43,14 +51,6 @@ update_restart_condition, wait_network_restore, ) -from tests.integration.helpers import ( - CHARM_SERIES, - db_connect, - get_machine_from_unit, - get_password, - get_unit_address, - run_command_on_unit, -) logger = logging.getLogger(__name__) diff --git a/tests/integration/ha_tests/test_upgrade.py b/tests/integration/ha_tests/test_upgrade.py index 735085599d..6f10dfd0b8 100644 --- a/tests/integration/ha_tests/test_upgrade.py +++ b/tests/integration/ha_tests/test_upgrade.py @@ -11,19 +11,19 @@ import pytest from pytest_operator.plugin import OpsTest -from tests.integration.ha_tests.helpers import ( - APPLICATION_NAME, - are_writes_increasing, - check_writes, - start_continuous_writes, -) -from tests.integration.helpers import ( +from ..helpers import ( DATABASE_APP_NAME, count_switchovers, get_leader_unit, get_primary, ) -from tests.integration.new_relations.helpers import get_application_relation_data +from ..new_relations.helpers import get_application_relation_data +from .helpers import ( + APPLICATION_NAME, + are_writes_increasing, + check_writes, + start_continuous_writes, +) logger = logging.getLogger(__name__) diff --git a/tests/integration/ha_tests/test_upgrade_from_stable.py b/tests/integration/ha_tests/test_upgrade_from_stable.py index 88e137a597..4c99d3ef60 100644 --- a/tests/integration/ha_tests/test_upgrade_from_stable.py +++ b/tests/integration/ha_tests/test_upgrade_from_stable.py @@ -6,19 +6,19 @@ import pytest from pytest_operator.plugin import OpsTest -from tests.integration.ha_tests.helpers import ( - APPLICATION_NAME, - are_writes_increasing, - check_writes, - start_continuous_writes, -) -from tests.integration.helpers import ( +from ..helpers import ( DATABASE_APP_NAME, count_switchovers, get_leader_unit, get_primary, remove_chown_workaround, ) +from .helpers import ( + APPLICATION_NAME, + are_writes_increasing, + check_writes, + start_continuous_writes, +) logger = logging.getLogger(__name__) diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index 24e7a6c0a9..c0bb00cae4 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -33,6 +33,7 @@ CHARM_SERIES = "jammy" METADATA = yaml.safe_load(Path("./metadata.yaml").read_text()) DATABASE_APP_NAME = METADATA["name"] +STORAGE_PATH = METADATA["storage"]["pgdata"]["location"] async def build_connection_string( diff --git a/tests/integration/new_relations/__init__.py b/tests/integration/new_relations/__init__.py new file mode 100644 index 0000000000..db3bfe1a65 --- /dev/null +++ b/tests/integration/new_relations/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2023 Canonical Ltd. +# See LICENSE file for licensing details. diff --git a/tests/integration/new_relations/test_new_relations.py b/tests/integration/new_relations/test_new_relations.py index 88266cb366..9d68acee23 100644 --- a/tests/integration/new_relations/test_new_relations.py +++ b/tests/integration/new_relations/test_new_relations.py @@ -12,8 +12,8 @@ import yaml from pytest_operator.plugin import OpsTest -from tests.integration.helpers import CHARM_SERIES, scale_application -from tests.integration.new_relations.helpers import ( +from ..helpers import CHARM_SERIES, scale_application +from .helpers import ( build_connection_string, check_relation_data_existence, get_application_relation_data, diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index 1a943e9aa1..dc36430820 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -10,7 +10,7 @@ from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_attempt, wait_exponential -from tests.integration.helpers import ( +from .helpers import ( CHARM_SERIES, DATABASE_APP_NAME, construct_endpoint, diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index a693a2c802..cb222546dc 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -12,10 +12,10 @@ from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_attempt, wait_exponential -from tests.helpers import STORAGE_PATH -from tests.integration.helpers import ( +from .helpers import ( CHARM_SERIES, DATABASE_APP_NAME, + STORAGE_PATH, check_cluster_members, convert_records_to_dict, db_connect, diff --git a/tests/integration/test_db.py b/tests/integration/test_db.py index 9ee3a62b94..aebed37039 100644 --- a/tests/integration/test_db.py +++ b/tests/integration/test_db.py @@ -11,7 +11,7 @@ from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_delay, wait_fixed -from tests.integration.helpers import ( +from .helpers import ( CHARM_SERIES, DATABASE_APP_NAME, build_connection_string, diff --git a/tests/integration/test_db_admin.py b/tests/integration/test_db_admin.py index 8103516e38..1fa4c1d21c 100644 --- a/tests/integration/test_db_admin.py +++ b/tests/integration/test_db_admin.py @@ -8,7 +8,7 @@ from landscape_api.base import HTTPError, run_query from pytest_operator.plugin import OpsTest -from tests.integration.helpers import ( +from .helpers import ( CHARM_SERIES, DATABASE_APP_NAME, check_database_users_existence, diff --git a/tests/integration/test_password_rotation.py b/tests/integration/test_password_rotation.py index 543b4bb368..0cc19fcae0 100644 --- a/tests/integration/test_password_rotation.py +++ b/tests/integration/test_password_rotation.py @@ -6,9 +6,9 @@ import pytest from pytest_operator.plugin import OpsTest -from tests.helpers import METADATA -from tests.integration.helpers import ( +from .helpers import ( CHARM_SERIES, + METADATA, check_patroni, get_password, restart_patroni, diff --git a/tests/integration/test_plugins.py b/tests/integration/test_plugins.py index 65e2679b3e..e616e9b351 100644 --- a/tests/integration/test_plugins.py +++ b/tests/integration/test_plugins.py @@ -7,7 +7,7 @@ import pytest as pytest from pytest_operator.plugin import OpsTest -from tests.integration.helpers import ( +from .helpers import ( CHARM_SERIES, DATABASE_APP_NAME, db_connect, diff --git a/tests/integration/test_tls.py b/tests/integration/test_tls.py index eff22e6e0b..6d82a6b720 100644 --- a/tests/integration/test_tls.py +++ b/tests/integration/test_tls.py @@ -8,10 +8,10 @@ from pytest_operator.plugin import OpsTest from tenacity import Retrying, stop_after_attempt, stop_after_delay, wait_exponential -from tests.helpers import METADATA -from tests.integration.helpers import ( +from .helpers import ( CHARM_SERIES, DATABASE_APP_NAME, + METADATA, change_primary_start_timeout, check_tls, check_tls_patroni_api, From fbd411baf10b0dc369ac3dce0a82554cc6fb2353 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Thu, 2 Nov 2023 12:30:01 +0200 Subject: [PATCH 06/14] Switch to binary psycopg2 for test deps --- poetry.lock | 87 ++++++++++++++++++++++++++++++++++++++++++-------- pyproject.toml | 4 +-- 2 files changed, 76 insertions(+), 15 deletions(-) diff --git a/poetry.lock b/poetry.lock index e4bf6c0042..6fe0858c05 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1137,23 +1137,84 @@ files = [ ] [[package]] -name = "psycopg2" +name = "psycopg2-binary" version = "2.9.9" description = "psycopg2 - Python-PostgreSQL Database Adapter" optional = false python-versions = ">=3.7" files = [ - {file = "psycopg2-2.9.9-cp310-cp310-win32.whl", hash = "sha256:38a8dcc6856f569068b47de286b472b7c473ac7977243593a288ebce0dc89516"}, - {file = "psycopg2-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:426f9f29bde126913a20a96ff8ce7d73fd8a216cfb323b1f04da402d452853c3"}, - {file = "psycopg2-2.9.9-cp311-cp311-win32.whl", hash = "sha256:ade01303ccf7ae12c356a5e10911c9e1c51136003a9a1d92f7aa9d010fb98372"}, - {file = "psycopg2-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:121081ea2e76729acfb0673ff33755e8703d45e926e416cb59bae3a86c6a4981"}, - {file = "psycopg2-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:5e0d98cade4f0e0304d7d6f25bbfbc5bd186e07b38eac65379309c4ca3193efa"}, - {file = "psycopg2-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:7e2dacf8b009a1c1e843b5213a87f7c544b2b042476ed7755be813eaf4e8347a"}, - {file = "psycopg2-2.9.9-cp38-cp38-win32.whl", hash = "sha256:ff432630e510709564c01dafdbe996cb552e0b9f3f065eb89bdce5bd31fabf4c"}, - {file = "psycopg2-2.9.9-cp38-cp38-win_amd64.whl", hash = "sha256:bac58c024c9922c23550af2a581998624d6e02350f4ae9c5f0bc642c633a2d5e"}, - {file = "psycopg2-2.9.9-cp39-cp39-win32.whl", hash = "sha256:c92811b2d4c9b6ea0285942b2e7cac98a59e166d59c588fe5cfe1eda58e72d59"}, - {file = "psycopg2-2.9.9-cp39-cp39-win_amd64.whl", hash = "sha256:de80739447af31525feddeb8effd640782cf5998e1a4e9192ebdf829717e3913"}, - {file = "psycopg2-2.9.9.tar.gz", hash = "sha256:d1454bde93fb1e224166811694d600e746430c006fbb031ea06ecc2ea41bf156"}, + {file = "psycopg2-binary-2.9.9.tar.gz", hash = "sha256:7f01846810177d829c7692f1f5ada8096762d9172af1b1a28d4ab5b77c923c1c"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c2470da5418b76232f02a2fcd2229537bb2d5a7096674ce61859c3229f2eb202"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c6af2a6d4b7ee9615cbb162b0738f6e1fd1f5c3eda7e5da17861eacf4c717ea7"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:75723c3c0fbbf34350b46a3199eb50638ab22a0228f93fb472ef4d9becc2382b"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:83791a65b51ad6ee6cf0845634859d69a038ea9b03d7b26e703f94c7e93dbcf9"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0ef4854e82c09e84cc63084a9e4ccd6d9b154f1dbdd283efb92ecd0b5e2b8c84"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ed1184ab8f113e8d660ce49a56390ca181f2981066acc27cf637d5c1e10ce46e"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d2997c458c690ec2bc6b0b7ecbafd02b029b7b4283078d3b32a852a7ce3ddd98"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b58b4710c7f4161b5e9dcbe73bb7c62d65670a87df7bcce9e1faaad43e715245"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:0c009475ee389757e6e34611d75f6e4f05f0cf5ebb76c6037508318e1a1e0d7e"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8dbf6d1bc73f1d04ec1734bae3b4fb0ee3cb2a493d35ede9badbeb901fb40f6f"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-win32.whl", hash = "sha256:3f78fd71c4f43a13d342be74ebbc0666fe1f555b8837eb113cb7416856c79682"}, + {file = "psycopg2_binary-2.9.9-cp310-cp310-win_amd64.whl", hash = "sha256:876801744b0dee379e4e3c38b76fc89f88834bb15bf92ee07d94acd06ec890a0"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ee825e70b1a209475622f7f7b776785bd68f34af6e7a46e2e42f27b659b5bc26"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1ea665f8ce695bcc37a90ee52de7a7980be5161375d42a0b6c6abedbf0d81f0f"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:143072318f793f53819048fdfe30c321890af0c3ec7cb1dfc9cc87aa88241de2"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c332c8d69fb64979ebf76613c66b985414927a40f8defa16cf1bc028b7b0a7b0"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7fc5a5acafb7d6ccca13bfa8c90f8c51f13d8fb87d95656d3950f0158d3ce53"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:977646e05232579d2e7b9c59e21dbe5261f403a88417f6a6512e70d3f8a046be"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b6356793b84728d9d50ead16ab43c187673831e9d4019013f1402c41b1db9b27"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:bc7bb56d04601d443f24094e9e31ae6deec9ccb23581f75343feebaf30423359"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:77853062a2c45be16fd6b8d6de2a99278ee1d985a7bd8b103e97e41c034006d2"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:78151aa3ec21dccd5cdef6c74c3e73386dcdfaf19bced944169697d7ac7482fc"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-win32.whl", hash = "sha256:dc4926288b2a3e9fd7b50dc6a1909a13bbdadfc67d93f3374d984e56f885579d"}, + {file = "psycopg2_binary-2.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:b76bedd166805480ab069612119ea636f5ab8f8771e640ae103e05a4aae3e417"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:8532fd6e6e2dc57bcb3bc90b079c60de896d2128c5d9d6f24a63875a95a088cf"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0605eaed3eb239e87df0d5e3c6489daae3f7388d455d0c0b4df899519c6a38d"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f8544b092a29a6ddd72f3556a9fcf249ec412e10ad28be6a0c0d948924f2212"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2d423c8d8a3c82d08fe8af900ad5b613ce3632a1249fd6a223941d0735fce493"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e5afae772c00980525f6d6ecf7cbca55676296b580c0e6abb407f15f3706996"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e6f98446430fdf41bd36d4faa6cb409f5140c1c2cf58ce0bbdaf16af7d3f119"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c77e3d1862452565875eb31bdb45ac62502feabbd53429fdc39a1cc341d681ba"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:cb16c65dcb648d0a43a2521f2f0a2300f40639f6f8c1ecbc662141e4e3e1ee07"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:911dda9c487075abd54e644ccdf5e5c16773470a6a5d3826fda76699410066fb"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:57fede879f08d23c85140a360c6a77709113efd1c993923c59fde17aa27599fe"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-win32.whl", hash = "sha256:64cf30263844fa208851ebb13b0732ce674d8ec6a0c86a4e160495d299ba3c93"}, + {file = "psycopg2_binary-2.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:81ff62668af011f9a48787564ab7eded4e9fb17a4a6a74af5ffa6a457400d2ab"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2293b001e319ab0d869d660a704942c9e2cce19745262a8aba2115ef41a0a42a"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:03ef7df18daf2c4c07e2695e8cfd5ee7f748a1d54d802330985a78d2a5a6dca9"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a602ea5aff39bb9fac6308e9c9d82b9a35c2bf288e184a816002c9fae930b77"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8359bf4791968c5a78c56103702000105501adb557f3cf772b2c207284273984"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:275ff571376626195ab95a746e6a04c7df8ea34638b99fc11160de91f2fef503"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:f9b5571d33660d5009a8b3c25dc1db560206e2d2f89d3df1cb32d72c0d117d52"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:420f9bbf47a02616e8554e825208cb947969451978dceb77f95ad09c37791dae"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:4154ad09dac630a0f13f37b583eae260c6aa885d67dfbccb5b02c33f31a6d420"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a148c5d507bb9b4f2030a2025c545fccb0e1ef317393eaba42e7eabd28eb6041"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-win32.whl", hash = "sha256:68fc1f1ba168724771e38bee37d940d2865cb0f562380a1fb1ffb428b75cb692"}, + {file = "psycopg2_binary-2.9.9-cp37-cp37m-win_amd64.whl", hash = "sha256:281309265596e388ef483250db3640e5f414168c5a67e9c665cafce9492eda2f"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:60989127da422b74a04345096c10d416c2b41bd7bf2a380eb541059e4e999980"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:246b123cc54bb5361588acc54218c8c9fb73068bf227a4a531d8ed56fa3ca7d6"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34eccd14566f8fe14b2b95bb13b11572f7c7d5c36da61caf414d23b91fcc5d94"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18d0ef97766055fec15b5de2c06dd8e7654705ce3e5e5eed3b6651a1d2a9a152"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d3f82c171b4ccd83bbaf35aa05e44e690113bd4f3b7b6cc54d2219b132f3ae55"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ead20f7913a9c1e894aebe47cccf9dc834e1618b7aa96155d2091a626e59c972"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ca49a8119c6cbd77375ae303b0cfd8c11f011abbbd64601167ecca18a87e7cdd"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:323ba25b92454adb36fa425dc5cf6f8f19f78948cbad2e7bc6cdf7b0d7982e59"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:1236ed0952fbd919c100bc839eaa4a39ebc397ed1c08a97fc45fee2a595aa1b3"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:729177eaf0aefca0994ce4cffe96ad3c75e377c7b6f4efa59ebf003b6d398716"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-win32.whl", hash = "sha256:804d99b24ad523a1fe18cc707bf741670332f7c7412e9d49cb5eab67e886b9b5"}, + {file = "psycopg2_binary-2.9.9-cp38-cp38-win_amd64.whl", hash = "sha256:a6cdcc3ede532f4a4b96000b6362099591ab4a3e913d70bcbac2b56c872446f7"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:72dffbd8b4194858d0941062a9766f8297e8868e1dd07a7b36212aaa90f49472"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:30dcc86377618a4c8f3b72418df92e77be4254d8f89f14b8e8f57d6d43603c0f"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:31a34c508c003a4347d389a9e6fcc2307cc2150eb516462a7a17512130de109e"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:15208be1c50b99203fe88d15695f22a5bed95ab3f84354c494bcb1d08557df67"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1873aade94b74715be2246321c8650cabf5a0d098a95bab81145ffffa4c13876"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a58c98a7e9c021f357348867f537017057c2ed7f77337fd914d0bedb35dace7"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4686818798f9194d03c9129a4d9a702d9e113a89cb03bffe08c6cf799e053291"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ebdc36bea43063116f0486869652cb2ed7032dbc59fbcb4445c4862b5c1ecf7f"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:ca08decd2697fdea0aea364b370b1249d47336aec935f87b8bbfd7da5b2ee9c1"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ac05fb791acf5e1a3e39402641827780fe44d27e72567a000412c648a85ba860"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-win32.whl", hash = "sha256:9dba73be7305b399924709b91682299794887cbbd88e38226ed9f6712eabee90"}, + {file = "psycopg2_binary-2.9.9-cp39-cp39-win_amd64.whl", hash = "sha256:f7ae5d65ccfbebdfa761585228eb4d0df3a8b15cfb53bd953e713e09fbb12957"}, ] [[package]] @@ -1997,4 +2058,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10.6" -content-hash = "ef37672b09c8185d5ff25298d744fb1e37792ccad26c8080ee7cd1355fd684eb" +content-hash = "f85d4726f6baa77fe06879b2cf2e1231a2449da56ca6ca41a3542b6f4701c609" diff --git a/pyproject.toml b/pyproject.toml index 2831db7a3b..1c060047ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ coverage = {extras = ["toml"], version = "^7.3.2"} pytest = "^7.4.0" pytest-asyncio = "^0.21.1" jsonschema = "^4.19.1" -psycopg2 = {version = "^2.9.9", extras = ["binary"]} +psycopg2-binary = "^2.9.9" jinja2 = "^3.1.2" [tool.poetry.group.integration] @@ -74,7 +74,7 @@ boto3 = "^1.28.70" tenacity = "^8.2.3" landscape-api-py3 = "^0.9.0" mailmanclient = "^3.3.5" -psycopg2 = {version = "^2.9.9", extras = ["binary"]} +psycopg2-binary = "^2.9.9" # Testing tools configuration [tool.coverage.run] From 49fe260d300589758dfc4ac789b6a5abb968bfd1 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Thu, 9 Nov 2023 12:36:21 +0200 Subject: [PATCH 07/14] Conditionally skip tests --- .github/workflows/ci.yaml | 2 +- poetry.lock | 20 ++---------------- pyproject.toml | 1 - tests/integration/test_backups.py | 34 ++++++++++++++++++++----------- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8caf29a319..bb4a07d45f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,5 +61,5 @@ jobs: "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", - "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", + "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}" } diff --git a/poetry.lock b/poetry.lock index 6fe0858c05..90c79e1a65 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. [[package]] name = "appnope" @@ -1457,22 +1457,6 @@ pytest = ">=7.0.0" docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] -[[package]] -name = "pytest-github-secrets" -version = "0.1.0" -description = "" -optional = false -python-versions = "^3.8" -files = [] -develop = false - -[package.source] -type = "git" -url = "https://github.com/canonical/data-platform-workflows" -reference = "v5.1.2" -resolved_reference = "3cc668dc10fa7316da9600c296ca7640d7d83222" -subdirectory = "python/pytest_plugins/github_secrets" - [[package]] name = "pytest-operator" version = "0.29.0" @@ -2058,4 +2042,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10.6" -content-hash = "f85d4726f6baa77fe06879b2cf2e1231a2449da56ca6ca41a3542b6f4701c609" +content-hash = "73c1278c20dd2fa473126233af7f98f41676b11bb91773a0ea03e7564526f54f" diff --git a/pyproject.toml b/pyproject.toml index aa6892a8d7..027bc6a289 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,6 @@ optional = true [tool.poetry.group.integration.dependencies] pytest = "^7.4.0" -pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v5.1.2", subdirectory = "python/pytest_plugins/github_secrets"} pytest-operator = "^0.29.0" pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v5.1.2", subdirectory = "python/pytest_plugins/pytest_operator_cache"} pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v5.1.2", subdirectory = "python/pytest_plugins/pytest_operator_groups"} diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index a12d1398fb..1f200749df 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -1,6 +1,8 @@ #!/usr/bin/env python3 # Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. +import json +import os import logging import uuid from typing import Dict, Tuple @@ -36,8 +38,9 @@ @pytest.fixture(scope="module") -async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: +async def cloud_configs(ops_test: OpsTest) -> None: # Define some configurations and credentials. + secrets = json.loads(os.environ.get("SECRETS_FROM_GITHUB", "{}")) configs = { AWS: { "endpoint": "https://s3.amazonaws.com", @@ -54,17 +57,19 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: } credentials = { AWS: { - "access-key": github_secrets["AWS_ACCESS_KEY"], - "secret-key": github_secrets["AWS_SECRET_KEY"], + "access-key": secrets.get("AWS_ACCESS_KEY"), + "secret-key": secrets.get("AWS_SECRET_KEY"), }, GCP: { - "access-key": github_secrets["GCP_ACCESS_KEY"], - "secret-key": github_secrets["GCP_SECRET_KEY"], + "access-key": secrets.get("GCP_ACCESS_KEY"), + "secret-key": secrets.get("GCP_SECRET_KEY"), }, } yield configs, credentials # Delete the previously created objects. for cloud, config in configs.items(): + if not credentials[cloud].get("secret-key"): + continue session = boto3.session.Session( aws_access_key_id=credentials[cloud]["access-key"], aws_secret_access_key=credentials[cloud]["secret-key"], @@ -79,12 +84,6 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: bucket_object.delete() -@pytest.mark.group(1) -async def test_none() -> None: - """Empty test so that the suite will not fail if all tests are skippedi.""" - pass - - @pytest.mark.group(1) @pytest.mark.abort_on_fail async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: @@ -98,6 +97,11 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No await ops_test.model.deploy(TLS_CERTIFICATES_APP_NAME, config=config, channel="legacy/stable") for cloud, config in cloud_configs[0].items(): + # Check if credentials are available + if not cloud_configs[1][cloud]["secret-key"]: + logger.warning(f"Skipping tests for {cloud}. No credentials provided") + continue + # Deploy and relate PostgreSQL to S3 integrator (one database app for each cloud for now # as archive_mode is disabled after restoring the backup) and to TLS Certificates Operator # (to be able to create backups from replicas). @@ -224,8 +228,11 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No @pytest.mark.group(1) -async def test_restore_on_new_cluster(ops_test: OpsTest) -> None: +async def test_restore_on_new_cluster(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: """Test that is possible to restore a backup to another PostgreSQL cluster.""" + if not cloud_configs[1][AWS]["secret-key"]: + pytest.skip("No AWS credentials") + charm = await ops_test.build_charm(".") database_app_name = f"new-{DATABASE_APP_NAME}" await ops_test.model.deploy( @@ -306,6 +313,9 @@ async def test_invalid_config_and_recovery_after_fixing_it( ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict] ) -> None: """Test that the charm can handle invalid and valid backup configurations.""" + if not cloud_configs[1][AWS]["secret-key"]: + pytest.skip("No AWS credentials") + database_app_name = f"new-{DATABASE_APP_NAME}" # Provide invalid backup configurations. From 8e3fd7984254667af1e52578485242727c470ffa Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Thu, 9 Nov 2023 13:53:47 +0200 Subject: [PATCH 08/14] Bump timeouts --- tests/integration/test_backups.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index 432fc8daea..74f12249a3 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -125,7 +125,7 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No ) await action.wait() await ops_test.model.wait_for_idle( - apps=[database_app_name, S3_INTEGRATOR_APP_NAME], status="active", timeout=1000 + apps=[database_app_name, S3_INTEGRATOR_APP_NAME], status="active", timeout=1500 ) primary = await get_primary(ops_test, f"{database_app_name}/0") From 837662644efdf9b946ddaf8d6f62f3a0ac730d31 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Thu, 9 Nov 2023 16:49:18 +0200 Subject: [PATCH 09/14] Skipping fixtures and bump in timeouts --- tests/integration/conftest.py | 14 ++++++++++++++ tests/integration/ha_tests/test_replication.py | 2 +- tests/integration/ha_tests/test_restore_cluster.py | 2 +- tests/integration/ha_tests/test_self_healing.py | 2 +- tests/integration/ha_tests/test_upgrade.py | 2 +- tests/integration/test_charm.py | 2 +- tests/integration/test_db.py | 5 ++--- tests/integration/test_db_admin.py | 2 +- tests/integration/test_password_rotation.py | 2 +- tests/integration/test_plugins.py | 2 +- 10 files changed, 24 insertions(+), 11 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 87bd24fb9b..9379120ae9 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -10,3 +10,17 @@ async def charm(ops_test: OpsTest): """Build the charm-under-test.""" # Build charm from local source folder. yield await ops_test.build_charm(".") + + +@pytest.fixture(scope="module") +def juju2(ops_test): + """Skip test if it is not on juju2.""" + if hasattr(ops_test.model, "list_secrets"): + pytest.skip("Test can't run on Juju3") + + +@pytest.fixture(scope="module") +def juju3(ops_test): + """Skip test if it is not on juju3.""" + if not hasattr(ops_test.model, "list_secrets"): + pytest.skip("Test can't run on Juju2") diff --git a/tests/integration/ha_tests/test_replication.py b/tests/integration/ha_tests/test_replication.py index 262f876e2b..abb7d04025 100644 --- a/tests/integration/ha_tests/test_replication.py +++ b/tests/integration/ha_tests/test_replication.py @@ -49,7 +49,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: if wait_for_apps: async with ops_test.fast_forward(): - await ops_test.model.wait_for_idle(status="active", timeout=1000) + await ops_test.model.wait_for_idle(status="active", timeout=1500) @pytest.mark.group(1) diff --git a/tests/integration/ha_tests/test_restore_cluster.py b/tests/integration/ha_tests/test_restore_cluster.py index 0eb55246f5..1d11d4d5e5 100644 --- a/tests/integration/ha_tests/test_restore_cluster.py +++ b/tests/integration/ha_tests/test_restore_cluster.py @@ -55,7 +55,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: config={"profile": "testing"}, ) - await ops_test.model.wait_for_idle(status="active", timeout=1000) + await ops_test.model.wait_for_idle(status="active", timeout=1500) # TODO have a better way to bootstrap clusters with existing storage primary = await get_primary( diff --git a/tests/integration/ha_tests/test_self_healing.py b/tests/integration/ha_tests/test_self_healing.py index 4327ac9a9c..ba2f5c485d 100644 --- a/tests/integration/ha_tests/test_self_healing.py +++ b/tests/integration/ha_tests/test_self_healing.py @@ -91,7 +91,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: if wait_for_apps: async with ops_test.fast_forward(): - await ops_test.model.wait_for_idle(status="active", timeout=1000) + await ops_test.model.wait_for_idle(status="active", timeout=1500) @pytest.mark.group(1) diff --git a/tests/integration/ha_tests/test_upgrade.py b/tests/integration/ha_tests/test_upgrade.py index 6f10dfd0b8..d8b916087b 100644 --- a/tests/integration/ha_tests/test_upgrade.py +++ b/tests/integration/ha_tests/test_upgrade.py @@ -48,7 +48,7 @@ async def test_deploy_latest(ops_test: OpsTest) -> None: logger.info("Wait for applications to become active") async with ops_test.fast_forward(): await ops_test.model.wait_for_idle( - apps=[DATABASE_APP_NAME, APPLICATION_NAME], status="active", timeout=1000 + apps=[DATABASE_APP_NAME, APPLICATION_NAME], status="active", timeout=1500 ) assert len(ops_test.model.applications[DATABASE_APP_NAME].units) == 3 diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index cb222546dc..2ddc6152a0 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -52,7 +52,7 @@ async def test_deploy(ops_test: OpsTest, charm: str): # Reducing the update status frequency to speed up the triggering of deferred events. await ops_test.model.set_config({"update-status-hook-interval": "10s"}) - await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=1000) + await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=1500) assert ops_test.model.applications[DATABASE_APP_NAME].units[0].workload_status == "active" diff --git a/tests/integration/test_db.py b/tests/integration/test_db.py index aebed37039..8f5b39db41 100644 --- a/tests/integration/test_db.py +++ b/tests/integration/test_db.py @@ -48,7 +48,7 @@ async def test_mailman3_core_db(ops_test: OpsTest, charm: str) -> None: await ops_test.model.wait_for_idle( apps=[DATABASE_APP_NAME], status="active", - timeout=1000, + timeout=1500, wait_for_exact_units=DATABASE_UNITS, ) @@ -322,8 +322,7 @@ async def test_weebl_db(ops_test: OpsTest, charm: str) -> None: @pytest.mark.group(1) -@pytest.mark.juju2 -async def test_canonical_livepatch_onprem_bundle_db(ops_test: OpsTest) -> None: +async def test_canonical_livepatch_onprem_bundle_db(ops_test: OpsTest, juju2) -> None: # Deploy and test the Livepatch onprem bundle (using this PostgreSQL charm # and an overlay to make the Ubuntu Advantage charm work with PostgreSQL). # We intentionally wait for the `✘ sync_token not set` status message as we diff --git a/tests/integration/test_db_admin.py b/tests/integration/test_db_admin.py index 1fa4c1d21c..77ff93b59a 100644 --- a/tests/integration/test_db_admin.py +++ b/tests/integration/test_db_admin.py @@ -119,7 +119,7 @@ async def test_landscape_scalable_bundle_db(ops_test: OpsTest, charm: str) -> No # rebooting the unit machine in the middle of a hook (what is needed when the issue from # https://bugs.launchpad.net/juju/+bug/1999758 happens). await ops_test.model.wait_for_idle( - apps=[DATABASE_APP_NAME], status="active", timeout=600, raise_on_error=False + apps=[DATABASE_APP_NAME], status="active", timeout=1500, raise_on_error=False ) await ensure_correct_relation_data(ops_test, DATABASE_UNITS, LANDSCAPE_APP_NAME, RELATION_NAME) diff --git a/tests/integration/test_password_rotation.py b/tests/integration/test_password_rotation.py index 0cc19fcae0..c4286a1a10 100644 --- a/tests/integration/test_password_rotation.py +++ b/tests/integration/test_password_rotation.py @@ -32,7 +32,7 @@ async def test_deploy_active(ops_test: OpsTest): series=CHARM_SERIES, config={"profile": "testing"}, ) - await ops_test.model.wait_for_idle(apps=[APP_NAME], status="active", timeout=1000) + await ops_test.model.wait_for_idle(apps=[APP_NAME], status="active", timeout=1500) @pytest.mark.group(1) diff --git a/tests/integration/test_plugins.py b/tests/integration/test_plugins.py index e616e9b351..282e400b6d 100644 --- a/tests/integration/test_plugins.py +++ b/tests/integration/test_plugins.py @@ -39,7 +39,7 @@ async def test_plugins(ops_test: OpsTest) -> None: series=CHARM_SERIES, config={"profile": "testing"}, ) - await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active") + await ops_test.model.wait_for_idle(apps=[DATABASE_APP_NAME], status="active", timeout=1500) # Check that the available plugins are disabled. primary = await get_primary(ops_test, f"{DATABASE_APP_NAME}/0") From 24c9f8c1d8754f426833594096dc5b35c5ad6cdc Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Fri, 10 Nov 2023 09:38:01 +0200 Subject: [PATCH 10/14] Juju matrix --- .github/workflows/ci.yaml | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bb4a07d45f..1362292e9e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,16 +50,29 @@ jobs: name: Integration test charm needs: - build - uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large - with: - artifact-name: ${{ needs.build.outputs.artifact-name }} - cloud: lxd - juju-agent-version: 3.1.6 - secrets: - integration-test: | - { - "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", - "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", - "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", - "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}" - } + strategy: + fail-fast: false + matrix: + juju-snap-channel: ["2.9/stable", "3.1/stable"] + include: + - juju-snap-channel: "3.1/stable" + agent-version: "3.1.6" + libjuju-version: "3.2.0.1" + - juju-snap-channel: "2.9/stable" + agent-version: "2.9.45" + libjuju-version: "2.9.44.1" + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large + with: + artifact-name: ${{ needs.build.outputs.artifact-name }} + cloud: lxd + juju-agent-version: ${{ matrix.agent-version }} + channel: ${{ matrix.juju-snap-channel }} + libjuju-version-constraint: ${{ matrix.libjuju-version }} + secrets: + integration-test: | + { + "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", + "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", + "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", + "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}" + } From d7afbbc069c7be3785deafd3e86e2db13c703ad2 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Fri, 10 Nov 2023 10:24:48 +0200 Subject: [PATCH 11/14] Revert "Juju matrix" This reverts commit 24c9f8c1d8754f426833594096dc5b35c5ad6cdc. --- .github/workflows/ci.yaml | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1362292e9e..bb4a07d45f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,29 +50,16 @@ jobs: name: Integration test charm needs: - build - strategy: - fail-fast: false - matrix: - juju-snap-channel: ["2.9/stable", "3.1/stable"] - include: - - juju-snap-channel: "3.1/stable" - agent-version: "3.1.6" - libjuju-version: "3.2.0.1" - - juju-snap-channel: "2.9/stable" - agent-version: "2.9.45" - libjuju-version: "2.9.44.1" - uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large - with: - artifact-name: ${{ needs.build.outputs.artifact-name }} - cloud: lxd - juju-agent-version: ${{ matrix.agent-version }} - channel: ${{ matrix.juju-snap-channel }} - libjuju-version-constraint: ${{ matrix.libjuju-version }} - secrets: - integration-test: | - { - "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", - "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", - "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", - "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}" - } + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large + with: + artifact-name: ${{ needs.build.outputs.artifact-name }} + cloud: lxd + juju-agent-version: 3.1.6 + secrets: + integration-test: | + { + "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", + "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", + "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", + "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}" + } From 817c2fc3c2decb218bea090795f2cb0d2b99a861 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Fri, 10 Nov 2023 10:29:21 +0200 Subject: [PATCH 12/14] Juju2 job --- .github/workflows/ci.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bb4a07d45f..a764be08d8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,8 +46,8 @@ jobs: permissions: actions: write # Needed to manage GitHub Actions cache - integration-test: - name: Integration test charm + integration-test-juju3: + name: Integration test charm on Juju 3 needs: - build uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large @@ -55,6 +55,27 @@ jobs: artifact-name: ${{ needs.build.outputs.artifact-name }} cloud: lxd juju-agent-version: 3.1.6 + juju-snap-channel: "3.1/stable" + secrets: + integration-test: | + { + "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", + "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", + "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", + "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}" + } + + integration-test-juju2: + name: Integration test charm on Juju 2 + needs: + - build + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large + with: + artifact-name: ${{ needs.build.outputs.artifact-name }} + cloud: lxd + juju-agent-version: "2.9.45" + juju-snap-channel: "2.9/stable" + libjuju-version-constraint: "2.9.45.0" secrets: integration-test: | { From 2a0a3d3eb95699cb2889907d2581429a62593f8a Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Fri, 10 Nov 2023 11:49:59 +0200 Subject: [PATCH 13/14] Revert backup changes --- .github/workflows/ci.yaml | 6 +++-- poetry.lock | 18 +++++++++++++- pyproject.toml | 1 + tests/integration/test_backups.py | 41 +++++++++++-------------------- 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a764be08d8..1f266b7d0f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,6 +50,7 @@ jobs: name: Integration test charm on Juju 3 needs: - build + - lint uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large with: artifact-name: ${{ needs.build.outputs.artifact-name }} @@ -62,13 +63,14 @@ jobs: "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", - "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}" + "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", } integration-test-juju2: name: Integration test charm on Juju 2 needs: - build + - lint uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@test-large with: artifact-name: ${{ needs.build.outputs.artifact-name }} @@ -82,5 +84,5 @@ jobs: "AWS_ACCESS_KEY": "${{ secrets.AWS_ACCESS_KEY }}", "AWS_SECRET_KEY": "${{ secrets.AWS_SECRET_KEY }}", "GCP_ACCESS_KEY": "${{ secrets.GCP_ACCESS_KEY }}", - "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}" + "GCP_SECRET_KEY": "${{ secrets.GCP_SECRET_KEY }}", } diff --git a/poetry.lock b/poetry.lock index 3f4d3936bf..34f28a62d0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1457,6 +1457,22 @@ pytest = ">=7.0.0" docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] +[[package]] +name = "pytest-github-secrets" +version = "0.1.0" +description = "" +optional = false +python-versions = "^3.8" +files = [] +develop = false + +[package.source] +type = "git" +url = "https://github.com/canonical/data-platform-workflows" +reference = "v5.1.2" +resolved_reference = "3cc668dc10fa7316da9600c296ca7640d7d83222" +subdirectory = "python/pytest_plugins/github_secrets" + [[package]] name = "pytest-operator" version = "0.29.0" @@ -2042,4 +2058,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.10.6" -content-hash = "73c1278c20dd2fa473126233af7f98f41676b11bb91773a0ea03e7564526f54f" +content-hash = "f85d4726f6baa77fe06879b2cf2e1231a2449da56ca6ca41a3542b6f4701c609" diff --git a/pyproject.toml b/pyproject.toml index 027bc6a289..aa6892a8d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,7 @@ optional = true [tool.poetry.group.integration.dependencies] pytest = "^7.4.0" +pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v5.1.2", subdirectory = "python/pytest_plugins/github_secrets"} pytest-operator = "^0.29.0" pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v5.1.2", subdirectory = "python/pytest_plugins/pytest_operator_cache"} pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v5.1.2", subdirectory = "python/pytest_plugins/pytest_operator_groups"} diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index 74f12249a3..b8e474cd9a 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -1,9 +1,7 @@ #!/usr/bin/env python3 # Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. -import json import logging -import os import uuid from typing import Dict, Tuple @@ -38,9 +36,8 @@ @pytest.fixture(scope="module") -async def cloud_configs(ops_test: OpsTest) -> None: +async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: # Define some configurations and credentials. - secrets = json.loads(os.environ.get("SECRETS_FROM_GITHUB", "{}")) configs = { AWS: { "endpoint": "https://s3.amazonaws.com", @@ -57,19 +54,17 @@ async def cloud_configs(ops_test: OpsTest) -> None: } credentials = { AWS: { - "access-key": secrets.get("AWS_ACCESS_KEY"), - "secret-key": secrets.get("AWS_SECRET_KEY"), + "access-key": github_secrets["AWS_ACCESS_KEY"], + "secret-key": github_secrets["AWS_SECRET_KEY"], }, GCP: { - "access-key": secrets.get("GCP_ACCESS_KEY"), - "secret-key": secrets.get("GCP_SECRET_KEY"), + "access-key": github_secrets["GCP_ACCESS_KEY"], + "secret-key": github_secrets["GCP_SECRET_KEY"], }, } yield configs, credentials # Delete the previously created objects. for cloud, config in configs.items(): - if not credentials[cloud].get("secret-key"): - continue session = boto3.session.Session( aws_access_key_id=credentials[cloud]["access-key"], aws_secret_access_key=credentials[cloud]["secret-key"], @@ -84,7 +79,12 @@ async def cloud_configs(ops_test: OpsTest) -> None: bucket_object.delete() -@pytest.mark.group(1) +async def test_none() -> None: + """Empty test so that the suite will not fail if all tests are skippedi.""" + pass + + +@pytest.mark.uses_secrets @pytest.mark.abort_on_fail async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: """Build and deploy two units of PostgreSQL and then test the backup and restore actions.""" @@ -97,11 +97,6 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No await ops_test.model.deploy(TLS_CERTIFICATES_APP_NAME, config=config, channel="legacy/stable") for cloud, config in cloud_configs[0].items(): - # Check if credentials are available - if not cloud_configs[1][cloud]["secret-key"]: - logger.warning(f"Skipping tests for {cloud}. No credentials provided") - continue - # Deploy and relate PostgreSQL to S3 integrator (one database app for each cloud for now # as archive_mode is disabled after restoring the backup) and to TLS Certificates Operator # (to be able to create backups from replicas). @@ -125,7 +120,7 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No ) await action.wait() await ops_test.model.wait_for_idle( - apps=[database_app_name, S3_INTEGRATOR_APP_NAME], status="active", timeout=1500 + apps=[database_app_name, S3_INTEGRATOR_APP_NAME], status="active", timeout=1000 ) primary = await get_primary(ops_test, f"{database_app_name}/0") @@ -227,12 +222,9 @@ async def test_backup(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> No await ops_test.model.remove_application(TLS_CERTIFICATES_APP_NAME, block_until_done=True) -@pytest.mark.group(1) -async def test_restore_on_new_cluster(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: +@pytest.mark.uses_secrets +async def test_restore_on_new_cluster(ops_test: OpsTest) -> None: """Test that is possible to restore a backup to another PostgreSQL cluster.""" - if not cloud_configs[1][AWS]["secret-key"]: - pytest.skip("No AWS credentials") - charm = await ops_test.build_charm(".") database_app_name = f"new-{DATABASE_APP_NAME}" await ops_test.model.deploy( @@ -308,14 +300,11 @@ async def test_restore_on_new_cluster(ops_test: OpsTest, cloud_configs: Tuple[Di connection.close() -@pytest.mark.group(1) +@pytest.mark.uses_secrets async def test_invalid_config_and_recovery_after_fixing_it( ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict] ) -> None: """Test that the charm can handle invalid and valid backup configurations.""" - if not cloud_configs[1][AWS]["secret-key"]: - pytest.skip("No AWS credentials") - database_app_name = f"new-{DATABASE_APP_NAME}" # Provide invalid backup configurations. From 6ca421d175c19f4f08d183470b66bc730cbd2f39 Mon Sep 17 00:00:00 2001 From: Dragomir Penev Date: Sat, 11 Nov 2023 23:53:00 +0200 Subject: [PATCH 14/14] Bump timeouts --- .github/workflows/ci.yaml | 4 ++-- tests/integration/helpers.py | 2 +- tests/integration/test_db.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1f266b7d0f..384f6ae141 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,7 +47,7 @@ jobs: actions: write # Needed to manage GitHub Actions cache integration-test-juju3: - name: Integration test charm on Juju 3 + name: Integration tests on Juju 3 needs: - build - lint @@ -67,7 +67,7 @@ jobs: } integration-test-juju2: - name: Integration test charm on Juju 2 + name: Integration tests on Juju 2 needs: - build - lint diff --git a/tests/integration/helpers.py b/tests/integration/helpers.py index c0bb00cae4..9c15df7eb3 100644 --- a/tests/integration/helpers.py +++ b/tests/integration/helpers.py @@ -410,7 +410,7 @@ async def deploy_and_relate_bundle_with_postgresql( apps=[main_application_name], raise_on_blocked=False, status=status, - timeout=1500, + timeout=2000, ), ] if status_message: diff --git a/tests/integration/test_db.py b/tests/integration/test_db.py index 8f5b39db41..a258160aa4 100644 --- a/tests/integration/test_db.py +++ b/tests/integration/test_db.py @@ -108,7 +108,7 @@ async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest # Add two more units. await ops_test.model.applications[DATABASE_APP_NAME].add_units(2) await ops_test.model.wait_for_idle( - apps=[DATABASE_APP_NAME], status="active", timeout=1000, wait_for_exact_units=4 + apps=[DATABASE_APP_NAME], status="active", timeout=1500, wait_for_exact_units=4 ) # Remove the original units.