Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Policy Recommendation e2e test #77

Merged
merged 3 commits into from
Aug 3, 2022

Conversation

dreamtalen
Copy link
Contributor

Fix #72

In this commit, we add these improvements for the Policy Recommendation
e2e test:

  1. Add a test case for the failed policy recommendation job.
  2. Add policy recommendation check for the Pod-to-Svc and Pod-to-External flows.
  3. Change the Kind/Jenkins test script to build the latest policy
    recommendation image for testing, instead of pulling from Docker.

Signed-off-by: Yongming Ding dyongming@vmware.com

@dreamtalen
Copy link
Contributor Author

/theia-test-e2e

.github/workflows/kind.yml Show resolved Hide resolved
test/e2e/policyrecommendation_test.go Outdated Show resolved Hide resolved
test/e2e/policyrecommendation_test.go Show resolved Hide resolved
test/e2e/policyrecommendation_test.go Show resolved Hide resolved
test/e2e/policyrecommendation_test.go Show resolved Hide resolved
test/e2e/policyrecommendation_test.go Outdated Show resolved Hide resolved
test/e2e/policyrecommendation_test.go Show resolved Hide resolved
In this commit, we add these improvements for the Policy Recommendation
e2e test:
1. Add test case for the failed policy recommendation job.
2. Add policy recommendation check for the Pod-to-Svc, and Pod-to-External flows.
3. Change Kind/Jenkins test script to build the latest policy
   recommendation image for testing, instead of pulling from Docker.

Signed-off-by: Yongming Ding <dyongming@vmware.com>
.github/workflows/kind.yml Show resolved Hide resolved
.github/workflows/kind.yml Outdated Show resolved Hide resolved
@@ -63,3 +85,19 @@ jobs:
name: e2e-kind-fa.tar.gz
path: log.tar.gz
retention-days: 30

# Runs after all other jobs in the workflow and deletes Theia Docker images uploaded as temporary
# artifacts. It uses a third-party, MIT-licensed action (geekyeggo/delete-artifact). While Github
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not familiar with how temporary artifacts are managed, will there be possible conflicts if multi images are uploaded and deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ziyou, if there are multiple jobs uploading a same image, the later jobs will overwrite what was previously uploaded. I think this won't be a problem for our testing usage?

t.Fatalf("Error when creating perftest-b Service: %v", err)
}
// Wait for the Service to be realized.
time.Sleep(3 * time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a simple way to check if service is realized? A fixed waiting interval either wastes time or stops too early.

Copy link
Contributor Author

@dreamtalen dreamtalen Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ziyou, this time.Sleep was introduced in antrea-io/antrea#1815 first time, our tests inheriting from flowaggregator_test.go keep it as well. I'm not sure if weiqiang found something while debugging so he added this wait statement. I tried removing it here and flowvisibility_test.go, no errors are found so far.

Signed-off-by: Yongming Ding <dyongming@vmware.com>
@dreamtalen
Copy link
Contributor Author

/theia-test-e2e


svcB, err = data.CreateService("perftest-b", testNamespace, iperfPort, iperfPort, map[string]string{"antrea-e2e": "perftest-b"}, false, false, corev1.ServiceTypeClusterIP, &svcIPFamily)
if err != nil {
return nil, fmt.Errorf("Error when creating perftest-b Service: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return nil, fmt.Errorf("Error when creating perftest-b Service: %v", err)
return nil, fmt.Errorf("error when creating perftest-b Service: %v", err)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed.

Signed-off-by: Yongming Ding <dyongming@vmware.com>
@dreamtalen dreamtalen merged commit 7de1a21 into antrea-io:main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

e2e test coverage improvement for policy recommendation
6 participants