intel / iotivity-node

Node.js bindings for IoTivity
https://www.iotivity.org/
42 stars 44 forks source link

Failed to run iotivity-node tests with latest commit 3908662 #47

Closed wanghongjuan closed 8 years ago

wanghongjuan commented 8 years ago
Follow the steps https://github.com/otcshare/iotivity-node/issues/36 to run iotivity-node tests with latest commit 3908662:

Run below command:

$ cd /usr/lib/node_modules/iotivity-node
$ ./node_modules/grunt-cli/bin/grunt test

Show error message:

root@edison:/usr/lib/node_modules/iotivity-node# ./node_modules/grunt-cli/bin/grunt test
Running "jshint:nonlib" (jshint) task
>> 60 files lint free.

Running "jshint:lib" (jshint) task
>> 8 files lint free.

Running "jscs:js" (jscs) task
>> 68 files without code style errors.

Running "testsuite" task

API Complex Payload
/usr/lib/node_modules/iotivity-node/tests/suite.js:196
                            throw new Error( error );
                            ^

Error: Server requested teardown: Server: Constructing OicResource: malformed id, result: undefined
    at Object.spawnOptions.teardown (/usr/lib/node_modules/iotivity-node/tests/suite.js:196:14)
    at /usr/lib/node_modules/iotivity-node/tests/suite.js:96:13
    at arrayEach (/usr/lib/node_modules/iotivity-node/node_modules/lodash/index.js:1289:13)
    at Function.<anonymous> (/usr/lib/node_modules/iotivity-node/node_modules/lodash/index.js:3345:13)
    at Socket.serverStdoutData (/usr/lib/node_modules/iotivity-node/tests/suite.js:73:5)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at Pipe.onread (net.js:529:20)
Warning: Task "testsuite" failed. Use --force to continue.

Aborted due to warnings.

Try to reset one commit using below command:

$ git reset --hard HEAD^1
HEAD is now at 545195f README.md: Document install.sh environment variable named "SOURCE"

Then rerun the tests using above command, there is the similar error as reset commit id before, only show the part of output error message:

API Query Parameters
/usr/lib/node_modules/iotivity-node/tests/suite.js:196
                            throw new Error( error );
                            ^

Error: Server requested teardown: Failed to register resource: Error: Constructing OicResource: malformed id
    at Object.spawnOptions.teardown (/usr/lib/node_modules/iotivity-node/tests/suite.js:196:14)
    at /usr/lib/node_modules/iotivity-node/tests/suite.js:96:13
    at arrayEach (/usr/lib/node_modules/iotivity-node/node_modules/lodash/index.js:1289:13)
    at Function.<anonymous> (/usr/lib/node_modules/iotivity-node/node_modules/lodash/index.js:3345:13)
    at Socket.serverStdoutData (/usr/lib/node_modules/iotivity-node/tests/suite.js:73:5)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:153:18)
    at Socket.Readable.push (_stream_readable.js:111:10)
    at Pipe.onread (net.js:529:20)
Warning: Task "testsuite" failed. Use --force to continue.

Aborted due to warnings.
root@edison:/usr/lib/node_modules/iotivity-node#

If I reset one commit id again, the error is not reproduced.

wanghongjuan commented 8 years ago

Could you create a branch just like https://github.com/solettaproject/soletta/releases/tag/v1_beta19, that we(QA) can follow the release branch to run the tests?

gabrielschulhof commented 8 years ago

I don't get it. The tests run fine on travis. Are you sure the version of iotivity-node on the device corresponds to the test suite? There are changes to both the tests and the bindings between 545195f2bd94853907cd8f20441633e459dab8dc and 390866274386fe4d62ad8aa9a27a8c9f049b1cad, so the library on the device has to be based on 390866274386fe4d62ad8aa9a27a8c9f049b1cad if the tests you copy to the device are from 390866274386fe4d62ad8aa9a27a8c9f049b1cad. @nagineni have you been getting similar errors in the demo?

wanghongjuan commented 8 years ago

Oh~ Sorry, I know the reason, Ostro image intergate this repo based on 38f7679, I also should using https://github.com/otcshare/iotivity-node/releases/tag/1.0.1-1 to run those tests, but not latest code.