telefonicaid / iotagent-node-lib

Module to enable IoT Agent developers to build custom agents for their devices that can easily connect to NGSI Context Brokers
https://iotagent-node-lib.rtfd.io/
GNU Affero General Public License v3.0
60 stars 88 forks source link

What is the correct configuration to run the tests? #910

Closed bobeal closed 4 years ago

bobeal commented 4 years ago

Hello,

As discussed with @jason-fox, I've started working on the feature to support replace mode when batch updating entities in the CB.

However, I must have missed something in my configuration since I've a lot (232 !) of failing tests.

What I've done so far:

I can't attach a file to the issue but here are the typical errors I can see in the reports:

  81) NGSI-LD - Timestamp processing plugin
       "before each" hook for "should return an entity with all its timestamps expanded to have separators":
     Error: Timeout of 3000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/bobeal/egm/dev/iotagent-node-lib/test/unit/ngsi-ld/plugins/timestamp-processing-plugin_test.js)

  188) NGSI-v2 - Provisioning API: Single service mode
       "after each" hook for "should raise a DUPLICATE_GROUP error":
     Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
      at Server.close (net.js:1566:12)
      at Server.EventEmitter.emit (domain.js:466:23)
      at emitCloseNT (net.js:1619:8)
      at process._tickCallback (internal/process/next_tick.js:63:19)

  189) NGSI-v2 - Device provisioning API: Update provisioned devices
       "before each" hook for "should return a 200 OK and no errors":
     Uncaught Error: listen EADDRINUSE: address already in use 0.0.0.0:4041
      at Server.setupListenHandle [as _listen2] (net.js:1280:14)
      at listenInCluster (net.js:1328:12)
      at doListen (net.js:1461:7)
      at process._tickCallback (internal/process/next_tick.js:63:19)

What did I miss?

fgalan commented 4 years ago

I've started working on the feature to support replace mode when batch updating entities in the CB.

Can you elaborate on this feature, please?

bobeal commented 4 years ago

I've started working on the feature to support replace mode when batch updating entities in the CB.

Can you elaborate on this feature, please?

All the details are here: https://github.com/telefonicaid/iotagent-node-lib/pull/888 (and it is update mode, not replace!)

fgalan commented 4 years ago

Which base branch are you using? feature/842_ngsi_ld?

bobeal commented 4 years ago

Which base branch are you using? feature/842_ngsi_ld?

Yes, I'm based on the NGSI-LD feature branch.

fgalan commented 4 years ago

Note that tests are passing ok in that branch by travis in PR https://github.com/telefonicaid/iotagent-node-lib/pull/849. Thus, maybe the problem is in your local setup.

As word of advice, try to follow the same steps that travis execute to pass the tests, detailed in .travis.yml file

bobeal commented 4 years ago

Note that tests are passing ok in that branch by travis in PR #849. Thus, maybe the problem is in your local setup.

As word of advice, try to follow the same steps that travis execute to pass the tests, detailed in .travis.yml file

Ok, got it working. It was a problem with my MongoDB container configuration. Thanks!