Skip to content

TRX file name output should support path #5634

Description

@timheuer

Describe the bug

dotnet test -- --report-trx --report-trx-filename ./foo.trx fails with:

Option '--report-trx-filename' has invalid arguments: file name argument must not contain path (e.g. --report-trx-filename myreport.trx)

Expected behavior

I would be able to direct the output of the final file created so a specific artifact directory, else this is in a bin/blah/blah/directory

Activity

  1. Youssef1313 commented on May 22, 2025

    @Youssef1313
    Member

    Currently you can do --results-directory to specify the path. But that means you cannot put both TRX and dumps in different directories as both will be relative to results directory.

  2. added
    area/trx
    area/mtp
    and removed
    needs/triage
    on May 22, 2025
  3. nohwnd commented on May 23, 2025

    @nohwnd
    Member

    for context: This was done like this on purpose iirc by Marco Rossignoli (@MarcoRossignoli) to avoid the headaches of overwriting the test results per project and tfm, which was solved in vstest by attaching a guid at the end of the file to disambiguate it.

    So to keep it simple for the start it was just kept so you can rename the file, but not change its position, because then upload steps usually scan the whole given folder recursively for all results to upload by pattern like *.trx.

  4. Evangelink commented on May 23, 2025

    @Evangelink
    Member

    Thanks for adding the context Jakub Jareš (@nohwnd)

    which was solved in vstest by attaching a guid at the end of the file to disambiguate it.

    And on that we had quite some requests/complaints from user about having guid in the file name causing undeterministic paths (see microsoft/vstest#2378)

  5. nohwnd commented on May 23, 2025

    @nohwnd
    Member

    To me this would ideally be solved by having a templating language that will make it possible to easily compose the name as you'd like it.

    e.g. _.trx -> myDll_net9.0_2025-05-23-10-43_Gyhf.trx

    Still there is a problem with the log file name not being deteministic, but if you don't need randomness then you don't specify the short id, if you want more randomness you would specify or

    Does not seem like a lot of work to make a service like that available to all reporters.

  6. Evangelink commented on May 23, 2025

    @Evangelink
    Member

    Agreed and linked to #5364

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mtparea/trx

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions