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

Fix pulumi.DependsOn in test-infra-definitions #31393

Merged
merged 6 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitlab/common/test_infra_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ variables:
# and check the job creating the image to make sure you have the right SHA prefix
TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX: ""
# Make sure to update test-infra-definitions version in go.mod as well
TEST_INFRA_DEFINITIONS_BUILDIMAGES: 7cd5e8a62570
TEST_INFRA_DEFINITIONS_BUILDIMAGES: 8af5c27aa2af
2 changes: 1 addition & 1 deletion test/new-e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ require (
// `TEST_INFRA_DEFINITIONS_BUILDIMAGES` matches the commit sha in the module version
// Example: github.com/DataDog/test-infra-definitions v0.0.0-YYYYMMDDHHmmSS-0123456789AB
// => TEST_INFRA_DEFINITIONS_BUILDIMAGES: 0123456789AB
github.com/DataDog/test-infra-definitions v0.0.0-20241115164330-7cd5e8a62570
github.com/DataDog/test-infra-definitions v0.0.0-20241122203622-8af5c27aa2af
github.com/aws/aws-sdk-go-v2 v1.32.2
github.com/aws/aws-sdk-go-v2/config v1.27.40
github.com/aws/aws-sdk-go-v2/service/ec2 v1.164.2
Expand Down
4 changes: 2 additions & 2 deletions test/new-e2e/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 3 additions & 28 deletions test/new-e2e/tests/containers/k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,37 +946,12 @@ func (suite *k8sSuite) testAdmissionControllerPod(namespace string, name string,
}, 5*time.Minute, 10*time.Second, "The deployment with name %s in namespace %s does not exist or does not have the auto detected languages annotation", name, namespace)
}

// Record old pod, so we can be sure we are not looking at the incorrect one after deletion
oldPods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{
pods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{
LabelSelector: fields.OneTermEqualSelector("app", name).String(),
})
suite.Require().NoError(err)
suite.Require().Len(oldPods.Items, 1)
oldPod := oldPods.Items[0]

// Delete the pod to ensure it is recreated after the admission controller is deployed
err = suite.K8sClient.CoreV1().Pods(namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{
LabelSelector: fields.OneTermEqualSelector("app", name).String(),
})
suite.Require().NoError(err)

// Wait for the fresh pod to be created
var pod corev1.Pod
suite.Require().EventuallyWithTf(func(c *assert.CollectT) {
pods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{
LabelSelector: fields.OneTermEqualSelector("app", name).String(),
})
if !assert.NoError(c, err) {
return
}
if !assert.Len(c, pods.Items, 1) {
return
}
pod = pods.Items[0]
if !assert.NotEqual(c, oldPod.Name, pod.Name) {
return
}
}, 2*time.Minute, 10*time.Second, "Failed to witness the creation of pod with name %s in namespace %s", name, namespace)
suite.Require().Len(pods.Items, 1)
pod := pods.Items[0]

suite.Require().Len(pod.Spec.Containers, 1)

Expand Down
Loading