Skip to content

Commit

Permalink
[CI] Fix IPv6 e2e kubeconfig not found & simplify Jenkins log (#2195)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhecheng Li <lzhecheng@vmware.com>
  • Loading branch information
lzhecheng authored May 21, 2021
1 parent b067475 commit 71fb938
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ci/jenkins/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ function run_e2e {

set +e
mkdir -p `pwd`/antrea-test-logs
go test -v antrea.io/antrea/test/e2e --logs-export-dir `pwd`/antrea-test-logs -timeout=100m --prometheus
go test -v antrea.io/antrea/test/e2e --logs-export-dir `pwd`/antrea-test-logs --provider remote -timeout=100m --prometheus
if [[ "$?" != "0" ]]; then
TEST_FAILURE=true
fi
Expand Down
18 changes: 9 additions & 9 deletions test/e2e/antreapolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1984,10 +1984,10 @@ func testANPMultipleAppliedTo(t *testing.T, singleRule bool) {
failOnError(err, t)
time.Sleep(networkPolicyDelay)
k8sUtils.Validate(allPods, reachability, 80, v1.ProtocolTCP)
reachability.PrintSummary(true, true, true)
_, wrong, _ := reachability.Summary()
if wrong != 0 {
t.Errorf("failure -- %d wrong results", wrong)
reachability.PrintSummary(true, true, true)
}

t.Logf("Making the Policy apply to y/c by labeling it with the temporary label that matches the dummy AppliedTo")
Expand All @@ -2000,10 +2000,10 @@ func testANPMultipleAppliedTo(t *testing.T, singleRule bool) {
reachability.Expect(Pod("x/b"), Pod("y/c"), Dropped)
time.Sleep(networkPolicyDelay)
k8sUtils.Validate(allPods, reachability, 80, v1.ProtocolTCP)
reachability.PrintSummary(true, true, true)
_, wrong, _ = reachability.Summary()
if wrong != 0 {
t.Errorf("failure -- %d wrong results", wrong)
reachability.PrintSummary(true, true, true)
}

t.Logf("Making the Policy not apply to y/c by removing the temporary label")
Expand All @@ -2014,10 +2014,10 @@ func testANPMultipleAppliedTo(t *testing.T, singleRule bool) {
reachability.Expect(Pod("x/b"), Pod("y/a"), Dropped)
time.Sleep(networkPolicyDelay)
k8sUtils.Validate(allPods, reachability, 80, v1.ProtocolTCP)
reachability.PrintSummary(true, true, true)
_, wrong, _ = reachability.Summary()
if wrong != 0 {
t.Errorf("failure -- %d wrong results", wrong)
reachability.PrintSummary(true, true, true)
}

failOnError(k8sUtils.DeleteANP(builder.Namespace, builder.Name), t)
Expand Down Expand Up @@ -2324,11 +2324,11 @@ func executeTestsWithData(t *testing.T, testList []*TestCase, data *TestData) {
k8sUtils.Validate(allPods, reachability, port, step.Protocol)
}
step.Duration = time.Now().Sub(start)
reachability.PrintSummary(true, true, true)

_, wrong, _ := step.Reachability.Summary()
if wrong != 0 {
t.Errorf("failure -- %d wrong results", wrong)
reachability.PrintSummary(true, true, true)
}
}
if len(step.CustomProbes) > 0 && data == nil {
Expand Down Expand Up @@ -2485,7 +2485,7 @@ func cleanupTestCaseServicesAndGroups(t *testing.T, c *TestCase) {

// printResults summarizes test results for all the testcases
func printResults() {
fmt.Printf("\n\n---------------- Test Results ------------------\n\n")
fmt.Printf("\n---------------- Test Results ------------------\n")
failCount := 0
for _, testCase := range allTestList {
fmt.Printf("Test %s:\n", testCase.Name)
Expand All @@ -2504,15 +2504,15 @@ func printResults() {
}
fmt.Printf("\tStep %s on port %d, duration %d seconds, result: %s\n",
step.Name, step.Port, int(step.Duration.Seconds()), result)
fmt.Printf("\n%s\n", comparison.PrettyPrint("\t\t"))
if wrong != 0 {
fmt.Printf("\n%s\n", comparison.PrettyPrint("\t\t"))
}
}
if testFailed {
failCount++
}
fmt.Printf("\n\n")
}
fmt.Printf("=== TEST FAILURES: %d/%d ===\n", failCount, len(allTestList))
fmt.Printf("\n\n")
fmt.Printf("=== TEST FAILURES: %d/%d ===\n\n", failCount, len(allTestList))
}

func waitForResourceReady(obj metav1.Object, timeout time.Duration) error {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/legacyantreapolicy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2005,11 +2005,11 @@ func executeLegacyTestsWithData(t *testing.T, testList []*TestCase, data *TestDa
k8sUtils.Validate(allPods, reachability, port, step.Protocol)
}
step.Duration = time.Now().Sub(start)
reachability.PrintSummary(true, true, true)

_, wrong, _ := step.Reachability.Summary()
if wrong != 0 {
t.Errorf("failure -- %d wrong results", wrong)
reachability.PrintSummary(true, true, true)
}
}
if len(step.CustomProbes) > 0 && data == nil {
Expand Down

0 comments on commit 71fb938

Please sign in to comment.