intel / iotivity-node

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

Failed to complete run iotivity-node tests on device #38

Closed wanghongjuan closed 8 years ago

wanghongjuan commented 8 years ago
Using grunt to run the test of this repo on device
  1. Set up the command grunt can run normally on test device:
root@intel-corei7-64:/usr/lib/node_modules/iotivity-node# grunt
-sh: grunt: command not found

Failed to run command grunt because of lack of modules grunt-cli under the directory iotivity-node/node_modules, so I copy the module grunt-cli from desktop to test device:

$ scp -r grunt-cli root@test-device-ip:/usr/lib/node_modules/iotivity-node/node_modules
$ ssh root@test-device-ip
$ cd /usr/lib/node_modules/iotivity-node
$ ./node_modules/grunt-cli/bin/grunt -h

The command grunt can run normally

  1. Copy all relevant files with test to device, but need to build file dlopennow.node at first on desktop.
$ scp -r .jscsrc Gruntfile.js grunt-build package.json tests root@test-device-ip:/usr/lib/node_modules/iotivity-node/
$ scp -r build/Release/dlopennow.node root@test-device-ip:/usr/lib/node_modules/iotivity-node/ build/Release/
$ ./node_modules/grunt-cli/bin/grunt test

Only show the part of output error message:

Resource Operations
✓ @      2738: OCInit successful
✓ @      2740: OCSetDeviceInfo successful
✓ @      2741: OCSetPlatformInfo successful
✓ @      2742: OCGetNumberOfResources(to establish initial count) successful
✓ @      2743: OCCreateResource(parent) successful
✓ @      2754: OCGetNumberOfResources successful
✓ @      2755: OCGetNumberOfResources reports an increase by one resource after OCCreateResource
✓ @      2756: OCGetResourceHandler initially returns the initial entity handler
✓ @      2760: OCBindResourceHandler successful
✓ @      2761: OCGetResourceHandler returns the alternate entity handler after setting it
✓ @      2763: OCGetResourceUri returns the correct URI
✓ @      2763: OCGetNumberOfResourceInterfaces successful
✓ @      2764: Initially there is only one interface on the resource
✓ @      2765: OCBindResourceInterfaceToResource successful
✓ @      2766: OCGetNumberOfResourceInterfaces successful
✓ @      2767: After adding an interface there are two interfaces on the resource
✓ @      2768: First interface is 'oic.if.baseline'
/usr/lib/node_modules/iotivity-node/tests/tests/Resource Operations.js:143
  iotivity.__compareResourceHandles( resourceHandleReceptacle.handle,
           ^
TypeError: undefined is not a function
    at Object.<anonymous> (/usr/lib/node_modules/iotivity-node/tests/tests/Resource Operations.js:143:11)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
✓ @      2769: Second interface is 'a.b.c'
✓ @      2771: OCBindResourceTypeToResource successful
✓ @      2771: OCGetNumberOfResourceTypes successful
✓ @      2772: After adding a type there are two types on the resource
✓ @      2773: First type is correct
✓ @      2774: Second type is correct
✓ @      2776: OCGetResourceProperties correctly returns properties set on resource
✗ @      2779: Test exited successfully (1)
Actual: 
false
Expected: 
true
✓ @      2793: Test did not segfault
✗ @      2810: Expected 35 assertions, but 26 were run
Actual: 
null
Expected: 
undefined
Total assertions: ( 319 + 4 ) / 323
Warning: Task "testsuite" failed. Use --force to continue.

Aborted due to warnings.
zqzhang commented 8 years ago

Aborted due to warnings.

The issue here is to track the abort error here.

gabrielschulhof commented 8 years ago

I've already pushed a commit that gets rid of the various TESTING-dependent code in the iotivity-node.node module.

zqzhang commented 8 years ago

Sorry, which commit are you talking about? Is that the root cause of the abort due to warnings?

gabrielschulhof commented 8 years ago

D'oh! Sorry! I forgot to push the commit. My bad! I'll push it in a second :)