From 17c1623405ba439a037065f2877ff084276b7d65 Mon Sep 17 00:00:00 2001 From: workingloong Date: Tue, 17 Mar 2020 20:40:10 +0800 Subject: [PATCH] Config pre-commit and unit test for elasticdl_preprocessing --- .travis.yml | 2 +- elasticdl_preprocessing/layers/__init__.py | 0 elasticdl_preprocessing/tests/__init__.py | 0 scripts/unittest.sh | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 elasticdl_preprocessing/layers/__init__.py create mode 100644 elasticdl_preprocessing/tests/__init__.py diff --git a/.travis.yml b/.travis.yml index 0d3fcaf33..578b05f9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ jobs: name: "Pre-commit Check" script: - docker build --target dev -t elasticdl:dev -f elasticdl/docker/Dockerfile . - - docker run --rm -it -v $PWD:/work -w /work elasticdl:dev bash -c "pre-commit run --files $(find elasticdl/python model_zoo setup.py scripts/ -name '*.py' -print0 | tr '\0' ' ') $(find elasticdl/pkg -name '*.go' -print0 | tr '\0' ' ')" + - docker run --rm -it -v $PWD:/work -w /work elasticdl:dev bash -c "pre-commit run --files $(find elasticdl/python elasticdl_preprocessing model_zoo setup.py scripts/ -name '*.py' -print0 | tr '\0' ' ') $(find elasticdl/pkg -name '*.go' -print0 | tr '\0' ' ')" - stage: tests name: "Tests" script: diff --git a/elasticdl_preprocessing/layers/__init__.py b/elasticdl_preprocessing/layers/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/elasticdl_preprocessing/tests/__init__.py b/elasticdl_preprocessing/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/unittest.sh b/scripts/unittest.sh index 47092ad8c..74bfef7fe 100755 --- a/scripts/unittest.sh +++ b/scripts/unittest.sh @@ -9,5 +9,5 @@ go test -v -cover ./... popd # Python unittests -K8S_TESTS=True pytest elasticdl/python/tests --cov=elasticdl/python --cov-report=xml +K8S_TESTS=True pytest elasticdl/python/tests elasticdl_preprocessing/tests --cov=elasticdl/python --cov-report=xml mv coverage.xml shared \ No newline at end of file