relaton / relaton-nist

NistBib: retrieve NIST Standards for bibliographic use using the BibliographicItem model
https://www.metanorma.com
MIT License
2 stars 1 forks source link

Inadequate coverage of testing #13

Closed opoudjis closed 5 years ago

opoudjis commented 5 years ago

None of the rspec routines in nistbib test from_xml. As a result, I only discovered after I had released nistbib, and when I was testing metanorma-nist, that there was a bug in the specification of from_xml: it is defined as XMLParser.from_xml, when in that file it should be defined as ::NistBib.XMLParser.from_xml

I should not have to find out such bugs downstream. Please review the coverage of rspec on the relaton gems, and ensure that all routines are appropriately tested.

opoudjis commented 5 years ago

... In addition to which, the untested from_xml() routine has nistitem = doc.at "/nist-standard", instead of the correct nistitem = doc.at "/bibitem".

(Or rather, it has been tested, on completely incorrect Relaton XML: nist-standard is a Metanorma wrapper, NOT a Relaton wrapper!)

I should not to find two such bugs in a row downstream.

I am emending nistbib to work with either bibdata or bibitem, and the to_xml function must generate bibitem, which is what it does in every other relaton gem. That is, after all, why they have been inheriting from iso_bib_item: the xml.bibitem used in that gem is UNIVERSAL in Metanorma citations of bibliography, and there are only minor differences between Relaton flavours. Please do not make this gem behave any differently from them. If it is to be extended to bibdata, it should be in a well managed fashion.

I am very unhappy about this. Especially as it is happening in a week when this gem is being demonstrated.

opoudjis commented 5 years ago

AND You've left out the "stage" and "substage" wrappers under status.

To which I'll add that the status being encoded in NISTbib seems to nothing to do with what I'm encoding in bibdata.

opoudjis commented 5 years ago

OK, I've spent the past 90 minutes debugging nistbib, and I'm not doing this any more.

I am creating a new ticket, where I expect nistbib and relaton-bib to be fixed, to match the expected XML of metanorma-nist rspec, spec/asciidoctor/base_spec.rb:292 # Asciidoctor::NIST processes default metadata