mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
Merge pull request #109228 from pacoxu/cleanup-ut
prevent the unit test name too long in report
This commit is contained in:
commit
c74c82e845
@ -1087,10 +1087,11 @@ func TestCelCostStability(t *testing.T) {
|
|||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
for validRule, expectedCost := range tt.expectCost {
|
for validRule, expectedCost := range tt.expectCost {
|
||||||
t.Run(validRule, func(t *testing.T) {
|
testName := validRule
|
||||||
validRule := validRule
|
if len(testName) > 127 {
|
||||||
expectedCost := expectedCost
|
testName = testName[:127]
|
||||||
t.Run(validRule, func(t *testing.T) {
|
}
|
||||||
|
t.Run(testName, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
s := withRule(*tt.schema, validRule)
|
s := withRule(*tt.schema, validRule)
|
||||||
celValidator := NewValidator(&s, PerCallLimit)
|
celValidator := NewValidator(&s, PerCallLimit)
|
||||||
@ -1107,8 +1108,6 @@ func TestCelCostStability(t *testing.T) {
|
|||||||
t.Fatalf("runtime cost %d does not match expected runtime cost %d", rtCost, expectedCost)
|
t.Fatalf("runtime cost %d does not match expected runtime cost %d", rtCost, expectedCost)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1760,7 +1760,11 @@ func TestValidationExpressions(t *testing.T) {
|
|||||||
ctx := context.TODO()
|
ctx := context.TODO()
|
||||||
for j := range tt.valid {
|
for j := range tt.valid {
|
||||||
validRule := tt.valid[j]
|
validRule := tt.valid[j]
|
||||||
t.Run(validRule, func(t *testing.T) {
|
testName := validRule
|
||||||
|
if len(testName) > 127 {
|
||||||
|
testName = testName[:127]
|
||||||
|
}
|
||||||
|
t.Run(testName, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
s := withRule(*tt.schema, validRule)
|
s := withRule(*tt.schema, validRule)
|
||||||
celValidator := validator(&s, tt.isRoot, PerCallLimit)
|
celValidator := validator(&s, tt.isRoot, PerCallLimit)
|
||||||
@ -1781,7 +1785,11 @@ func TestValidationExpressions(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
for rule, expectErrToContain := range tt.errors {
|
for rule, expectErrToContain := range tt.errors {
|
||||||
t.Run(rule, func(t *testing.T) {
|
testName := rule
|
||||||
|
if len(testName) > 127 {
|
||||||
|
testName = testName[:127]
|
||||||
|
}
|
||||||
|
t.Run(testName, func(t *testing.T) {
|
||||||
s := withRule(*tt.schema, rule)
|
s := withRule(*tt.schema, rule)
|
||||||
celValidator := NewValidator(&s, PerCallLimit)
|
celValidator := NewValidator(&s, PerCallLimit)
|
||||||
if celValidator == nil {
|
if celValidator == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user