From d010b549ce46991148b40502aff6a184d8073941 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Mon, 13 May 2024 14:51:23 +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 e7d5e2f2..457ac860 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,3 +61,11 @@ repos: hooks: - id: golangci-lint-full args: ["-v"] + +- 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"]