CI test fails but local test succeeds
My PR didn't pass the CI tests: https://github.com/Microsoft/pai/pull/383. Travis printed the following log (see details at https://travis-ci.org/Microsoft/pai/jobs/353246077):
21 passing (252ms)
1 failing
1) Submit job: PUT /api/v1/jobs/:jobName
Case 1 (Positive): Submit a job.:
Uncaught TypeError: "file" argument must be a non-empty string
...
npm ERR! Test failed. See above for more details.
The command "npm test" exited with 1.
Done. Your build exited with 1.
However, the code can pass all test cases on my local machine. I guess this is due to the diff of the versions of node. Can @abuccts have a look?
Ps. On two of my devboxes, the versions of nodejs are 6.11.0 and 6.13.1 respectively. Neither of them reported the above error.
In addition, there are too many log messages printed out when doing unit tests. Are they necessary?
@abuccts : I found there is a version mismatch between rest-server's nodejs and Travis's nodejs:
- The nodejs version is fixed at 6.13.1 when building rest-server image. See: https://github.com/Microsoft/pai/blob/e0c5534ce8b7d67fa2086fa2af7cac93c74dddec/service-deployment/src/rest-server/dockerfile.template#L18
- But nodejs 7 and 8 are tested. See: https://github.com/Microsoft/pai/blob/e0c5534ce8b7d67fa2086fa2af7cac93c74dddec/.travis.yml#L48
It looks we should remove the nodejs:7 and nodejs:8 sections in Travis configuration. What do you think?
Final solution: Remove the nodejs:8 test in Travis configuration.