Skip to content

Commit

Permalink
Revert "Revert "test: add expand_step_test.go. Fixes #131""
Browse files Browse the repository at this point in the history
This reverts commit d5cb429.
  • Loading branch information
alexec committed Jul 21, 2021
1 parent d5cb429 commit e4215b3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions test/e2e/expand_step_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// +build test

package e2e

import (
. "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
. "github.com/argoproj-labs/argo-dataflow/test"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"testing"
)

func TestExpandStep(t *testing.T) {
defer Setup(t)()

CreatePipeline(Pipeline{
ObjectMeta: metav1.ObjectMeta{Name: "expand"},
Spec: PipelineSpec{
Steps: []StepSpec{
{
Name: "main",
Expand: &Expand{},
Sources: []Source{{HTTP: &HTTPSource{}}},
Sinks: []Sink{{Log: &Log{}}},
},
},
},
})

WaitForPod()

defer StartPortForward("expand-main-0")()

SendMessageViaHTTP(`{"foo.bar": "baz"}`)

WaitForPipeline(UntilMessagesSunk)
WaitForStep(TotalSunkMessages(1))

ExpectLogLine("main", `"foo":`)

DeletePipelines()
WaitForPodsToBeDeleted()
}
2 changes: 1 addition & 1 deletion test/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func podsLogContains(ctx context.Context, podList *corev1.PodList, containerName
resultChan := make(chan bool)
for _, p := range podList.Items {
go func(podName string) {
log.Printf("Watching pod: %s\n", podName)
log.Printf("watching pod: %s\n", podName)
contains, err := podLogContains(cctx, podName, containerName, pattern)
if err != nil {
errChan <- err
Expand Down

0 comments on commit e4215b3

Please sign in to comment.