invoke NN smoketests from a python loop instead of a batch file (#18756)
authorKarl Ostmo <kostmo@gmail.com>
Tue, 16 Apr 2019 19:59:27 +0000 (12:59 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 16 Apr 2019 20:11:03 +0000 (13:11 -0700)
commitc8897d22632934f6c20af0ce861e2df02d11e3c1
treefebf933621a4e0b2feae3681414d478051d6cbc9
parent1c5073fb4bb7fdb73b4137e4fcf9bc7345ab4b9a
invoke NN smoketests from a python loop instead of a batch file (#18756)

Summary:
I tried first to convert the `.bat` script to a Bash `.sh` script, but I got this error:
```
[...]/build/win_tmp/ci_scripts/test_python_nn.sh: line 3: fg: no job control
```
Line 3 was where `%TMP_DIR%/ci_scripts/setup_pytorch_env.bat` was invoked.

I found a potential workaround on stack overflow of adding the `monitor` (`-m`) flag to the script, but hat didn't work either:

```
00:58:00 /bin/bash: cannot set terminal process group (3568): Inappropriate ioctl for device
00:58:00 /bin/bash: no job control in this shell
00:58:00 + %TMP_DIR%/ci_scripts/setup_pytorch_env.bat
00:58:00 /c/Jenkins/workspace/pytorch-builds/pytorch-win-ws2016-cuda9-cudnn7-py3-test1/build/win_tmp/ci_scripts/test_python_nn.sh: line 3: fg: no job control
```

So instead I decided to use Python to replace the `.bat` script.  I believe this is an improvement in that it's both "table-driven" now and cross-platform.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18756

Differential Revision: D14957570

Pulled By: kostmo

fbshipit-source-id: 87794e64b56ffacbde4fd44938045f9f68f7bc2a
.jenkins/pytorch/win-test-helpers/run_python_nn_smoketests.py [new file with mode: 0755]
.jenkins/pytorch/win-test-helpers/test_python_nn.bat