RWTH-EBC / FiLiP

FIWARE Library for Python (FiLiP) to work with FIWARE API
BSD 3-Clause "New" or "Revised" License
23 stars 13 forks source link

Revise NGSI-LD batch operation tests #327

Closed SystemsPurge closed 2 weeks ago

SystemsPurge commented 1 month ago

The batch operation tests are overall not very consistent, i suspect due to some possible changes in other apps from the platform. Some examples include ( but not limited to ):

self.cb_client.entity_batch_operation(entities=entities_a, action_type=ActionTypeLD.CREATE)

entities_update = [ContextLDEntity(id=f"urn:ngsi-ld:test:{str(i)}", type=f'filip:object:TypeUpdate') for i in range(3, 6)] self.cb_client.entity_batch_operation(entities=entities_update, action_type=ActionTypeLD.UPDATE)



- in the test_ngsi_ld_cb test file, there are also batch operations. In the test_batch_operations test the opposite problem is happening: 
UPSERT to change type does not raise, or at least not the expected error ( RuntimeError ), when it should at least raise. Maybe remove these tests an leave that file for management/stat endpoint testing? ? it happens to contain all types of tests in a single file.

- Some tests overall either call the cleanup function in the setup function , which sometimes causes errors, or they attempt to define a header with a tenant = filip, which also intells that that tenant already exists wherever we are testing and that sometimes throws. A proper lookover of test modes ( local env variables .vs env variables pointing to cluster ) is also a good idea.
github-actions[bot] commented 1 month ago

Branch 327-Revise-NGSI-LD-batch-operation-tests created!