Unverified Commit 817210cf authored by Michał Karzyński's avatar Michał Karzyński Committed by GitHub

Travis tests bugfix (#1550)

parent e9443168
#!/bin/bash
set -e
echo "--TRAVIS VARIABLES--"
echo "TRAVIS_OS_NAME:" ${TRAVIS_OS_NAME}
echo "TRAVIS_BUILD_DIR:" ${TRAVIS_BUILD_DIR}
echo "--CUSTOM VARIABLES--"
echo "TASK:" ${TASK}
echo "OS:" ${OS}
# LINUX TASKS
if [ ${TRAVIS_OS_NAME} == "linux" ]; then
if [ ${TASK} == "cpp_test" ]; then
if [ ${TASK} == "cpp_test" ]; then
docker run -w '/root/ngraph/build' test_ngraph make unit-test-check
fi
fi
if [ ${TASK} == "python2_test" ]; then
if [ ${TASK} == "python2_test" ]; then
docker run -w '/root/ngraph/python' test_ngraph tox -e py27
fi
fi
if [ ${TASK} == "python3_test" ]; then
if [ ${TASK} == "python3_test" ]; then
docker run -w '/root/ngraph/python' test_ngraph tox -e py3
fi
fi
# MacOS TASKS
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
if [ ${TASK} == "cpp_test" ]; then
cd ${TRAVIS_BUILD_DIR}/build
make unit-test-check
fi
fi
......@@ -8,10 +8,12 @@ matrix:
- os: linux
sudo: required
services: docker
language: python
env: TASK=python2_test OS=ubuntu
- os: linux
sudo: required
services: docker
language: python
env: TASK=python3_test OS=ubuntu
- os: linux
sudo: required
......@@ -37,17 +39,11 @@ install:
-DNGRAPH_ONNX_IMPORT_ENABLE=TRUE \
-DCMAKE_INSTALL_PREFIX="~/ngraph_dist"
make -j 2
cd -
fi
script:
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
.ci/travis/run_test.sh
fi
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
cd $TRAVIS_BUILD_DIR/build
make unit-test-check
fi
- .ci/travis/run_test.sh
branches:
only:
......
......@@ -22,15 +22,15 @@ from test.ngraph.util import get_runtime
def test_import_onnx_function():
dtype = np.float32
cur_dir = os.path.dirname(__file__)
model_path = os.path.join(cur_dir, 'models/add_abc.onnx')
model_path = os.path.join(os.path.dirname(__file__), 'models/add_abc.onnx')
ng_function = load_onnx_model_file(model_path)[0]
dtype = np.float32
value_a = np.array([1.0], dtype=dtype)
value_b = np.array([2.0], dtype=dtype)
value_c = np.array([3.0], dtype=dtype)
result = ng_function(value_a, value_b, value_c, runtime=get_runtime())
runtime = get_runtime()
computation = runtime.computation(ng_function)
result = computation(value_a, value_b, value_c)
assert np.allclose(result, np.array([6], dtype=dtype))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment