Stream: crucible
Topic: Test warning response content missmatch
Florian Apolloner (Mar 25 2019 at 13:19):
I am getting a warning in the format tests: "requested XML response does not match created resource"
Which is probably true, but I cannot figure out what misses. Crucible creates the patient as:
<?xml version="1.0" encoding="utf-8"?> <Patient xmlns="http://hl7.org/fhir"> <meta> <tag> <system value="http://projectcrucible.org"/> <code value="testdata"/> </tag> </meta> <name> <family value="Emerald"/> <given value="Caro"/> </name> </Patient>
and I return:
<Patient xmlns="http://hl7.org/fhir"> <id value="ad27ea04-124f-424a-9ea7-a2c0f3717672"></id> <meta> <versionId value="1"></versionId> <lastUpdated value="2019-03-25T12:59:28.489250+00:00"></lastUpdated> <tag> <system value="http://projectcrucible.org"></system> <code value="testdata"></code> </tag> </meta> <name> <family value="Emerald"></family> <given value="Caro"></given> </name> </Patient>
which is the same as far as I can tell /o\ It all boils down to https://github.com/fhir-crucible/plan_executor/blob/master/lib/tests/suites/format_test.rb#L83 but I do not know enough ruby to follow that. The permalink to the test is https://projectcrucible.org/servers/5c89107d04ebd024be000000#5c98d0ac04ebd03124000013/format001/CT01
Thank you!
Robert Scanlon (Mar 25 2019 at 14:01):
Thanks, this needs to be fixed. That line calls this method: https://github.com/fhir-crucible/plan_executor/blob/master/lib/tests/suites/format_test.rb#L309 , which then tells the underlying FHIR model library to compare the two resources, excluding any 'id' elements. But it is valid to add other things in the meta element as well. So either we should change that to exclude ['id', 'versionId', 'lastUpdated'] (and check to see if there is anything else that can change), or just do ['id','meta']
Robert Scanlon (Mar 25 2019 at 14:03):
Will update here when we resolve this.
Robert Scanlon (Mar 25 2019 at 14:03):
Thanks!
Robert Scanlon (Mar 27 2019 at 14:37):
@Florian Apolloner -- fixed this issue and things look good now. Thanks for the report! https://projectcrucible.org/servers/5c89107d04ebd024be000000#5c9b8a4104ebd07a52000000/format001/CT01
Robert Scanlon (Mar 27 2019 at 14:40):
This also addresses 406 issue. I agree that the test using hte ?_format param would make more sense if we also removed the Accept header, but what we are doing is technically valid still (_format should just override the header), and removing the Accept header would be complicated given the way our client is designed.
Florian Apolloner (Mar 29 2019 at 07:39):
@Robert Scanlon Thank you so far, it works as expected. Ah yes I understand that your client might make it hard. If it is easier would it be possible that you make your client send a proper Accept header and then just override _format to an invalid value? This way you should still be able to check the correctness (if the library allows for it)
Last updated: Apr 12 2022 at 19:14 UTC