mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #92148 from oomichi/block-tests-in-e2e-framework
Add check for blocking tests in e2e framework
This commit is contained in:
commit
3fbe8c09ef
@ -64,6 +64,17 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
all_e2e_framework_files=()
|
||||
kube::util::read-array all_e2e_framework_files < <(find test/e2e/framework/ -name '*.go' | grep -v "_test.go")
|
||||
errors_framework_contains_tests=()
|
||||
for file in "${all_e2e_framework_files[@]}"
|
||||
do
|
||||
if grep -E "(ConformanceIt\(.*, func\(\) {|ginkgo.It\(.*, func\(\) {)" "${file}" > /dev/null
|
||||
then
|
||||
errors_framework_contains_tests+=( "${file}" )
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${#errors_expect_no_error[@]} -ne 0 ]; then
|
||||
{
|
||||
echo "Errors:"
|
||||
@ -120,4 +131,18 @@ if [ ${#errors_expect_equal[@]} -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ${#errors_framework_contains_tests[@]} -ne 0 ]; then
|
||||
{
|
||||
echo "Errors:"
|
||||
for err in "${errors_framework_contains_tests[@]}"; do
|
||||
echo "$err"
|
||||
done
|
||||
echo
|
||||
echo 'The above e2e framework files should not contain any e2e tests which are implemented '
|
||||
echo 'with framework.ConformanceIt() or ginkgo.It()'
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo 'Congratulations! All e2e test source files are valid.'
|
||||
|
Loading…
Reference in New Issue
Block a user