Fix dupl errors
Signed-off-by: z1cheng <imchench@gmail.com>
This commit is contained in:
parent
d4ace6a8ab
commit
587963a1c6
12 changed files with 20 additions and 5 deletions
|
@ -475,6 +475,7 @@ func TestCheckWarning(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
func TestMergeAlternativeBackends(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
ingress *ingress.Ingress
|
||||
|
@ -2104,6 +2105,7 @@ func TestGetBackendServers(t *testing.T) {
|
|||
SetConfigMap: testConfigMap,
|
||||
},
|
||||
{
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
Ingresses: []*ingress.Ingress{
|
||||
{
|
||||
Ingress: networking.Ingress{
|
||||
|
@ -2211,6 +2213,7 @@ func TestGetBackendServers(t *testing.T) {
|
|||
SetConfigMap: testConfigMap,
|
||||
},
|
||||
{
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
Ingresses: []*ingress.Ingress{
|
||||
{
|
||||
Ingress: networking.Ingress{
|
||||
|
|
|
@ -27,6 +27,7 @@ import (
|
|||
"k8s.io/ingress-nginx/pkg/apis/ingress"
|
||||
)
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
func TestGetEndpointsFromSlices(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
|
|
@ -1771,6 +1771,7 @@ func TestEnforceRegexModifier(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
func TestShouldLoadModSecurityModule(t *testing.T) {
|
||||
// ### Invalid argument type tests ###
|
||||
// The first tests should return false.
|
||||
|
@ -1871,6 +1872,7 @@ opentracing_trust_incoming_span off;`
|
|||
}
|
||||
}
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
func TestShouldLoadOpentracingModule(t *testing.T) {
|
||||
// ### Invalid argument type tests ###
|
||||
// The first tests should return false.
|
||||
|
@ -1972,6 +1974,7 @@ opentelemetry_trust_incoming_spans off;`
|
|||
}
|
||||
}
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
func TestShouldLoadOpentelemetryModule(t *testing.T) {
|
||||
// ### Invalid argument type tests ###
|
||||
// The first tests should return false.
|
||||
|
|
|
@ -92,7 +92,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
|
|||
Expect().
|
||||
Status(http.StatusOK)
|
||||
})
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
ginkgo.It("should set valid proxy-ssl-secret, proxy-ssl-ciphers to HIGH:!AES", func() {
|
||||
host := proxySSLHost
|
||||
annotations := make(map[string]string)
|
||||
|
@ -120,7 +120,7 @@ var _ = framework.DescribeAnnotation("proxy-ssl-*", func() {
|
|||
Expect().
|
||||
Status(http.StatusOK)
|
||||
})
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
ginkgo.It("should set valid proxy-ssl-secret, proxy-ssl-protocols", func() {
|
||||
host := proxySSLHost
|
||||
annotations := make(map[string]string)
|
||||
|
|
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
package framework
|
||||
|
||||
import (
|
||||
|
|
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
package framework
|
||||
|
||||
import (
|
||||
|
|
|
@ -50,6 +50,7 @@ var _ = framework.IngressNginxDescribe("[Flag] disable-sync-events", func() {
|
|||
assert.NotEmpty(ginkgo.GinkgoT(), events.Items, "got events")
|
||||
})
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
ginkgo.It("should create sync events", func() {
|
||||
host := "disable-sync-events-false"
|
||||
f.NewEchoDeployment(framework.WithDeploymentReplicas(1))
|
||||
|
@ -77,6 +78,7 @@ var _ = framework.IngressNginxDescribe("[Flag] disable-sync-events", func() {
|
|||
assert.NotEmpty(ginkgo.GinkgoT(), events.Items, "got events")
|
||||
})
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
ginkgo.It("should not create sync events", func() {
|
||||
host := "disable-sync-events-true"
|
||||
f.NewEchoDeployment(framework.WithDeploymentReplicas(1))
|
||||
|
|
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
package settings
|
||||
|
||||
import (
|
||||
|
|
|
@ -44,7 +44,7 @@ var _ = framework.DescribeSetting("use-proxy-protocol", func() {
|
|||
f.NewEchoDeployment()
|
||||
f.UpdateNginxConfigMapData(setting, "false")
|
||||
})
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
ginkgo.It("should respect port passed by the PROXY Protocol", func() {
|
||||
host := proxyProtocol
|
||||
|
||||
|
@ -81,6 +81,7 @@ var _ = framework.DescribeSetting("use-proxy-protocol", func() {
|
|||
assert.Contains(ginkgo.GinkgoT(), body, "x-forwarded-for=192.168.0.1")
|
||||
})
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
ginkgo.It("should respect proto passed by the PROXY Protocol server port", func() {
|
||||
host := proxyProtocol
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
package settings
|
||||
|
||||
import (
|
||||
|
|
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
package settings
|
||||
|
||||
import (
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
|
||||
var _ = framework.IngressNginxDescribeSerial("annotation validations", func() {
|
||||
f := framework.NewDefaultFramework("validations")
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
ginkgo.It("should allow ingress based on their risk on webhooks", func() {
|
||||
host := "annotation-validations"
|
||||
|
||||
|
@ -55,7 +55,7 @@ var _ = framework.IngressNginxDescribeSerial("annotation validations", func() {
|
|||
_, err = f.KubeClientSet.NetworkingV1().Ingresses(f.Namespace).Update(context.TODO(), ing, metav1.UpdateOptions{})
|
||||
assert.NotNil(ginkgo.GinkgoT(), err, "creating ingress with risky annotations should trigger an error")
|
||||
})
|
||||
|
||||
//nolint:dupl // Ignore dupl errors for similar test case
|
||||
ginkgo.It("should allow ingress based on their risk on webhooks", func() {
|
||||
host := "annotation-validations"
|
||||
|
||||
|
|
Loading…
Reference in a new issue