Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

[WIP] coverage #881

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .pfnci/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -62,6 +63,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -88,6 +90,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -112,6 +115,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand Down Expand Up @@ -165,6 +169,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -189,6 +194,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -215,6 +221,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -239,6 +246,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand Down Expand Up @@ -292,6 +300,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -316,6 +325,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -342,6 +352,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -366,6 +377,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand Down Expand Up @@ -419,6 +431,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -443,6 +456,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -469,6 +483,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -493,6 +508,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand Down Expand Up @@ -546,6 +562,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -570,6 +587,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -596,6 +614,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -620,6 +639,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand Down Expand Up @@ -673,6 +693,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -697,6 +718,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "1"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -723,6 +745,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand All @@ -747,6 +770,7 @@ configs {
key: "OPTIONAL_MODULES"
value: "0"
}
quickfix_checkout_dot_git: true
}
}
configs {
Expand Down
6 changes: 5 additions & 1 deletion .pfnci/docker/devel-minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ RUN curl -LO https://bootstrap.pypa.io/get-pip.py \
&& rm get-pip.py

RUN pip2 install --no-cache-dir \
coveralls[yaml] \
cython \
mock \
pytest \
pytest-cov \
&& pip3 install --no-cache-dir \
coveralls[yaml] \
cython \
mock \
pytest
pytest \
pytest-cov
4 changes: 4 additions & 0 deletions .pfnci/docker/devel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,22 @@ RUN cd $(mktemp -d) \
RUN echo /usr/local/lib/ > /etc/ld.so.conf.d/local.conf && ldconfig

RUN pip2 install --no-cache-dir \
coveralls[yaml] \
cython \
matplotlib==2.1 \
mock \
mpi4py \
'git+https://github.com/cocodataset/coco.git#egg=pycocotools&subdirectory=PythonAPI' \
pytest \
pytest-cov \
scipy \
&& pip3 install --no-cache-dir \
coveralls[yaml] \
cython \
matplotlib \
mock \
mpi4py \
'git+https://github.com/cocodataset/coco.git#egg=pycocotools&subdirectory=PythonAPI' \
pytest \
pytest-cov \
scipy
6 changes: 5 additions & 1 deletion .pfnci/gen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ def test_config(python, chainer, optional, target):
value['requirement']['memory'] = 36
value['time_limit'] = {'seconds': 3600}
value['command'] = 'sh .pfnci/tests.sh'
value['quickfix_checkout_dot_git'] = True
elif target == 'gpu':
key += '.gpu'
value['requirement']['gpu'] = 1
value['command'] = 'sh .pfnci/tests_gpu.sh'
value['quickfix_checkout_dot_git'] = True
elif target == 'examples':
key += '.examples'
value['requirement']['gpu'] = 2
Expand Down Expand Up @@ -79,7 +81,9 @@ def main():

def dump_pbtxt(key, value, level=0):
indent = ' ' * level
if isinstance(value, int):
if isinstance(value, bool):
print('{}{}: {}'.format(indent, key, 'true' if value else 'false'))
elif isinstance(value, int):
print('{}{}: {}'.format(indent, key, value))
elif isinstance(value, str):
print('{}{}: "{}"'.format(indent, key, value))
Expand Down
5 changes: 5 additions & 0 deletions .pfnci/tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ gsutil -q cp gs://chainercv-pfn-public-ci/datasets-tiny.zip .
unzip -q datasets-tiny.zip
rm datasets-tiny.zip

gsutil -q cp gs://chainercv-pfn-public-ci/.coveralls.yml chainercv/

docker run --interactive --rm \
--volume $(pwd):/root/ --workdir /root/ \
--env MPLBACKEND=agg \
Expand All @@ -17,10 +19,13 @@ docker run --interactive --rm \
pip${PYTHON} install --user pytest-xdist
cd chainercv/
python${PYTHON} -m pytest --color=no -n $(nproc) \
--cov=chainercv/ --cov-report= \
-m 'not pfnci_skip and not gpu and not mpi' tests/
if which mpiexec; then
mpiexec -n 2 --allow-run-as-root \
python${PYTHON} -m pytest --color=no \
--cov=chainercv/ --cov-report= --cov-append \
-m 'not pfnci_skip and not gpu and mpi' tests/
fi
coveralls
EOD
5 changes: 5 additions & 0 deletions .pfnci/tests_gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ set -eux

. $(dirname $0)/common.sh

gsutil -q cp gs://chainercv-pfn-public-ci/.coveralls.yml chainercv/

docker run --runtime=nvidia --interactive --rm \
--volume $(pwd):/root/ --workdir /root/ \
--env MPLBACKEND=agg \
Expand All @@ -11,10 +13,13 @@ docker run --runtime=nvidia --interactive --rm \
. ./install.sh
cd chainercv/
python${PYTHON} -m pytest --color=no \
--cov=chainercv/ --cov-report= \
-m 'not pfnci_skip and gpu and not mpi' tests/
if which mpiexec; then
mpiexec -n 2 --allow-run-as-root \
python${PYTHON} -m pytest --color=no \
--cov=chainercv/ --cov-report= --cov-append \
-m 'not pfnci_skip and gpu and mpi' tests/
fi
coveralls
EOD