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 85 forks source link

[Bug?] Using device data JEXL context when executing `iotAgentLib.update` into tests #1523

Open mapedraza opened 9 months ago

mapedraza commented 9 months ago

When executing tests in IoTA Lib as usual way ( using iotAgentLib.update method ), the device JEXL context does not include parameters such as service, subservice or device ID.

I do not know if this is something that need to be fixed, but, at least, it should be documented. Found when migrating https://github.com/telefonicaid/iotagent-json/pull/769 to this repo

This PR adds a test to verify it (it is green since it is not comparing the value, need to be amended)

mapedraza commented 9 months ago

As you can see here: https://github.com/telefonicaid/iotagent-node-lib/actions/runs/6809822840/job/18516853776?pr=1523#step:5:905

The result is:

{
  id: 'testContext',
  type: 'testNullExplicit',
  a: {
    type: 'Number',
    value: 'Text123:undefinedundefinedundefinedtestNullExplicit'
  }

See the expression used:

expression: 'a+":"+service+subservice+id+type'