Browse code

Revert "temporary: Disable deprecate-integration-cli validation"

This reverts commit bdc7d0c2db6b72164da6fcce8f946fa4fb485bad.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2024/01/17 23:59:52
Showing 2 changed files
... ...
@@ -12,6 +12,6 @@ SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12 12
 . "${SCRIPTDIR}"/swagger
13 13
 . "${SCRIPTDIR}"/swagger-gen
14 14
 . "${SCRIPTDIR}"/toml
15
-#. "${SCRIPTDIR}"/deprecate-integration-cli
15
+. "${SCRIPTDIR}"/deprecate-integration-cli
16 16
 . "${SCRIPTDIR}"/golangci-lint
17 17
 . "${SCRIPTDIR}"/shfmt
18 18
new file mode 100755
... ...
@@ -0,0 +1,25 @@
0
+#!/usr/bin/env bash
1
+# Check that no new tests are being added to integration-cli
2
+
3
+SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4
+source "${SCRIPTDIR}/.validate"
5
+
6
+new_tests=$(
7
+	validate_diff --diff-filter=ACMR --unified=0 -- 'integration-cli/*_api_*.go' 'integration-cli/*_cli_*.go' \
8
+		| grep -E '^\+func (.*) Test' || true
9
+)
10
+
11
+if [ -n "$new_tests" ]; then
12
+	{
13
+		echo "The following new tests were added to integration-cli:"
14
+		echo
15
+		echo "$new_tests"
16
+		echo
17
+		echo "integration-cli is deprecated. Please add an API integration test to"
18
+		echo "./integration/COMPONENT/. See ./TESTING.md for more details."
19
+		echo
20
+	} >&2
21
+	false
22
+else
23
+	echo 'Congratulations!  No new tests were added to integration-cli.'
24
+fi