-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Task/travis ci #105
Task/travis ci #105
Changes from 14 commits
b88dd96
4c75d50
70f8484
8195e12
4aa60ca
0c7c001
597ce81
d407223
ee6d771
994b6d9
0de8f25
80d7cfc
6d590dd
babe984
9ccd486
441870d
b225434
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
- Update Howtos with the last changes of the IoT Agent library (#48). | ||
- Add test cases to check first observation of a value (#54). | ||
- Update to master branch of IoTAgent Library and LWM2M Library 0.5.0. | ||
- FEATURE update node version to 4.8.4 | ||
- FEATURE update node version to 4.8.4 | ||
- Unit tests are executed as part of Travis CI. | ||
- npm-shrinkwrap file is updated (#99 and #100) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's correct. Since the npm-shrinkwrap was not updated, actually still the old version of https://github.com/telefonicaid/iotagent-node-lib was used causing these bugs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We typically don't mention updates of npm-shrinkwrap file in CNR, but this case I think is a good idea, given doing so is fixing issues. (I understand that #99 and #100 are about bugs in the provisioning API, otherwise my suggestion would be wrong. Please, check) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 9ccd486 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,7 +144,8 @@ function selectRealName(extractedName, device, callback) { | |
* @param {String} type Type of the entity. | ||
* @param {Array} attributes List of attributes of the entity to be updated (including type and value). | ||
*/ | ||
function ngsiUpdateHandler(id, type, attributes, callback) { | ||
function ngsiUpdateHandler(id, type, service, subservice, attributes, callback) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR incluces changes in program code, along with tests. Anything worth to mention in CHANGES_NEXT_RELEASE (i.e. some bug being fixed in the process of fixing the tests) or only trivial changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 0de8f25 |
||
|
||
var name = id.substring(0, id.indexOf(':')); | ||
|
||
logger.debug(context, 'Handling device data update from the northbound for device [%s] of type [%s]', id, type); | ||
|
@@ -161,12 +162,12 @@ function ngsiUpdateHandler(id, type, attributes, callback) { | |
name = id; | ||
} | ||
|
||
iotAgentLib.getDeviceByName(id, function(error, ngsiDevice) { | ||
iotAgentLib.getDeviceByName(id, service, subservice, function(error, ngsiDevice) { | ||
if (error) { | ||
callback(error); | ||
} else { | ||
async.waterfall([ | ||
async.apply(iotAgentLib.getDeviceByName, id), | ||
async.apply(iotAgentLib.getDeviceByName, id, service, subservice), | ||
async.apply(selectRealName, name), | ||
lwm2mLib.getRegistry().getByName, | ||
apply(updateDevice, ngsiDevice) | ||
|
@@ -176,7 +177,7 @@ function ngsiUpdateHandler(id, type, attributes, callback) { | |
|
||
} | ||
|
||
function ngsiExecuteHandler(id, type, attributes, callback) { | ||
function ngsiExecuteHandler(id, type, service, subservice, attributes, callback) { | ||
var name = id.substring(0, id.indexOf(':')); | ||
|
||
logger.debug(context, 'Handling device command execution from the northbound for device [%s] of type [%s]', | ||
|
@@ -215,7 +216,7 @@ function ngsiExecuteHandler(id, type, attributes, callback) { | |
); | ||
} | ||
|
||
iotAgentLib.getDeviceByName(id, function(error, ngsiDevice) { | ||
iotAgentLib.getDeviceByName(id, service, subservice, function(error, ngsiDevice) { | ||
if (error) { | ||
callback(error); | ||
} else { | ||
|
@@ -237,7 +238,7 @@ function ngsiExecuteHandler(id, type, attributes, callback) { | |
* @param {String} type Type of the entity. | ||
* @param {Array} attributes List of attributes to read. | ||
*/ | ||
function ngsiQueryHandler(id, type, attributes, callback) { | ||
function ngsiQueryHandler(id, type, service, subservice, attributes, callback) { | ||
var name = id.substring(0, id.indexOf(':')); | ||
|
||
logger.debug(context, 'Handling device data query from the northbound for device [%s] of type [%s]', id, type); | ||
|
@@ -291,7 +292,7 @@ function ngsiQueryHandler(id, type, attributes, callback) { | |
name = id; | ||
} | ||
|
||
iotAgentLib.getDeviceByName(id, function(error, ngsiDevice) { | ||
iotAgentLib.getDeviceByName(id, service, subservice, function(error, ngsiDevice) { | ||
if (error) { | ||
callback(error); | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking this in detail, .travis.yml file in the two other main IOTAs (UL and JSON) they aren't deploying Orion in before_install:
https://github.com/telefonicaid/iotagent-json/blob/master/.travis.yml#L21
https://github.com/telefonicaid/iotagent-ul/blob/master/.travis.yml#L21
So, why in the case of IOTA LWM2M is different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason is that tests for IOTA LWM2M are not really unit tests since the responses from the Orion CB are not mocked. Instead, an instance of the CB must be deployed and the tests are executed against it.
I guess that we should open a new issue in order to mock CB in the unit tests of IOTA LWM2M.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue created at #106. NTC with regards this PR.