Skip to content

ADD test with name and object_id on the same attribute#1760

Open
fgalan wants to merge 3 commits intomasterfrom
add-name-object-id-overlapping
Open

ADD test with name and object_id on the same attribute#1760
fgalan wants to merge 3 commits intomasterfrom
add-name-object-id-overlapping

Conversation

@fgalan
Copy link
Member

@fgalan fgalan commented Feb 4, 2026

A variant of the test include in PR #1721 to see our current behaviour when a measure includes the same attribute (once by object_id other by name)

First run will fail, to see what happen...

@fgalan
Copy link
Member Author

fgalan commented Feb 4, 2026

 1) FUNCTIONAL TESTS AUTO
       0021d - Simple group with active attributes with special names in object_id - name overrides object_id
         A - WHEN sending defined object_ids with special format names in attributes through http IT should send measures to Context Broker preserving value types, name mappings and metadatas:

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

         "mainDoorEvent": {
           "type": "Boolean"
           "value": 1
         }
      -  "psSMDUHPower17": {
      +  "psSMDUHPower14": {
           "type": "Text"
      -    "value": 2
      +    "value": 999
         }
      +  "psSMDUHPower17": {
      +    "type": "Number"
      +    "value": 999
      +  }
         "type": "TestType"
       }

and we have

                    json: {
                        '.1.3.6.1.4.1.6302.2.1.2.17.1.1.18.1702': 3,
                        mainDoorEvent: 1,
                        psSMDUHPower17: 2
                    }

"value": 2 -> so name wins over object_id

@fgalan
Copy link
Member Author

fgalan commented Feb 4, 2026

In the last commit


  1) FUNCTIONAL TESTS AUTO
       0021d - Simple group with active attributes with special names in object_id - name overrides object_id
         A - WHEN sending defined object_ids with special format names in attributes through http IT should send measures to Context Broker preserving value types, name mappings and metadatas:

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

           "type": "Boolean"
           "value": 1
         }
         "psSMDUHPower17": {
      -    "type": "Text"
      +    "type": "Number"
           "value": 2
         }
         "type": "TestType"
       }
      
      at Object.testCase (test/functional/testUtils.js:264:74)
      at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
      at async Context.<anonymous> (test/functional/functional-tests-runner.js:116:25)

but provission used "Number"

                            {
                                name: 'psSMDUHPower17',
                                type: 'Number',
                                object_id: '.1.3.6.1.4.1.6302.2.1.2.17.1.1.18.1702'
                            }

it's weird... maybe this is a buggy behaviour?

@fgalan
Copy link
Member Author

fgalan commented Feb 4, 2026

maybe this is a buggy behaviour?

Confirmed with @AlvaroVega that it seems a buggy behaviour

Let's keep this PR open, as it has the reference test case to fix the issue. Thus, a commit in the IOTA Lib code would be added to fix the issue and make the test pass.

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.

1 participant