CI: New Docker tests for Python with numpy (#5677)

* New Docker tests for Python with numpy

* print numpy status in test suite
This commit is contained in:
Robert Winslow
2019-12-24 02:14:55 -05:00
committed by GitHub
parent 3a70e0b308
commit 7de668053f
3 changed files with 25 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
FROM python:2.7.15-slim-stretch as base
WORKDIR /code
ADD . .
RUN cp flatc_debian_stretch flatc
WORKDIR /code/tests
RUN python --version
RUN pip install numpy
RUN pip install coverage
RUN ./PythonTest.sh

View File

@@ -0,0 +1,9 @@
FROM python:3.7.1-slim-stretch as base
WORKDIR /code
ADD . .
RUN cp flatc_debian_stretch flatc
WORKDIR /code/tests
RUN python --version
RUN pip install numpy
RUN pip install coverage
RUN ./PythonTest.sh

View File

@@ -2368,6 +2368,13 @@ def main():
kwargs = dict(argv=sys.argv[:-3])
# show whether numpy is present, as it changes the test logic:
try:
import numpy
print('numpy available')
except ImportError:
print('numpy not available')
# run tests, and run some language comparison checks if needed:
success = backward_compatible_run_tests(**kwargs)
if success and os.environ.get('COMPARE_GENERATED_TO_GO', 0) == "1":