mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #89215 from k-toyoda-pi/use_expectnotequal_service
Use ExpectNotEqual in test/e2e/network/
This commit is contained in:
commit
1b7f5662e1
@ -46,6 +46,15 @@ do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
errors_expect_no_equal=()
|
||||||
|
for file in "${all_e2e_files[@]}"
|
||||||
|
do
|
||||||
|
if grep -E "Expect\(.*\)\.(NotTo|ToNot)\((gomega\.Equal|Equal)" "${file}" > /dev/null
|
||||||
|
then
|
||||||
|
errors_expect_no_equal+=( "${file}" )
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
errors_expect_equal=()
|
errors_expect_equal=()
|
||||||
for file in "${all_e2e_files[@]}"
|
for file in "${all_e2e_files[@]}"
|
||||||
do
|
do
|
||||||
@ -83,6 +92,20 @@ if [ ${#errors_expect_error[@]} -ne 0 ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ${#errors_expect_no_equal[@]} -ne 0 ]; then
|
||||||
|
{
|
||||||
|
echo "Errors:"
|
||||||
|
for err in "${errors_expect_no_equal[@]}"; do
|
||||||
|
echo "$err"
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
echo 'The above files need to use framework.ExpectNotEqual(foo, bar) instead of '
|
||||||
|
echo 'Expect(foo).NotTo(Equal(bar)) or gomega.Expect(foo).NotTo(gomega.Equal(bar))'
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ${#errors_expect_equal[@]} -ne 0 ]; then
|
if [ ${#errors_expect_equal[@]} -ne 0 ]; then
|
||||||
{
|
{
|
||||||
echo "Errors:"
|
echo "Errors:"
|
||||||
|
@ -940,7 +940,7 @@ var _ = SIGDescribe("Services", func() {
|
|||||||
pausePods, err := cs.CoreV1().Pods(ns).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()})
|
pausePods, err := cs.CoreV1().Pods(ns).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()})
|
||||||
framework.ExpectNoError(err, "Error in listing pods associated with pause pod deployments")
|
framework.ExpectNoError(err, "Error in listing pods associated with pause pod deployments")
|
||||||
|
|
||||||
gomega.Expect(pausePods.Items[0].Spec.NodeName).ToNot(gomega.Equal(pausePods.Items[1].Spec.NodeName))
|
framework.ExpectNotEqual(pausePods.Items[0].Spec.NodeName, pausePods.Items[1].Spec.NodeName)
|
||||||
|
|
||||||
serviceAddress := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort))
|
serviceAddress := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user