Skip to content

Commit

Permalink
feat: add udsource python e2e (#1204)
Browse files Browse the repository at this point in the history
Signed-off-by: Sidhant Kohli <[email protected]>
  • Loading branch information
kohlisid committed Oct 14, 2023
1 parent fea2965 commit 0748449
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,16 @@ test-coverage-with-isb:
test-code:
go test -tags=isb_redis -race -v $(shell go list ./... | grep -v /vendor/ | grep -v /numaflow/test/) -timeout 120s

test-e2e-suite-1:
test-e2e-suite-2:
test-e2e:
test-kafka-e2e:
test-http-e2e:
test-nats-e2e:
test-sdks-e2e:
test-reduce-e2e:
test-api-e2e:
test-udsource-e2e:
test-transformer-e2e:
test-diamond-e2e:
test-%:
$(MAKE) cleanup-e2e
$(MAKE) image e2eapi-image
Expand Down
2 changes: 1 addition & 1 deletion test/udsource-e2e/testdata/simple-source-go.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
name: simple-source
name: simple-source-go
spec:
vertices:
- name: in
Expand Down
2 changes: 1 addition & 1 deletion test/udsource-e2e/testdata/simple-source-java.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
name: simple-source
name: simple-source-java
spec:
vertices:
- name: in
Expand Down
22 changes: 22 additions & 0 deletions test/udsource-e2e/testdata/simple-source-python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: numaflow.numaproj.io/v1alpha1
kind: Pipeline
metadata:
name: simple-source-python
spec:
vertices:
- name: in
source:
udsource:
container:
# A simple user-defined source for e2e testing
# See https://github.com/numaproj/numaflow-python/tree/main/examples/source
image: quay.io/numaio/numaflow-python/simple-source:v0.5.3
imagePullPolicy: Always
limits:
readBatchSize: 2
- name: out
sink:
log: {}
edges:
- from: in
to: out
27 changes: 25 additions & 2 deletions test/udsource-e2e/udsource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package e2e

import (
"fmt"
"sync"
"testing"

"github.com/stretchr/testify/suite"
Expand All @@ -31,14 +32,36 @@ type UserDefinedSourceSuite struct {
E2ESuite
}

func (s *UserDefinedSourceSuite) TestSimpleSourceGo() {
func (s *UserDefinedSourceSuite) testSimpleSourceGo() {
s.testSimpleSource("go")
}

func (s *UserDefinedSourceSuite) TestSimpleSourceJava() {
func (s *UserDefinedSourceSuite) testSimpleSourceJava() {
s.testSimpleSource("java")
}

func (s *UserDefinedSourceSuite) testSimpleSourcePython() {
s.testSimpleSource("python")
}

func (s *UserDefinedSourceSuite) TestUDSource() {
var wg sync.WaitGroup
wg.Add(3)
go func() {
defer wg.Done()
s.testSimpleSourcePython()
}()
go func() {
defer wg.Done()
s.testSimpleSourceJava()
}()
go func() {
defer wg.Done()
s.testSimpleSourceGo()
}()
wg.Wait()
}

func (s *UserDefinedSourceSuite) testSimpleSource(lang string) {
w := s.Given().Pipeline(fmt.Sprintf("@testdata/simple-source-%s.yaml", lang)).
When().
Expand Down

0 comments on commit 0748449

Please sign in to comment.