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

e2e: enable more than one pod in one test case #1645

Merged

Conversation

wyuany
Copy link
Contributor

@wyuany wyuany commented Dec 29, 2023

Enable test framework to support more than one pod in one test case

Fixes: #16

@wyuany wyuany force-pushed the e2e-enable-extra-pods branch 3 times, most recently from abcf6a1 to 3434d4f Compare December 29, 2023 09:57
@wyuany
Copy link
Contributor Author

wyuany commented Dec 29, 2023

The case is tested against self managed cluster on ibmcloud. Test log as below.

INFO[0000] IamServiceURL is: https://iam.cloud.ibm.com/identity/token.
INFO[0000] VpcServiceURL is: https://jp-tok.iaas.cloud.ibm.com/v1.
INFO[0000] IksServiceURL is: https://containers.cloud.ibm.com/global.
INFO[0000] [warning] SSH_KEY_ID was not set.
INFO[0000] Do setup
=== RUN   TestExtraPods
=== RUN   TestExtraPods/TestExtraPods_test
    assessment_runner_test.go:247: Waiting for containers in pod: nginx are ready
INFO[0042] webserver service is available on cluster IP: None
Provision extra pod busybox    assessment_helpers_test.go:402: Waiting for containers in pod: busybox are ready
=== RUN   TestExtraPods/TestExtraPods_test/Failed_to_test_extra_pod.
INFO[0078] PodVM name: nginx
INFO[0087] Success to access nginx service. <!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>
    assessment_runner_test.go:463: Output when execute test commands:
INFO[0087] PodVM name: busybox
INFO[0089] Deleting pod nginx...
INFO[0094] Pod nginx has been successfully deleted within 60s
INFO[0094] Deleting pod busybox...
INFO[0099] Pod busybox has been successfully deleted within 60s
INFO[0100] Deleting Service... nginx
--- PASS: TestExtraPods (99.69s)
    --- PASS: TestExtraPods/TestExtraPods_test (99.69s)
        --- PASS: TestExtraPods/TestExtraPods_test/Failed_to_test_extra_pod. (11.14s)
PASS
ok  	github.com/confidential-containers/cloud-api-adaptor/test/e2e	100.872s

@@ -445,3 +445,38 @@ func doTestPodVMwithAnnotationsLargerCPU(t *testing.T, assert CloudAssert) {
}
newTestCase(t, "PodVMwithAnnotationsLargerCPU", assert, "Failed to Create PodVM with Annotations Larger CPU").withPod(pod).withInstanceTypes(testInstanceTypes).withCustomPodState(v1.PodPending).run()
}

func doTestExtraPods(t *testing.T, assert CloudAssert) {
Copy link
Member

Choose a reason for hiding this comment

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

All the other test cases are have one test content related name, can we change this function name to
doTestServiceAndExtraPod

@@ -502,6 +502,13 @@ func TestIBMCreateNginxDeployment(t *testing.T) {
doTestNginxDeployment(t, assert)
}

func TestExtraPods(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

All the other test cases are have one test content related name, can we change this function name to
TestServiceAndExtraPod

Copy link
Member

Choose a reason for hiding this comment

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

And this test is good for other providers, so maybe we add this test case in other provider test file too, at last include it in the libvirt_test.go, TestLibvirtServiceAndExtraPod ?

Copy link
Contributor

Choose a reason for hiding this comment

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

How about rename to TestPodToServiceCommunication?

@liudalibj liudalibj added the test_e2e_libvirt Run Libvirt e2e tests label Jan 2, 2024
test/e2e/assessment_helpers_test.go Show resolved Hide resolved
test/e2e/assessment_helpers_test.go Show resolved Hide resolved
test/e2e/assessment_runner_test.go Show resolved Hide resolved
test/e2e/assessment_runner_test.go Show resolved Hide resolved
test/e2e/assessment_runner_test.go Show resolved Hide resolved
test/e2e/assessment_runner_test.go Outdated Show resolved Hide resolved
test/e2e/common.go Outdated Show resolved Hide resolved
test/e2e/common_suite_test.go Outdated Show resolved Hide resolved
@@ -502,6 +502,13 @@ func TestIBMCreateNginxDeployment(t *testing.T) {
doTestNginxDeployment(t, assert)
}

func TestExtraPods(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about rename to TestPodToServiceCommunication?

test/e2e/libvirt_test.go Outdated Show resolved Hide resolved
@wyuany wyuany force-pushed the e2e-enable-extra-pods branch 2 times, most recently from f31994e to e74e0e6 Compare January 2, 2024 06:44
Enable test framework to support more than one pod in one test case

Fixes: confidential-containers#16
Signed-off-by: Yuan Yuan Wang <wyuany@cn.ibm.com>
Copy link
Contributor

@huoqifeng huoqifeng left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@liudalibj liudalibj left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @wyuany

@huoqifeng huoqifeng merged commit ffb518d into confidential-containers:main Jan 3, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_e2e_libvirt Run Libvirt e2e tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ci: Start thinking about CI/CD options for the cloud-api-adaptor/peer-pods solution
3 participants