-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global parameters per scenario #991
Comments
Hi @AirQuick, is there anything I can do to help with this or pick it up? |
@ohsh6o
Which one do you want to make scenario-local? |
I am most certainly interested in B, @AirQuick! |
I've implemented a POC of this feature and it's working on XSLT and Schematron. @ohsh6o |
Excellent question, and yes your assumption was correct. If this context or the info below does not help, I can try to rewrite examples in a Gist to update it to my now much larger test suite. In short, there are two major external dependencies, at a high level, I need to think about: resolved catalog profiles and value registries. This commit is around the time where you might sense I wanted to expand it further. I would like to pass in file paths that are So I was unable to get the relevant tests at that time to work, I stopped trying and reported the issue to you. Resolved catalog profiles defined required nodes and attributes for security documentation this Schematron/XSLT will check, and the values registry define the values to which many attributes and embedded nodes must be bound. When unable to test on a case by case basis, I need to test against the whole set of conditions, so my tests balloon way outside a "unit" of encapsulation. Newer subsequent tests show this is obvious: I have to test globally across the resolved catalog profile, and I cannot pass in a custom one focused on the unit of testing, we get a lot of this because I cannot make resolved catalog profiles for a specific test with one control requirement, for example. This would allow me to test an approach for which I wish to bypass the whole XML Catalog issue: I am using this with a shell harness, but I need to be able to allow those to programmatically pass in global context variables wth XML/XSLT libraries in Java, .NET, and Python environments without adding more complexity unless I have to (XML runtimes feature sets are not super consistent across the board, as I have learned and you likely know!). I could keep going down that road, but testing that will be very difficult. |
Is there any additional help I can contribute at this point, @AirQuick or you just want me to test it as is by reviving my old branch of code? |
@ohsh6o
Demo$ git clone https://github.com/xspec/xspec.git
Cloning into 'xspec'...
...
$ cd xspec
$ git fetch origin pull/1354/head:pull_1354
...
* [new ref] refs/pull/1354/head -> pull_1354
$ git checkout pull_1354
Switched to branch 'pull_1354'
$ mkdir -p /tmp/saxon
$ # Use Saxon 10.3. Saxon 10.0, 10.1 and 10.2 have critical bugs in terms of XSpec v2.x and Schematron.
$ export SAXON_CP=/tmp/saxon/Saxon-HE-10.3.jar
$ wget -O "${SAXON_CP}" https://repo1.maven.org/maven2/net/sf/saxon/Saxon-HE/10.3/Saxon-HE-10.3.jar
...
$ bin/xspec.sh -s test/external_scenario-param_schematron.xspec
...
Converting Schematron into XSLT...
Converting Schematron XSpec into XSLT XSpec...
Creating Test Stylesheet...
Running Tests...
Testing with SAXON HE 10.3
Base context
..Scenario-level $phase
report compile-time-phase-param-is-A
report run-time-phase-param-is-A
report count: 2
..Scenario-level $phase
report compile-time-phase-param-is-A
report run-time-phase-param-is-B
report count: 2
Scenario-level $phase
report compile-time-phase-param-is-A
report run-time-phase-param-is-C
report count: 2
Formatting Report...
passed: 9 / pending: 0 / failed: 0 / total: 9
Report available at test/xspec/external_scenario-param_schematron-result.html
Done. |
That's excellent news @AirQuick, thank you! I will take a look later this week. |
@ohsh6o |
#892 (comment)
When implementing this feature, consider accompanying it with a test similar to #1309.
The text was updated successfully, but these errors were encountered: