Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
switch nose with pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
szha committed Apr 11, 2020
1 parent 0597f87 commit b7ab4a2
Show file tree
Hide file tree
Showing 189 changed files with 628 additions and 802 deletions.
Empty file modified benchmark/opperf/opperf.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion cd/python/docker/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ARG BASE_IMAGE
FROM ${BASE_IMAGE}

# Install test dependencies
RUN pip install nose
RUN pip install pytest

ARG USER_ID=1001
ARG GROUP_ID=1001
Expand Down
Empty file modified cd/python/pypi/pypi_publish.py
100755 → 100644
Empty file.
Empty file modified cd/utils/artifact_repository.py
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ sudo pip3 install --upgrade --force-reinstall build/mxnet-1.3.1-py2.py3-none-any
# Execute a single python test:
nosetests-3.4 -v -s tests/python/unittest/test_ndarray.py
pytest -v --capture=no tests/python/unittest/test_ndarray.py
# Debug with cgdb
Expand Down
2 changes: 1 addition & 1 deletion ci/dev_menu.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def provision_virtualenv(venv_path=DEFAULT_PYENV):
provision_virtualenv,
]),
('[Local] Python Unit tests',
"./py3_venv/bin/nosetests -v tests/python/unittest/"
"pytest -v tests/python/unittest/"
),
('[Docker] Build the MXNet binary - outputs to "lib/"',
"ci/build.py --platform ubuntu_cpu_lite /work/runtime_functions.sh build_ubuntu_cpu_docs"),
Expand Down
4 changes: 4 additions & 0 deletions ci/docker/Dockerfile.build.centos7_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ WORKDIR /work/deps

COPY install/centos7_core.sh /work/
RUN /work/centos7_core.sh

COPY install/centos7_ccache.sh /work/
RUN /work/centos7_ccache.sh

COPY install/centos7_python.sh /work/
COPY install/requirements /work/
RUN /work/centos7_python.sh

COPY install/centos7_scala.sh /work/
RUN /work/centos7_scala.sh

Expand Down
3 changes: 3 additions & 0 deletions ci/docker/Dockerfile.build.centos7_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ WORKDIR /work/deps

COPY install/centos7_core.sh /work/
RUN /work/centos7_core.sh

COPY install/centos7_ccache.sh /work/
RUN /work/centos7_ccache.sh

COPY install/centos7_python.sh /work/
COPY install/requirements /work/
RUN /work/centos7_python.sh

ENV CUDNN_VERSION=7.6.0.64
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ RUN /work/ubuntu_mkl.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
RUN /work/ubuntu_docs.sh

Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_cpu_julia
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ RUN /work/ubuntu_mkl.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
RUN /work/ubuntu_docs.sh

Expand Down
5 changes: 1 addition & 4 deletions ci/docker/Dockerfile.build.ubuntu_cpu_python
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ COPY install/ubuntu_python.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_python.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
RUN /work/ubuntu_docs.sh

Expand All @@ -46,4 +43,4 @@ RUN /work/ubuntu_adduser.sh

COPY runtime_functions.sh /work/

WORKDIR /work/mxnet
WORKDIR /work/mxnet
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu100
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ RUN /work/ubuntu_llvm.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_docs.sh
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu101
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ RUN /work/ubuntu_llvm.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_docs.sh
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu102
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ RUN /work/ubuntu_llvm.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_docs.sh
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu80
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ RUN /work/ubuntu_llvm.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_docs.sh
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu90
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ RUN /work/ubuntu_llvm.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_docs.sh
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_gpu_cu92
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ RUN /work/ubuntu_llvm.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_docs.sh
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_nightly_cpu
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ RUN /work/ubuntu_clang.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_docs.sh
Expand Down
3 changes: 0 additions & 3 deletions ci/docker/Dockerfile.build.ubuntu_nightly_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ RUN /work/ubuntu_llvm.sh
COPY install/ubuntu_caffe.sh /work/
RUN /work/ubuntu_caffe.sh

COPY install/ubuntu_onnx.sh /work/
RUN /work/ubuntu_onnx.sh

COPY install/ubuntu_docs.sh /work/
COPY install/requirements /work/
RUN /work/ubuntu_docs.sh
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/install/centos7_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ yum -y install python36u
# Install PIP
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python3.6 get-pip.py
pip3 install nose pylint numpy nose-timer requests h5py scipy==1.2.3
pip3 install -r /work/requirements
10 changes: 8 additions & 2 deletions ci/docker/install/requirements
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ Cython==0.29.7
decorator==4.4.0
h5py==2.8.0rc1
mock==2.0.0
nose==1.3.7
nose-timer==0.7.3
numpy>1.16.0,<2.0.0
pylint==2.3.1; python_version >= '3.0'
requests<2.19.0,>=2.18.4
scipy==1.2.1
six==1.11.0
setuptools
pytest==5.3.2
pytest-env==0.6.2
pytest-cov==2.8.1
pytest-xdist==1.31.0
protobuf==3.5.2
onnx==1.3.0
Pillow==5.0.0
tabulate==0.7.5
34 changes: 0 additions & 34 deletions ci/docker/install/ubuntu_onnx.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ci/docker/install/ubuntu_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ apt-get install -y python python-pip python3 python3-pip
python3 -m pip install --upgrade 'pip<19'

# Restrict numpy version to <1.18 due to use of Python 3.4 on Ubuntu 14.04
python3 -m pip install --upgrade --ignore-installed nose cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' nose-timer 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3
python3 -m pip install --upgrade --ignore-installed cpplint==1.3.0 pylint==2.3.1 'numpy>1.16.0,<1.18' 'requests<2.19.0,>=2.18.4' h5py==2.8.0rc1 scipy==1.0.1 boto3 pytest==4.6.9 pytest-env==0.6.2 pytest-cov==2.8.1 pytest-xdist==1.31.0

# CMake 3.13.2+ is required
mkdir /opt/cmake && cd /opt/cmake
Expand Down
1 change: 1 addition & 0 deletions ci/docker/install/ubuntu_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set -ex
# install libraries for mxnet's python package on ubuntu
apt-get update || true
apt-get install -y python-dev python3-dev virtualenv wget
apt-get install -y libprotobuf-dev protobuf-compiler

# the version of the pip shipped with ubuntu may be too lower, install a recent version here
wget -nv https://bootstrap.pypa.io/get-pip.py
Expand Down
6 changes: 2 additions & 4 deletions ci/docker/qemu/runtime_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ def run_ut_python3_qemu_internal():
logging.info("=== NOW Running inside QEMU ===")
logging.info("PIP Installing %s", pkg)
check_call(['sudo', 'pip3', 'install', pkg])
logging.info("PIP Installing mxnet/test_requirements.txt")
logging.info("PIP Installing mxnet/test_requirements.txt")
check_call(['sudo', 'pip3', 'install', '-r', 'mxnet/test_requirements.txt'])
logging.info("Running tests in mxnet/tests/python/unittest/")
check_call(['nosetests', '--with-timer', '--with-xunit', '--xunit-file', 'nosetests_unittest.xml', '--verbose', 'mxnet/tests/python/unittest/test_engine.py'])
# Example to run a single unit test:
# check_call(['nosetests', '--with-timer', '--with-xunit', '--xunit-file', 'nosetests_unittest.xml', '--verbose', 'mxnet/tests/python/unittest/test_ndarray.py:test_ndarray_fluent'])
check_call(['pytest', '--durations=50', '--cov-report', 'xml:tests_unittest.xml', '-v', 'mxnet/tests/python/unittest/test_engine.py'])



Expand Down
Loading

0 comments on commit b7ab4a2

Please sign in to comment.