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

Nested test suites may lead to incorrect setup module selection #204

Open
dmcassel opened this issue Nov 9, 2023 · 1 comment
Open

Nested test suites may lead to incorrect setup module selection #204

dmcassel opened this issue Nov 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@dmcassel
Copy link
Collaborator

dmcassel commented Nov 9, 2023

  • marklogic-unit-test: 1.3.0
  • MarkLogic: 11.0.2

I have a test suite suiteA that has both setup.sjs and suiteSetup.sjs. Nested within suiteA, I had a subdirectories for a related test: verify. This subdirectory had its own suiteSetup.sjs. This worked fine.

I added a new subdirectory remind that has a suiteSetup.sjs. Now when I run suiteA, tests fail because instead of running suiteA/suiteSetup.sjs, it's running suiteA/remind/suiteSetup.sjs.

The suite setup module is identified in the controller by calling test:list-from-database and taking the first module that passes is-suite-setup-module(.). It looks like the modules came back in alphabetical order (document order?) and so suiteA/suiteSetup.sjs was selected before suiteA/verify/suiteSetup.sjs, but suiteA/remind/suiteSetup.sjs messed up the order.

The fix may be as simple as changing the cts:directory-query and xdmp:directory calls from "infinity" to "1", but I haven't tested that.

@dmcassel
Copy link
Collaborator Author

dmcassel commented Nov 9, 2023

Workaround: de-nest the test suites.

@dmcassel dmcassel added the bug Something isn't working label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant