Skip to content

Some TestCase classes assume they are run from their original folder #52

@gjsjohnmurray

Description

@gjsjohnmurray

An example:

https://github.com/intersystems/git-source-control/blob/8aa09fdcc0b4fa8d384d8b8cb16dd6d2e8ae26eb/test/UnitTest/SourceControl/Git/NameToInternalNameTest.cls#L119-L123

This OnBeforeAllTests method locates the project root folder by piecing (riskily) at the first occurrence of test in the absolute path to itself (its Manager's CurrentDir). It then copies the entire project into a temporary directory so its Test* methods can use other files of the project as test data.

This gets broken by our extension's technique of moving the TestCase sources onto a folder guaranteed to be accessible to our server (which could be remote from the developer's project folder).

In this case the failures are in TestAbstractDocumentClassNames

ERROR importingtest2.pivot.DFI

ERROR #6301: SAX XML Parser Error: invalid document structure while processing Anonymous Stream at line 1 offset 1
AssertStatusOK:##class(SourceControl.Git.Utils).ImportItem("test2.pivot.DFI",1) => ERROR #6301: SAX XML Parser Error: invalid document structure while processing Anonymous Stream at line 1 offset 1 (failed)  <<==== **FAILED**   _system/UnitTest/SourceControl/Git:UnitTest.SourceControl.Git.NameToInternalNameTest:TestAbstractDocumentClassNames
AssertEquals:##class(SourceControl.Git.Utils).NameToInternalName("test\_resources\dfi\test2.pivot.dfi")=="test2.pivot.DFI" was '' (failed)  <<==== **FAILED**   _system/UnitTest/SourceControl/Git:UnitTest.SourceControl.Git.NameToInternalNameTest:TestAbstractDocumentClassNames

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions