Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 12 additions & 4 deletions test/e2e/helpers/parallel_test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ func ParallelTestHelper(

// construct branch subscriber
subPodName := fmt.Sprintf("parallel-%s-branch-%d-sub", tc.name, branchNumber)
subPod := resources.SequenceStepperPod(subPodName, subPodName)
client.CreatePodOrFail(subPod, testlib.WithService(subPodName))
recordevents.DeployEventRecordOrFail(
ctx,
client,
subPodName,
recordevents.ReplyWithAppendedData(subPodName),
)

parallelBranches[branchNumber] = v1beta1.ParallelBranch{
Filter: &duckv1.Destination{
Expand Down Expand Up @@ -188,8 +192,12 @@ func ParallelV1TestHelper(

// construct branch subscriber
subPodName := fmt.Sprintf("parallel-%s-branch-%d-sub", tc.name, branchNumber)
subPod := resources.SequenceStepperPod(subPodName, subPodName)
client.CreatePodOrFail(subPod, testlib.WithService(subPodName))
recordevents.DeployEventRecordOrFail(
ctx,
client,
subPodName,
recordevents.ReplyWithAppendedData(subPodName),
)

parallelBranches[branchNumber] = flowsv1.ParallelBranch{
Filter: &duckv1.Destination{
Expand Down
25 changes: 0 additions & 25 deletions test/lib/resources/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,31 +66,6 @@ func WithLabelsForPod(labels map[string]string) PodOption {
}
}

// SequenceStepperPod creates a Pod that can be used as a step in testing Sequence.
// Note event data used in the test must be BaseData, and this Pod as a Subscriber will receive the event,
// and return a new event with eventMsgAppender added to data.Message.
func SequenceStepperPod(name, eventMsgAppender string) *corev1.Pod {
const imageName = "sequencestepper"
return &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Labels: map[string]string{"e2etest": string(uuid.NewUUID())},
},
Spec: corev1.PodSpec{
Containers: []corev1.Container{{
Name: imageName,
Image: pkgTest.ImagePath(imageName),
ImagePullPolicy: corev1.PullIfNotPresent,
Args: []string{
"-msg-appender",
eventMsgAppender,
},
}},
RestartPolicy: corev1.RestartPolicyAlways,
},
}
}

// EventFilteringPod creates a Pod that either filter or send the received CloudEvent
func EventFilteringPod(name string, filter bool) *corev1.Pod {
const imageName = "filterevents"
Expand Down