From bd6df68a6f6196cf5b4211af48c96f02a2365ddf Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Mon, 13 May 2024 14:43:49 +0200 Subject: [PATCH] [pre-commit][kuttl]Check for multiple TestAsserts Add a new pre-commit check to avoid using more than one TestAssert in a single kuttl assert file as that can lead to false positives as only the last TestAssert is run by kuttl. Fortunately there was no such issue in this repo. --- .pre-commit-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7eb0fa5..34aceb5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -70,3 +70,11 @@ repos: hooks: - id: bashate entry: bashate --error . --ignore=E006,E040,E011,E020,E012 + +- repo: https://github.com/openstack-k8s-operators/openstack-k8s-operators-ci + # NOTE(gibi): we cannot automatically track main here + # see https://pre-commit.com/#using-the-latest-version-for-a-repository + rev: e30d72fcbced0ab8a7b6d23be1dee129e2a7b849 + hooks: + - id: kuttl-single-test-assert + args: ["tests/kuttl"]