From 19417229d42473e55659bb820a5fec281d523a74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 10:51:00 -0400 Subject: [PATCH 1/5] Bump taskcluster from 51.0.0 to 52.0.0 (#1255) Bumps [taskcluster](https://github.com/taskcluster/taskcluster) from 51.0.0 to 52.0.0. - [Release notes](https://github.com/taskcluster/taskcluster/releases) - [Changelog](https://github.com/taskcluster/taskcluster/blob/main/CHANGELOG.md) - [Commits](https://github.com/taskcluster/taskcluster/compare/v51.0.0...v52.0.0) --- updated-dependencies: - dependency-name: taskcluster dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 372811dc..3c7f1e3c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1890,14 +1890,14 @@ pbr = ">=2.0.0,<2.1.0 || >2.1.0" [[package]] name = "taskcluster" -version = "51.0.0" +version = "52.0.0" description = "Python client for Taskcluster" category = "dev" optional = false python-versions = "*" files = [ - {file = "taskcluster-51.0.0-py3-none-any.whl", hash = "sha256:78857edcda693d4eac2ab282ec8414f6bc9fbeaf5eec3e8c42cd3d99ba6f08e6"}, - {file = "taskcluster-51.0.0.tar.gz", hash = "sha256:6252ae3800cacb415c927652d77419f00a58beb63f1d08eaf1fda585e82d9c57"}, + {file = "taskcluster-52.0.0-py3-none-any.whl", hash = "sha256:688520cf9ec4dd8527773c3018b68b4dde0648025485f9ac520f72fec9e958bf"}, + {file = "taskcluster-52.0.0.tar.gz", hash = "sha256:f99b714268b38dcc9e810990b86886f4cde37302cbd90988bdf0b56a345836f6"}, ] [package.dependencies] @@ -2227,4 +2227,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.12" -content-hash = "990ecfd81372739588c44cee88d9b161f51c9befe54df77ab53412b2d849147a" +content-hash = "93b94a9870ad5df96bd5bef13d687f8d128135fa1d78a7506b42a0bd2ca9d94e" diff --git a/pyproject.toml b/pyproject.toml index 977e912f..f29c5ad9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ autograph-utils = "^0.1.1" canonicaljson-rs = "^0.5.0" [tool.poetry.group.taskcluster.dependencies] -taskcluster = "^51.0.0" +taskcluster = "^52.0.0" [build-system] requires = ["poetry-core>=1.0.0"] From 42442b313873fc140fecf3963f1483ec4e411447 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 16:52:57 +0200 Subject: [PATCH 2/5] Bump google-cloud-bigquery from 3.10.0 to 3.11.0 (#1254) Bumps [google-cloud-bigquery](https://github.com/googleapis/python-bigquery) from 3.10.0 to 3.11.0. - [Release notes](https://github.com/googleapis/python-bigquery/releases) - [Changelog](https://github.com/googleapis/python-bigquery/blob/main/CHANGELOG.md) - [Commits](https://github.com/googleapis/python-bigquery/compare/v3.10.0...v3.11.0) --- updated-dependencies: - dependency-name: google-cloud-bigquery dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 3c7f1e3c..21781c9b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -878,14 +878,14 @@ reauth = ["pyu2f (>=0.1.5)"] [[package]] name = "google-cloud-bigquery" -version = "3.10.0" +version = "3.11.0" description = "Google BigQuery API client library" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "google-cloud-bigquery-3.10.0.tar.gz", hash = "sha256:4b02def076e2db8cec66f65fb627d13904a9fc3cf4fee315ede43dcb7038a8df"}, - {file = "google_cloud_bigquery-3.10.0-py2.py3-none-any.whl", hash = "sha256:848a3cbce0ba7d4f1e9551400a7c99aa0eab72290d5a1bbbe69f18a24a10bd3a"}, + {file = "google-cloud-bigquery-3.11.0.tar.gz", hash = "sha256:3a1c1b3566f9f27ea83a36aaf54eb879444ee73ef42456764018a0b3b556d0fb"}, + {file = "google_cloud_bigquery-3.11.0-py2.py3-none-any.whl", hash = "sha256:f568c36dfc9b8a2cf7e8ac10dd0889e0a52e8edf3dd556f3dd1eb441eda14364"}, ] [package.dependencies] @@ -2227,4 +2227,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.12" -content-hash = "93b94a9870ad5df96bd5bef13d687f8d128135fa1d78a7506b42a0bd2ca9d94e" +content-hash = "3b76c839285e16c759fc58c91dd1ab16a9376d57bf4013049875a519a1d8e888" diff --git a/pyproject.toml b/pyproject.toml index f29c5ad9..2eec4f7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ aiohttp_cors = "^0.7.0" backoff = "^2.2.1" python-decouple = "^3.8" logging-color-formatter = "^1.0.3" -google-cloud-bigquery = "^3.10.0" +google-cloud-bigquery = "^3.11.0" detect-secrets = "^1.4.0" [tool.poetry.group.dev.dependencies] From 8deed66e701f7f04bc77d977d9f563dc7e3aa55a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 16:55:13 +0200 Subject: [PATCH 3/5] Bump cryptography from 40.0.2 to 41.0.1 (#1253) Bumps [cryptography](https://github.com/pyca/cryptography) from 40.0.2 to 41.0.1. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/40.0.2...41.0.1) --- updated-dependencies: - dependency-name: cryptography dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 52 +++++++++++++++++++++++++------------------------- pyproject.toml | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/poetry.lock b/poetry.lock index 21781c9b..8e45f145 100644 --- a/poetry.lock +++ b/poetry.lock @@ -602,31 +602,31 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "40.0.2" +version = "41.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "cryptography-40.0.2-cp36-abi3-macosx_10_12_universal2.whl", hash = "sha256:8f79b5ff5ad9d3218afb1e7e20ea74da5f76943ee5edb7f76e56ec5161ec782b"}, - {file = "cryptography-40.0.2-cp36-abi3-macosx_10_12_x86_64.whl", hash = "sha256:05dc219433b14046c476f6f09d7636b92a1c3e5808b9a6536adf4932b3b2c440"}, - {file = "cryptography-40.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4df2af28d7bedc84fe45bd49bc35d710aede676e2a4cb7fc6d103a2adc8afe4d"}, - {file = "cryptography-40.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0dcca15d3a19a66e63662dc8d30f8036b07be851a8680eda92d079868f106288"}, - {file = "cryptography-40.0.2-cp36-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:a04386fb7bc85fab9cd51b6308633a3c271e3d0d3eae917eebab2fac6219b6d2"}, - {file = "cryptography-40.0.2-cp36-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:adc0d980fd2760c9e5de537c28935cc32b9353baaf28e0814df417619c6c8c3b"}, - {file = "cryptography-40.0.2-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:d5a1bd0e9e2031465761dfa920c16b0065ad77321d8a8c1f5ee331021fda65e9"}, - {file = "cryptography-40.0.2-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:a95f4802d49faa6a674242e25bfeea6fc2acd915b5e5e29ac90a32b1139cae1c"}, - {file = "cryptography-40.0.2-cp36-abi3-win32.whl", hash = "sha256:aecbb1592b0188e030cb01f82d12556cf72e218280f621deed7d806afd2113f9"}, - {file = "cryptography-40.0.2-cp36-abi3-win_amd64.whl", hash = "sha256:b12794f01d4cacfbd3177b9042198f3af1c856eedd0a98f10f141385c809a14b"}, - {file = "cryptography-40.0.2-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:142bae539ef28a1c76794cca7f49729e7c54423f615cfd9b0b1fa90ebe53244b"}, - {file = "cryptography-40.0.2-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:956ba8701b4ffe91ba59665ed170a2ebbdc6fc0e40de5f6059195d9f2b33ca0e"}, - {file = "cryptography-40.0.2-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4f01c9863da784558165f5d4d916093737a75203a5c5286fde60e503e4276c7a"}, - {file = "cryptography-40.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:3daf9b114213f8ba460b829a02896789751626a2a4e7a43a28ee77c04b5e4958"}, - {file = "cryptography-40.0.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:48f388d0d153350f378c7f7b41497a54ff1513c816bcbbcafe5b829e59b9ce5b"}, - {file = "cryptography-40.0.2-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c0764e72b36a3dc065c155e5b22f93df465da9c39af65516fe04ed3c68c92636"}, - {file = "cryptography-40.0.2-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:cbaba590180cba88cb99a5f76f90808a624f18b169b90a4abb40c1fd8c19420e"}, - {file = "cryptography-40.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7a38250f433cd41df7fcb763caa3ee9362777fdb4dc642b9a349721d2bf47404"}, - {file = "cryptography-40.0.2.tar.gz", hash = "sha256:c33c0d32b8594fa647d2e01dbccc303478e16fdd7cf98652d5b3ed11aa5e5c99"}, + {file = "cryptography-41.0.1-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:f73bff05db2a3e5974a6fd248af2566134d8981fd7ab012e5dd4ddb1d9a70699"}, + {file = "cryptography-41.0.1-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:1a5472d40c8f8e91ff7a3d8ac6dfa363d8e3138b961529c996f3e2df0c7a411a"}, + {file = "cryptography-41.0.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7fa01527046ca5facdf973eef2535a27fec4cb651e4daec4d043ef63f6ecd4ca"}, + {file = "cryptography-41.0.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b46e37db3cc267b4dea1f56da7346c9727e1209aa98487179ee8ebed09d21e43"}, + {file = "cryptography-41.0.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:d198820aba55660b4d74f7b5fd1f17db3aa5eb3e6893b0a41b75e84e4f9e0e4b"}, + {file = "cryptography-41.0.1-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:948224d76c4b6457349d47c0c98657557f429b4e93057cf5a2f71d603e2fc3a3"}, + {file = "cryptography-41.0.1-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:059e348f9a3c1950937e1b5d7ba1f8e968508ab181e75fc32b879452f08356db"}, + {file = "cryptography-41.0.1-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:b4ceb5324b998ce2003bc17d519080b4ec8d5b7b70794cbd2836101406a9be31"}, + {file = "cryptography-41.0.1-cp37-abi3-win32.whl", hash = "sha256:8f4ab7021127a9b4323537300a2acfb450124b2def3756f64dc3a3d2160ee4b5"}, + {file = "cryptography-41.0.1-cp37-abi3-win_amd64.whl", hash = "sha256:1fee5aacc7367487b4e22484d3c7e547992ed726d14864ee33c0176ae43b0d7c"}, + {file = "cryptography-41.0.1-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:9a6c7a3c87d595608a39980ebaa04d5a37f94024c9f24eb7d10262b92f739ddb"}, + {file = "cryptography-41.0.1-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5d092fdfedaec4cbbffbf98cddc915ba145313a6fdaab83c6e67f4e6c218e6f3"}, + {file = "cryptography-41.0.1-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:1a8e6c2de6fbbcc5e14fd27fb24414507cb3333198ea9ab1258d916f00bc3039"}, + {file = "cryptography-41.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:cb33ccf15e89f7ed89b235cff9d49e2e62c6c981a6061c9c8bb47ed7951190bc"}, + {file = "cryptography-41.0.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5f0ff6e18d13a3de56f609dd1fd11470918f770c6bd5d00d632076c727d35485"}, + {file = "cryptography-41.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:7bfc55a5eae8b86a287747053140ba221afc65eb06207bedf6e019b8934b477c"}, + {file = "cryptography-41.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:eb8163f5e549a22888c18b0d53d6bb62a20510060a22fd5a995ec8a05268df8a"}, + {file = "cryptography-41.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:8dde71c4169ec5ccc1087bb7521d54251c016f126f922ab2dfe6649170a3b8c5"}, + {file = "cryptography-41.0.1.tar.gz", hash = "sha256:d34579085401d3f49762d2f7d6634d6b6c2ae1242202e860f4d26b046e3a1006"}, ] [package.dependencies] @@ -635,12 +635,12 @@ cffi = ">=1.12" [package.extras] docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=1.1.1)"] docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"] -pep8test = ["black", "check-manifest", "mypy", "ruff"] -sdist = ["setuptools-rust (>=0.11.4)"] +nox = ["nox"] +pep8test = ["black", "check-sdist", "mypy", "ruff"] +sdist = ["build"] ssh = ["bcrypt (>=3.1.5)"] -test = ["iso8601", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-shard (>=0.1.2)", "pytest-subtests", "pytest-xdist"] +test = ["pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] -tox = ["tox"] [[package]] name = "detect-secrets" @@ -2227,4 +2227,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.12" -content-hash = "3b76c839285e16c759fc58c91dd1ab16a9376d57bf4013049875a519a1d8e888" +content-hash = "7583dcc161689419ebb34c9556d48413bc468077040205532a968193659b38a8" diff --git a/pyproject.toml b/pyproject.toml index 2eec4f7c..bc6dcf96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ optional = true [tool.poetry.group.remotesettings.dependencies] kinto-http = "^11.0.1" -cryptography = "^40.0.2" +cryptography = "^41.0.1" websockets = "^11.0" requests = "^2.31.0" beautifulsoup4 = "^4.12.2" From 36f09c31c25396f2ec2979dc563e073a14604596 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 17:08:08 +0200 Subject: [PATCH 4/5] Bump sentry-sdk from 1.24.0 to 1.25.0 (#1252) Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.24.0 to 1.25.0. - [Release notes](https://github.com/getsentry/sentry-python/releases) - [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-python/compare/1.24.0...1.25.0) --- updated-dependencies: - dependency-name: sentry-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 8e45f145..4d7c77fa 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1784,19 +1784,19 @@ pyasn1 = ">=0.1.3" [[package]] name = "sentry-sdk" -version = "1.24.0" +version = "1.25.0" description = "Python client for Sentry (https://sentry.io)" category = "main" optional = false python-versions = "*" files = [ - {file = "sentry-sdk-1.24.0.tar.gz", hash = "sha256:0bbcecda9f51936904c1030e7fef0fe693e633888f02a14d1cb68646a50e83b3"}, - {file = "sentry_sdk-1.24.0-py2.py3-none-any.whl", hash = "sha256:56d6d9d194c898d853a7c1dd99bed92ce82334ee1282292c15bcc967ff1a49b5"}, + {file = "sentry-sdk-1.25.0.tar.gz", hash = "sha256:5be3296fc574fa8a4d9b213b4dcf8c8d0246c08f8bd78315c6286f386c37555a"}, + {file = "sentry_sdk-1.25.0-py2.py3-none-any.whl", hash = "sha256:fe85cf5d0b3d0aa3480df689f9f6dc487de783defb0a95043368375dc893645e"}, ] [package.dependencies] certifi = "*" -urllib3 = {version = ">=1.26.11,<2.0.0", markers = "python_version >= \"3.6\""} +urllib3 = {version = ">=1.26.11", markers = "python_version >= \"3.6\""} [package.extras] aiohttp = ["aiohttp (>=3.5)"] @@ -2227,4 +2227,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = ">=3.11,<3.12" -content-hash = "7583dcc161689419ebb34c9556d48413bc468077040205532a968193659b38a8" +content-hash = "f53e9cb9a637980c22e5f8c3e8c7b5c667352081fc05de73ea728ed6afc9923b" diff --git a/pyproject.toml b/pyproject.toml index bc6dcf96..b6684f04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ aiohttp = "^3.8.4" toml = "^0.10.2" dockerflow = "^2022.8.0" async-timeout = "^4.0.2" -sentry-sdk = "^1.24.0" +sentry-sdk = "^1.25.0" termcolor = "^2.3.0" aiohttp_cors = "^0.7.0" backoff = "^2.2.1" From ec60106f80fe60a9da98c93b5341abc522c5dd94 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Tue, 6 Jun 2023 15:06:14 +0200 Subject: [PATCH 5/5] Add ability to filter by multiple tags (#1250) * Add ability to filter by multiple tags When we worked on https://github.com/mozilla-services/telescope/issues/1239 we realized it would be interesting to be able to filter checks that contain both `remotesettings-critical` and `prod`. It's more elegant than adding a `remotesettings-critical-{envName}` tag * Fix typing --- README.md | 1 + telescope/app.py | 11 ++++++----- tests/config.toml | 2 +- tests/test_basic_endpoints.py | 19 +++++++++++++++---- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 902200b3..5344069b 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Cache can be forced to be refreshed with the ``?refresh={s3cr3t}`` querystring. * ``/checks``: list all checks, without executing them. * ``/checks/{a-project}``: execute all checks of project ``a-project`` * ``/checks/tags/{a-tag}``: execute all checks with tag ``a-tag`` +* ``/checks/tags/{tag1}+{tag2}``: execute all checks having both tags ``tag1`` and ``tag2`` Output format: diff --git a/telescope/app.py b/telescope/app.py index 1b269bfe..15f421f5 100644 --- a/telescope/app.py +++ b/telescope/app.py @@ -42,7 +42,7 @@ def lookup( self, project: Optional[str] = None, name: Optional[str] = None, - tag: Optional[str] = None, + tags: Optional[str] = None, ): selected = self.all @@ -56,10 +56,11 @@ def lookup( if len(selected) == 0: raise ValueError(f"Unknown check '{project}.{name}'") - elif tag is not None: - selected = [c for c in selected if tag in c.tags] + elif tags is not None: + taglist: List[str] = tags.split("+") + selected = [c for c in selected if set(taglist).issubset(set(c.tags))] if len(selected) == 0: - raise ValueError(f"No check with tag '{tag}'") + raise ValueError(f"No check with tags '{tags}'") return selected @@ -268,7 +269,7 @@ async def project_checkpoints(request): ) -@routes.get("/checks/tags/{tag}") +@routes.get("/checks/tags/{tags}") @utils.render_checks async def tags_checkpoints(request): checks = request.app["telescope.checks"] diff --git a/tests/config.toml b/tests/config.toml index 1f7bea1c..7d804d90 100644 --- a/tests/config.toml +++ b/tests/config.toml @@ -15,7 +15,7 @@ params.from_conf = 100 description = "Test plot" module = "checks.core.heartbeat" params.url = "http://server.local/__heartbeat__" -tags = [ "critical" ] +tags = [ "test", "critical" ] plot = ".field" [checks.project.env] diff --git a/tests/test_basic_endpoints.py b/tests/test_basic_endpoints.py index e5f2e6aa..7df99056 100644 --- a/tests/test_basic_endpoints.py +++ b/tests/test_basic_endpoints.py @@ -123,7 +123,7 @@ async def test_project_returns_only_cached(mock_aioresponses, cli): assert body[1]["data"] == {"max_age": 999, "from_conf": 100} -# /tags/{tag} +# /tags/{tags} async def test_check_tag_unknown(cli): @@ -131,7 +131,7 @@ async def test_check_tag_unknown(cli): assert response.status == 404 -async def test_check_by_tag(cli, mock_aioresponses): +async def test_check_by_tags(cli, mock_aioresponses): mock_aioresponses.get( "http://server.local/__heartbeat__", status=200, payload={"ok": True} ) @@ -139,7 +139,18 @@ async def test_check_by_tag(cli, mock_aioresponses): assert response.status == 200 -async def test_check_by_tag_text_mode(cli, mock_aioresponses): +async def test_check_by_multiple_tags(cli, mock_aioresponses): + mock_aioresponses.get( + "http://server.local/__heartbeat__", status=200, payload={"ok": True} + ) + response = await cli.get("/checks/tags/ops+test") + assert response.status == 200 + body = await response.json() + # Only one check has "ops" and "test" tags in `config.toml` + assert len(body) == 1 + + +async def test_check_by_tags_text_mode(cli, mock_aioresponses): mock_aioresponses.get( "http://server.local/__heartbeat__", status=500, payload={"ok": False} ) @@ -371,7 +382,7 @@ async def test_logging_result(caplog, cli, mock_aioresponses): assert result_logs[0].success assert result_logs[0].project == "project" assert result_logs[0].check == "plot" - assert result_logs[0].tags == ["critical"] + assert result_logs[0].tags == ["test", "critical"] assert result_logs[0].plot == 12 assert result_logs[1].plot is None