From 24c3b1f781ea537e7d00fc4e4ab1c6753f6c308c Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Mon, 13 May 2024 14:20:48 +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 62b5c319..1a04ed79 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,3 +60,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"]