eclipse-archived / unide

Eclipse Public License 1.0
29 stars 17 forks source link

Should unit tests validate test JSON files against schemas? #9

Closed kartben closed 6 years ago

kartben commented 7 years ago

The "measurement.json" file is not valid as per the json schema (i.e force and pressure measurements series do not have the $_time field set), which is very confusing since, well, it sounds like it is a reference document :-) Trying to POST it to the HTTP endpoint will fail with following error if validation is enabled:

{
    "measurements[1].series.$_time": "is missing but it is required"
}

This issue might need to be splitted in several as you see fit:

ameinhardt commented 6 years ago

with suggested fixes in #21, also process.json needs an update (of specialValues section)

bgusach commented 6 years ago

Hi, I guess this should be either closed or moved to the unide.java repo (unide.python already does this)

ameinhardt commented 6 years ago

the testfiles in unide.java are now validated against the schemas. An additional automated validation would only makes sense if one of both frequently changes, which shouldn't be the case. For a next v3 of schemas, the validation should again take place, of course