Skip to content

Commit

Permalink
Extending and reorganizing testing, including removing temporary arti…
Browse files Browse the repository at this point in the history
…facts from git
  • Loading branch information
wendellpiez committed Jun 12, 2024
1 parent 97988da commit 497fb51
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 4,139 deletions.
6 changes: 4 additions & 2 deletions src/compose/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ folder=.
.PHONY: test
test: unit-test ## Run all tests

# just unit-test for now ...

.PHONY: unit-test
unit-test: ## Run all *.xspec in testing folder (and subfolders)
LOGFILE="$(output_folder)/composition-xspec.log" $(xspec_ci_script) \
Expand All @@ -30,10 +32,10 @@ unit-test: ## Run all *.xspec in testing folder (and subfolders)

.PHONY: xspec
xspec: ## Run all *.xspec in a designated folder, quietly - use folder=[folder]
LOGFILE="$(output_folder)/$(folder)-xspec-tests.log" $(xspec_script) \
LOGFILE="$(output_folder)/xspec-tests.log" $(xspec_script) \
"baseURI=file:$(module_path)/" \
"folder=$(folder)" \
"report-to=$(output_folder)/inspector-$(folder)-tests_report.html" \
"report-to=$(output_folder)" \
"stop-on-error=no" \
"recurse=yes"

Expand Down
14 changes: 14 additions & 0 deletions src/metapath/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,17 @@ Provides for processing Metapath syntax and operations dependent on processing s
Modules here including `metapath-jsonize.xsl` and `docs-metapath.xsl` may be included or called into pipelines elsewhere in this library.

Provided XSpec tests along with inline code help to document the interfaces.

## Note to developers

This implementation was first built out of necessity, and includes functionality untested before its development, as well as machine-generated code whose ongoing reproduction may be problematic.

At the same time, since its inception, new capabilities in the XML stack, notably [Invisible XML](https://invisiblexml.org), provide a strong foundation for further work.

See also the related project repository hosting iXML support, the [iXML Breadboard](https://github.com/usnistgov/ixml-breadboard)

Accordingly, next steps might include a near-term migration onto an iXML-based implementation providing the same service.

For an iXML grammar, until a normative Metapath grammar is published, the alignment target is [the Metapath grammar](https://github.com/usnistgov/metaschema-java/blob/main/core/src/main/antlr4/metapath10.g4) supported in the metaschema-java project.

---
2 changes: 2 additions & 0 deletions src/testing/tinydata/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# TinyData artifacts include schemas and conversion scripts to be refreshed by scripting
current/*
13 changes: 4 additions & 9 deletions src/testing/tinydata/TINYDATA-MAKE-JSON.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,18 @@
<!-- Output: For each input file, an equivalent JSON in place with the same name. -->
<!-- Purpose: Batch-convert XML to JSON to support testing -->



<!-- &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& &&& -->
<!-- Ports -->

<p:input port="parameters" kind="parameter"/>


<p:input port="samples" sequence="true">

<p:document href="tiny-data/bigbadtiny.xml"/>
<p:document href="tiny-data/tiny1.xml"/>
</p:input>
<p:import href="tinydata-samples.xpl"/>

<metaschema:tinydata-samples name="getting-samples"/>

<p:for-each>
<p:iteration-source>
<p:pipe port="samples" step="TINYDATA-MAKE-JSON"/>
<p:pipe port="tinydata" step="getting-samples"/>
</p:iteration-source>
<p:variable name="base" select="base-uri(.)"/>

Expand Down
18 changes: 11 additions & 7 deletions src/testing/tinydata/TINYDATA-XSD-VALIDATE.xpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
-->

<p:input port="samples" sequence="true">
<!-- for the XML, invalid documents are marked with a PI <?ERROR ?> to show an expectation of INVALID -->
<!--<p:input port="samples" sequence="true">
<!-\- for the XML, invalid documents are marked with a PI <?ERROR ?> to show an expectation of INVALID -\->
<p:document href="tiny-data/tiny1.xml"/>
<p:document href="tiny-data/bigbadtiny.xml"/>

<p:document href="tiny-data/terms-of-art.xml"/>
</p:input>

<p:input port="tinydata-xsd">
-->
<p:input port="tinydata-xsd" primary="false">
<p:document href="current/tiny_schema.xsd"/>
</p:input>

Expand All @@ -59,9 +59,13 @@
<p:pipe port="result" step="plaintext"/>
</p:output>

<p:import href="tinydata-samples.xpl"/>

<metaschema:tinydata-samples name="getting-samples"/>

<p:for-each>
<p:iteration-source>
<p:pipe port="samples" step="XSD-VALIDATE-CHOICES"/>
<p:pipe port="tinydata" step="getting-samples"/>
</p:iteration-source>
<p:variable name="base" select="base-uri(.)"/>

Expand Down Expand Up @@ -133,7 +137,7 @@
select="child::NOMINALLY-VALID/document[@VALIDATION-STATUS='XSD-INVALID'] |
child::NOMINALLY-INVALID/document[not(@VALIDATION-STATUS='XSD-INVALID')]"/>
<REPORT>
<progress>Checking { count(*/*) }{ if (count(*/*) eq 1) then ' document' else ' documents' } against a 'choices' XSD ...</progress>
<progress>Checking { count(*/*) }{ if (count(*/*) eq 1) then ' document' else ' documents' } against the current tinydata XSD ...</progress>
<xsl:apply-templates select="child::*/document"/>

<xsl:if test="empty($anomalies)">
Expand Down
Loading

0 comments on commit 497fb51

Please sign in to comment.