Skip to content

Commit d500001

Browse files
davidheryantobudi
authored andcommitted
Add Prow job for unit testing Python SDK (#209)
* Add unit test for Python SDK * Fix path when running pytest
1 parent 309ad10 commit d500001

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

.prow/config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@ presubmits:
8585
value: "on"
8686
command: [".prow/scripts/run_unit_test.sh", "--component", "cli"]
8787

88+
- name: unit-test-python-sdk
89+
decorate: true
90+
always_run: true
91+
spec:
92+
volumes:
93+
- name: service-account
94+
secret:
95+
secretName: prow-service-account
96+
containers:
97+
- image: python:3.6
98+
volumeMounts:
99+
- name: service-account
100+
mountPath: /etc/service-account
101+
readOnly: true
102+
env:
103+
- name: GOOGLE_APPLICATION_CREDENTIALS
104+
value: /etc/service-account/service-account.json
105+
command: [".prow/scripts/run_unit_test.sh", "--component", "python-sdk"]
106+
88107
- name: integration-test
89108
decorate: true
90109
always_run: true

.prow/scripts/run_unit_test.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,15 @@ elif [[ ${COMPONENT} == "cli" ]]; then
4242
go get -u github.com/jstemmer/go-junit-report
4343
go test -v ./cli/feast/... 2>&1 | tee test_output
4444
TEST_EXIT_CODE=$?
45-
cat test_output | ${GOPATH}/bin/go-junit-report > ${ARTIFACTS}/report.xml
45+
cat test_output | ${GOPATH}/bin/go-junit-report > ${ARTIFACTS}/unittest-cli-report.xml
46+
47+
elif [[ ${COMPONENT} == "python-sdk" ]]; then
48+
49+
cd sdk/python
50+
pip install -r requirements-test.txt
51+
pip install .
52+
pytest ./tests --junitxml=${ARTIFACTS}/unittest-pythonsdk-report.xml
53+
TEST_EXIT_CODE=$?
4654

4755
else
4856
usage; exit 1

0 commit comments

Comments
 (0)