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

Add tests using explicitAttrs with value [ ] #1605

Merged
merged 2 commits into from
May 16, 2024

Conversation

mapedraza
Copy link
Collaborator

Adding tests described in #1600

  • 0531 - Group with explicit attrs:[ ] (empty array) + active attributes + static attributes
    • A - WHEN sending both provisioned and not object_ids (measures) through http IT should NOT store anything into the Context Broker (No request to CB)
  • 0532 - Group with explicit attrs:[ ] (empty array) + active attributes + static attributes + timestamp:true
    • A - WHEN sending both provisioned and not object_ids (measures) through http IT should NOT store anything into the Context Broker (No request to CB)
    • B - WHEN sending data and a measure called TimeInstant through http IT should NOT store anything into the Context Broker (No request to CB)
  • 0533 - Group with explicit attrs:[ ] (empty array) + active attributes + TimeInstant attribute + static attributes + timestamp:true
    • A - WHEN sending data and a measure called "t" (defined as TimeInstant attribte) through http IT should NOT store anything into the Context Broker (No request to CB)
    • B - WHEN sending data and a measure called TimeInstant through http IT should NOT store anything into the Context Broker (No request to CB)

BUT some problems were discovered when using TimeInstant attribute and fucntionalities in cases 533 A) and B):

0533 B

Assertion Error - Context Broker received payload differs from expectation
+ expected - actual

-{
-  "TimeInstant": {
-    "type": "DateTime"
-    "value": "2015-12-14T08:06:01.468Z"
-  }
-  "id": "TestType:TestDevice"
-  "type": "TestType"
-}
+{}

0533 B

Assertion Error - Context Broker received payload differs from expectation
+ expected - actual

-{
-  "DateIssued": {
-    "metadata": {
-      "TimeInstant": {
-        "type": "DateTime"
-        "value": "2024-04-29T16:07:27.281Z"
-      }
-    }
-    "type": "DateTime"
-    "value": "2015-12-14T08:06:01.468Z"
-  }
-  "TimeInstant": {
-    "type": "DateTime"
-    "value": "2024-04-29T16:07:27.281Z"
-  }
-  "id": "TestType:TestDevice"
-  "type": "TestType"
-}
+{}

@mapedraza
Copy link
Collaborator Author

As discussed, this PR should be divided in 2

@fgalan
Copy link
Member

fgalan commented May 8, 2024

As discussed, this PR should be divided in 2

One of then with working tests 0531 and 0532, to be merged (closing #1600) and other PR with 0533 to be on hold as a regression tests for issue #1606

@AlvaroVega
Copy link
Member

These tests are related with PR #1593 and described as

So not sure if a measure mapped to TimeInstnat attribute should not be propagated to CB in this case.

@mapedraza
Copy link
Collaborator Author

  • behaviours

As my understanding, TimeInstant should work as any other attribute, so, it should be filtered by explicitAttrs like any other attribute.

@mapedraza
Copy link
Collaborator Author

mapedraza commented May 14, 2024

As discussed, this PR should be divided in 2

One of then with working tests 0531 and 0532, to be merged (closing #1600) and other PR with 0533 to be on hold as a regression tests for issue #1606

Tests 533 removed here:
c742681

Copy link
Member

@AlvaroVega AlvaroVega left a comment

Choose a reason for hiding this comment

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

LGTM

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 2f208ed into master May 16, 2024
8 checks passed
@fgalan fgalan deleted the task/add-ftest-explicit-arra-empty branch May 16, 2024 06:46
@fgalan fgalan mentioned this pull request May 16, 2024
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.

3 participants