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

allow to send to CB batch update for multimeasures (and sort them by TimeInstant) #1607

Merged
merged 24 commits into from
May 21, 2024

Conversation

AlvaroVega
Copy link
Member

@AlvaroVega AlvaroVega commented May 6, 2024

related to fix telefonicaid/iotagent-json#825

  • Add functional test about a multimeasure
  • Add functional test about a multimeasure sorted by TimeInstant
  • Update Doc

@AlvaroVega AlvaroVega marked this pull request as ready for review May 6, 2024 14:38
CHANGES_NEXT_RELEASE Outdated Show resolved Hide resolved
CHANGES_NEXT_RELEASE Outdated Show resolved Hide resolved
@fgalan fgalan requested a review from mapedraza May 7, 2024 11:19
@fgalan
Copy link
Member

fgalan commented May 7, 2024

It would be great if @mapedraza could have a look specially from the functional test and documentation perspective.

@AlvaroVega AlvaroVega changed the title allow to send to CB batch update for multimeasures allow to send to CB batch update for multimeasures (and sort them by TimeInstant) May 16, 2024
Comment on lines +3014 to +3063
id: 'TestType:TestDevice1',
type: globalEnv.entity_type,
a: {
a1: {
value: 23,
type: 'Text',
metadata: {
TimeInstant: {
value: _.isDateString,
value: '2011-01-01T01:11:11.111Z',
type: 'DateTime'
}
}
},
TimeInstant: {
value: _.isDateString,
value: '2011-01-01T01:11:11.111Z',
type: 'DateTime'
}
},
{
id: 'TestType:TestDevice1',
id: 'TestType:TestDevice2',
type: globalEnv.entity_type,
a1: {
a2: {
value: 23,
type: 'Text',
metadata: {
TimeInstant: {
value: '2011-01-01T01:11:11.111Z',
value: '2022-02-02T02:22:22.222Z',
type: 'DateTime'
}
}
},
TimeInstant: {
value: '2011-01-01T01:11:11.111Z',
value: '2022-02-02T02:22:22.222Z',
type: 'DateTime'
}
},
{
id: 'TestType:TestDevice2',
id: globalEnv.entity_name,
type: globalEnv.entity_type,
a2: {
a: {
value: 23,
type: 'Text',
metadata: {
TimeInstant: {
value: '2022-02-02T02:22:22.222Z',
value: _.isDateString,
type: 'DateTime'
}
}
},
TimeInstant: {
value: '2022-02-02T02:22:22.222Z',
value: _.isDateString,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part of the code didn't change. NTC

@@ -1044,6 +1045,127 @@ Some additional considerations to take into account:
measure of after a mapping, as described in the previous bullet) then it is refused (so a failover to server
timestamp will take place).

## Multimeasure support
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this doc be linked from IoTA JSON?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not fully sure as I don't have how the IOTA JSON doc is structured right now in my mind :) but could make sense...

Maybe you could propose a PR in the IOTA-JSON repo to see how it looks like, pls?

Copy link
Collaborator

@mapedraza mapedraza left a comment

Choose a reason for hiding this comment

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

LGTM

doc/api.md Outdated Show resolved Hide resolved
doc/api.md Outdated Show resolved Hide resolved
{
shouldName:
'A - WHEN sending defined object_ids (measures) through http IT should send measures to Context Broker preserving value types and name mappings',
type: 'multimeasure',
Copy link
Member

Choose a reason for hiding this comment

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

Note that multimeasure is not included in the documentation at https://github.com/telefonicaid/iotagent-node-lib/tree/master/test/functional/README.md

type: The type of the test case. This can be single or multientity. See the "Advanced features" section for more information.

If we have invented a new type in this PR, I understand it should be properly documented there.

(I already published this comment, but it probably get lost :)

Copy link
Member

Choose a reason for hiding this comment

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

Interestingly, there is a section about multimeasures in such documentation https://github.com/telefonicaid/iotagent-node-lib/blob/master/test/functional/README.md#multimeasures, but the relation with the test type is not mentioned there... (probably it should)

Copy link
Collaborator

@mapedraza mapedraza May 20, 2024

Choose a reason for hiding this comment

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

multimeasures were already supported for measures reception, but not for the expectations.

New changes were included since this PR changed the way of multimeasures are sent. In this case, the expectation changes. Thus, a new parameter is needed

fgalan and others added 3 commits May 20, 2024 17:16
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

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

LGTM

@fgalan fgalan merged commit f7b914c into master May 21, 2024
8 checks passed
@fgalan fgalan deleted the task/allow_send_update_cb_batch_for_multimeasures branch May 21, 2024 08:52
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.

Keep order from a multimeasure to Orion CB
3 participants