Skip to content
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

Merged
merged 17 commits into from
Dec 22, 2017
Merged

Task/travis ci #105

merged 17 commits into from
Dec 22, 2017

Conversation

dcalvoalonso
Copy link
Contributor

  • It modifies the agent to pass unit tests
  • It enables Travis CI

.travis.yml Outdated

install:
- npm install

before_install:
- docker pull fiware/orion:0.26
Copy link
Member

@fgalan fgalan Dec 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orion 0.26 is pretty old... I'll sugest to use fiware:orion:latest. This may casuse some ocasionally breaking from time to time (as Orion may evolve) but I think is a good idea to be sure we keep backward compatibility as Orion evolves.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0de8f25

@@ -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) {
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0de8f25

@@ -42,19 +42,35 @@ var config = require('./testConfig'),
ngsiClient = ngsiTestUtils.create(
config.ngsi.contextBroker.host,
config.ngsi.contextBroker.port,
'smartGondor',
'/gardens'
'dumbmordor',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this change... In my opinion it should be just

smartGondor -> smartgondor

Why to change to something completely different (dumbmordor)? Why does subservice needs also to be changed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in some recent commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in babe984

subservice: '/gardens',
providerUrl: 'http://192.168.56.1:4041/NGSI10',
providerUrl: 'http://localhost:4041/NGSI10',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the test work with /v1 instead of /NGSI10? Each time /NGSI10 is used, a kitten dies ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 0de8f25


install:
- npm install

before_install:
- docker pull fiware/orion:latest
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

- 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I'm understanging correctly... You mean that updating npm-shrinkwrap was the solution for issue #99 and #100?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9ccd486

@fgalan
Copy link
Member

fgalan commented Dec 20, 2017

Once PR telefonicaid/iotagent-node-lib#571 has been merged into library master, this PR should pass travis. Is this correct?

@dcalvoalonso
Copy link
Contributor Author

You are right, in fact they are being passed for Node 6 but no for Node 4. Really strange....

@fgalan
Copy link
Member

fgalan commented Dec 20, 2017

LGTM

@dcalvoalonso
Copy link
Contributor Author

Since a real Orion instance is being used, we needed to give some delays to wait for the answers.

@dcalvoalonso dcalvoalonso mentioned this pull request Dec 21, 2017
@AlvaroVega
Copy link
Member

LGTM

@AlvaroVega AlvaroVega merged commit a874d94 into telefonicaid:master Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants