Skip to content
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

Support XQuery in Run XSpec Test transformation scenario #739

Merged
merged 5 commits into from
Dec 7, 2019

Conversation

AirQuick
Copy link
Member

@AirQuick AirQuick commented Nov 22, 2019

Right now, Run XSpec Test transformation scenario

  • cannot test XQuery
  • cannot test XSLT when XSpec is both for XSLT and Schematron

This pull request includes XQuery in the candidates of test.type of Run XSpec Test transformation scenario.

Initial comment (abandoned)

With this change, Run XSpec Test transformation scenario interactively asks which test type (XSLT, XQuery, or Schematron) the user wants to run.

select-test-type

Some users may find this feature annoying, because it's likely that most people write XSpec only for either XSLT or Schematron.
I wanted to make Oxygen run XSpec silently if x:description has only one test type (@query, @schematron or @stylesheet). But I don't know how to write Oxygen editor variables to realize it. Feedback is welcome.

I tested this transformation scenario on Oxygen 21.1 on Windows and Linux.

@AirQuick AirQuick added this to the v1.5.0 milestone Nov 22, 2019
@AirQuick AirQuick requested a review from a team November 22, 2019 07:02
Copy link
Member

@galtm galtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for tests in this project itself, I would expect the majority of XSpec tests to be for only one kind of code. I agree with you that some users may find this feature annoying. The prompt is especially annoying if the user selects multiple tests from the Project pane and wants to walk away while Oxygen runs all of them. I think it's important to find out if conditionally suppressing the prompt is possible. I made some naive attempts but was not successful.

If suppressing the prompt isn't feasible, an alternative could be to extend the existing non-interactive logic to add XQuery to the Run XSpec Test scenario, and then do one of the following to handle tests that cover multiple kinds of code:

A) Create separate XSLT-specific, XQuery-specific, and Schematron-specific scenarios for the (assumed uncommon) case where a test covers multiple types. A disadvantage is having a total of four scenarios instead of one. An advantage is that you can select multiple check boxes in the Transformation Scenarios pane, and then a single Ctrl+Shift+t keystroke runs all the transformations.

B) Use your dialog in a new scenario (like Run XSpec Test for User-Selectable Language, but hopefully with a better name than that). There would be a total of two scenarios, not one or four.

The dialog worked fine for me in v21.0, but v21.1 build 2019061404 had an error at char 48 of the test.type expression. You used 21.1, too; do you have a different build code? Or maybe I have some preference setting that is interfering.

@AirQuick
Copy link
Member Author

AirQuick commented Nov 26, 2019

Thank you for pointing out the critical things! So this initial pr is not viable because it

  • annoys most cases (as I was afraid)
  • is buggy (at least on 21.1 build 2019061404 - I tested it on 2019101513)
  • doesn't work with multiple .xspec files (I didn't think about that)

I pushed a commit 4b531df to just extend the existing non-interactive logic to add XQuery. I guess this covers most of the use cases at this moment.
Tested on oXygen

  • 19.0 build 2017062918
  • 19.1 build 2018122811
  • 20.0 build 2018042410
  • 20.1 build 2018122403
  • 21.0 build 2019040204
  • 21.1 build 2019061404 and 2019101513

@AirQuick AirQuick changed the title Make test.type in Run XSpec Test transformation scenario selectable including XQuery Support XQuery in Run XSpec Test transformation scenario Nov 26, 2019
Copy link
Member

@galtm galtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I exercised this scenario again in Oxygen after your "Do not make test.type interactive" commit. Thanks for that update. It works as expected for single-language tests. For multiple-language tests, it works by picking one of the languages (happens to be alphabetical order among the x:description attributes, which is fine).

@AirQuick AirQuick merged commit 8f8930c into xspec:master Dec 7, 2019
@AirQuick AirQuick deleted the oxy-xq-ant-trans branch December 7, 2019 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants