Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Conversation

@dawagner
Copy link
Contributor

  • change how schema are found and XML files validated
  • fix the XML generation script
  • add XML generation tests

@tcahuzax please review.

   

@dawagner dawagner changed the title Xml generation fixes and tests [review] Xml generation fixes and tests Dec 15, 2015
@dawagner
Copy link
Contributor Author

coverage increased by +0.8%

@dawagner dawagner force-pushed the xml-generation-fixes-and-tests branch 4 times, most recently from 036f55d to 26cd7e0 Compare December 16, 2015 14:40
hostDomainGenerator.sh isn't maintained and we don't know of anyone using it.
portAllocator.py is only use by hostDomainGenerator.sh and can be removed too.

Signed-off-by: David Wagner <[email protected]>
We don't have any test for this script and so, it was broken without anyone
noticing.

Signed-off-by: David Wagner <[email protected]>
Add a trailing directory separator to them to disambiguate them from file
names (needed by some path-handling functions within the Parameter Framework).

Signed-off-by: David Wagner <[email protected]>
If the base URI is not transmitted to files included with "FileIncluder" (i.e.
SubsystemInclude tags), schema validation cannot take place.

Signed-off-by: David Wagner <[email protected]>
@tcahuzax
Copy link
Contributor

👎

@dawagner dawagner force-pushed the xml-generation-fixes-and-tests branch from 26cd7e0 to 27d0dad Compare December 17, 2015 14:36
@dawagner
Copy link
Contributor Author

@tcahuzax I have addressed your comments.

This attribute only makes sense for the XML parser (e.g. libxml2) but since we
don't make libxml2 automatically validate our files (we only do it manually),
we don't need this attribute.

Moreover, this attribute is hard to use:
- when it is set to a relative path, the file containing it cannot be moved;
- when set to an absolute path, it can't be copied between machines without
  modifying that attribute.

We used to set it to a base name ("FooBard.xsd") which was the name of the root
element contatenated with ".xsd" but this is redundant. In tests, it also led
to generating documents with this attribute and a root element that does not
have a corresponding standalone XSD (e.g. ParameterBlock does not have its own
XSD). For instance:

    <ParameterBlock xsi:noNamespaceSchemaLocation="ParameterBlock.xsd">

When trying to validate a file, just rely on the base dir provided by the user
and the root element name in order to find the corresponding XSD file.

Signed-off-by: David Wagner <[email protected]>
Introduce basic tests for domainGenerator.py. No error case is covered yet.

As it stood, the XML validity checking code wasn't covered. This new test also
covers it. Same applies for <xi:include> tags: there wasn't any test suite
using them. This one does. Each of these features should have their own test
but this is a quick and easy solution.

Signed-off-by: David Wagner <[email protected]>
@dawagner dawagner changed the title [review] Xml generation fixes and tests Xml generation fixes and tests Dec 17, 2015
@tcahuzax
Copy link
Contributor

:shipit:

dawagner added a commit that referenced this pull request Dec 17, 2015
Xml generation/validation fixes and tests

- change how schema are found and XML files validated
- fix the XML generation script
- add XML generation tests
@dawagner dawagner merged commit 73ce970 into intel:master Dec 17, 2015
@dawagner dawagner deleted the xml-generation-fixes-and-tests branch December 17, 2015 16:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants