Skip to content

Using IRIS usernames as folder names for test suites can break on invalid characters or leading hyphen #67

@globalerp-mhess

Description

@globalerp-mhess

First of all, thank you for maintaining the VSCode testing integration for InterSystems IRIS.
It’s a very helpful tool and greatly improves the developer workflow.

The issue

The VS Code extension currently creates a folder for each testspec using the IRIS username as the folder name.
However, IRIS usernames and filesystem folder names do not share the same character restrictions, which leads to several problems.

  1. Invalid filesystem characters
    IRIS usernames may contain characters that are not allowed in folder names on many systems.
    For example, Windows does not allow the following characters in folder names: \ / : * ? " < > |
    Since IRIS usernames allow these characters (except @ and *), this can lead to failures when the extension attempts to create the folder:
    ERROR #5007: Directory name 'C:\InterSystems\IRIS\.vscode\NAMESPACE\UnitTestRoot\%user\' is invalid

  2. Leading hyphen interpreted as exclusion
    If a username starts with a hyphen (-), it is interpreted as a testsuite exclusion by the test runner, resulting in an error like:
    ERROR #10002: A 'testsuite' exclusion is being attempted before one was included in the following 'testspec' value: -user

This makes certain valid IRIS usernames unusable with the extension.

Suggestion

Since these folders are generated automatically and are not intended for manual user interaction, using the raw IRIS username as the folder name may not be the most robust approach.
A more reliable option might be to generate the folder name from a hash of the username (for example SHA-1 or SHA-256).

This would:

  • Avoid invalid filesystem characters
  • Avoid issues with leading -
  • Guarantee deterministic and unique folder names
  • Keep the implementation simple and platform-independent

If needed, the original username could still be stored in metadata or used only internally, while the filesystem uses the hashed value.

Would this approach be acceptable, or is there a reason the raw username needs to be used as the folder name?

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