Skip to content

Commit fe36f6e

Browse files
author
zhilingc
committed
Separate images for unit and integration tests
1 parent e3092fa commit fe36f6e

5 files changed

Lines changed: 69 additions & 13 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM debian:stretch
2+
3+
RUN apt-get update && apt-get install -y make curl gnupg wget python
4+
5+
# Install kubectl gcloud and argo
6+
RUN wget -qO- https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-241.0.0-linux-x86_64.tar.gz | tar xzf - \
7+
&& /google-cloud-sdk/bin/gcloud -q components install kubectl \
8+
&& /google-cloud-sdk/install.sh \
9+
&& ln -s /google-cloud-sdk/bin/gcloud /usr/bin/gcloud
10+
RUN curl -sSL -o /usr/local/bin/argo https://github.com/argoproj/argo/releases/download/v2.2.1/argo-linux-amd64 \
11+
&& chmod +x /usr/local/bin/argo
12+
13+
COPY run.sh /usr/local/bin/
14+
15+
ENTRYPOINT ["run.sh"]
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
printenv
5+
6+
if [ $# -eq 0 ]
7+
then
8+
echo ""
9+
echo "please specify commands as arguments, for example \"make test\""
10+
echo ""
11+
exit 1
12+
fi
13+
14+
echo ""
15+
echo "cloning Feast repository..."
16+
echo ""
17+
18+
git clone https://github.com/gojek/feast
19+
cd feast
20+
21+
if [ -n "${PULL_NUMBER}" ] && [ "$JOB_TYPE" = "presubmit" ]
22+
then
23+
echo ""
24+
echo "fetching PR ${PULL_NUMBER}..."
25+
echo ""
26+
git fetch origin pull/"${PULL_NUMBER}"/head:pull_"${PULL_NUMBER}"
27+
28+
echo ""
29+
echo "checking out PR ${PULL_NUMBER}..."
30+
echo ""
31+
git checkout pull_"${PULL_NUMBER}"
32+
fi
33+
34+
echo "connecting to test cluster..."
35+
gcloud container clusters get-credentials primary-test-cluster --zone us-central1-a --project kf-feast
36+
echo "testing connection to argo..."
37+
argo list
38+
if [ $? -ne 0 ]
39+
then
40+
echo "failed to connect to argo"
41+
echo "exiting"
42+
exit 1
43+
fi
44+
45+
echo "sha:"
46+
git rev-parse HEAD
47+
echo ""
48+
echo "running tests"
49+
echo ""
50+
51+
$@

testing/docker-images/test-image/Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ RUN git clone https://github.com/gojek/feast \
66
&& cd feast && mvn test || true \
77
&& cd .. && rm -rf feast
88

9-
RUN apt-get install -y make curl gnupg wget python
10-
11-
# Install kubectl gcloud and argo
12-
RUN wget -qO- https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-241.0.0-linux-x86_64.tar.gz | tar xzf - \
13-
&& /google-cloud-sdk/bin/gcloud -q components install kubectl \
14-
&& /google-cloud-sdk/install.sh \
15-
&& ln -s /google-cloud-sdk/bin/gcloud /usr/bin/gcloud
16-
RUN curl -sSL -o /usr/local/bin/argo https://github.com/argoproj/argo/releases/download/v2.2.1/argo-linux-amd64 \
17-
&& chmod +x /usr/local/bin/argo
18-
199
COPY run.sh /usr/local/bin/
2010

2111
ENTRYPOINT ["run.sh"]

testing/integration/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
.PHONY: test-integration it-redis-bq-dataflow
1818

19-
ifeq ($(TYPE), "PR")
19+
ifeq ($(TYPE), PR)
2020
test-integration:
2121
argo submit --watch tests/redis-bq-dataflow/workflow.yaml -p prId=$(ID)
2222
else

testing/prow/config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ presubmits:
1111
always_run: false
1212
spec:
1313
containers:
14-
- image: us.gcr.io/kf-feast/test-image:1.0.0
14+
- image: us.gcr.io/kf-feast/gcloud-argo:1.0.0
1515
args: ["make", "test-integration", "ID=$PULL_NUMBER", "TYPE=PR"]
1616
imagePullPolicy: Always
1717
trigger: integration-batch
@@ -28,7 +28,7 @@ postsubmits:
2828
always_run: true
2929
spec:
3030
containers:
31-
- image: us.gcr.io/kf-feast/test-image:1.0.0
31+
- image: us.gcr.io/kf-feast/gcloud-argo:1.0.0
3232
args: ["make", "test-integration", "ID=$PULL_BASE_REF", "TYPE=GITREF"]
3333
imagePullPolicy: Always
3434
trigger: integration-batch

0 commit comments

Comments
 (0)