From 5e1899fa216f172cb3f4d72a34f9c7eb5890343e Mon Sep 17 00:00:00 2001 From: Khor Shu Heng Date: Thu, 29 Oct 2020 16:08:57 +0800 Subject: [PATCH 1/3] Scaffolding for integration tests Signed-off-by: Khor Shu Heng --- .prow/config.yaml | 24 ++++++++++++++++++++++++ infra/scripts/test-integration.sh | 7 +++++++ tests/integration/__init__.py | 0 tests/integration/conftest.py | 12 ++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 infra/scripts/test-integration.sh create mode 100644 tests/integration/__init__.py create mode 100644 tests/integration/conftest.py diff --git a/.prow/config.yaml b/.prow/config.yaml index 717831c0ae3..1bcb9341825 100644 --- a/.prow/config.yaml +++ b/.prow/config.yaml @@ -141,6 +141,30 @@ presubmits: - image: golang:1.13 command: ["infra/scripts/test-golang-sdk.sh"] + - name: test-integration + decorate: true + always_run: true + spec: + containers: + - image: gcr.io/kf-feast/feast-ci:latest + command: ["infra/scripts/test-integration.sh"] + resources: + requests: + cpu: "1" + memory: "3072Mi" + env: + - name: GOOGLE_APPLICATION_CREDENTIALS + value: /etc/gcloud/service-account.json + volumeMounts: + - mountPath: /etc/gcloud/service-account.json + name: service-account + readOnly: true + subPath: service-account.json + volumes: + - name: service-account + secret: + secretName: feast-service-account + - name: test-end-to-end decorate: true always_run: true diff --git a/infra/scripts/test-integration.sh b/infra/scripts/test-integration.sh new file mode 100644 index 00000000000..e2116976f94 --- /dev/null +++ b/infra/scripts/test-integration.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +python -m pip install --upgrade pip setuptools wheel +make install-python +python -m pip install -qr tests/requirements.txt + +pytest tests/integration/ \ No newline at end of file diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py new file mode 100644 index 00000000000..503ddbe50a9 --- /dev/null +++ b/tests/integration/conftest.py @@ -0,0 +1,12 @@ +import pytest + + +def pytest_addoption(parser): + pass + + +def pytest_runtest_setup(item): + if "incremental" in item.keywords: + previousfailed = getattr(item.parent, "_previousfailed", None) + if previousfailed is not None: + pytest.xfail("previous test failed (%s)" % previousfailed.name) From 23fc5d78e763df444131eed55d425a7e782d84ef Mon Sep 17 00:00:00 2001 From: Khor Shu Heng Date: Thu, 29 Oct 2020 16:21:20 +0800 Subject: [PATCH 2/3] Rename test stage Signed-off-by: Khor Shu Heng --- .prow/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.prow/config.yaml b/.prow/config.yaml index 1bcb9341825..d1916b3fbd3 100644 --- a/.prow/config.yaml +++ b/.prow/config.yaml @@ -141,7 +141,7 @@ presubmits: - image: golang:1.13 command: ["infra/scripts/test-golang-sdk.sh"] - - name: test-integration + - name: python-sdk-integration-test decorate: true always_run: true spec: From 60bb8c54ec459a077bdadd1a077122b2d726ce86 Mon Sep 17 00:00:00 2001 From: Khor Shu Heng Date: Thu, 29 Oct 2020 16:28:15 +0800 Subject: [PATCH 3/3] Remove setup for incremental test marker Signed-off-by: Khor Shu Heng --- tests/integration/conftest.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 503ddbe50a9..4b82f1890cb 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -1,12 +1,2 @@ -import pytest - - def pytest_addoption(parser): pass - - -def pytest_runtest_setup(item): - if "incremental" in item.keywords: - previousfailed = getattr(item.parent, "_previousfailed", None) - if previousfailed is not None: - pytest.xfail("previous test failed (%s)" % previousfailed.name)