Skip to content

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

@dmcassel

Description

@dmcassel
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions