Jenkins and plugins versions report
junit-attachments-plugin version: 330.v25180b_263160
What Operating System are you using (both controller, and any agents involved in the problem)?
Windows for controller and agents.
Reproduction steps
In AttachmentPublisher.getAttachmentPath the TestObject.safe method will be used to replace unsafe url characters:
There are two problems with that:
- Not all unsafe URL characters are actually replaced by that method, as I reported here
- Even all unsafe URL characters are replaced, this does not mean that this is then also a valid file path. For example: while an "*" is valid to use in an URL, it is not allowed to use it in a windows file name. Even if all unsafe URL characters are replaced, this does not mean that the result is a valid file path. For example, while "*" is a valid character in a URL, it is not allowed in a Windows file name. When I try to enter "*" as a file name, I get the following pop-up:
Expected Results
All not allowed characters should be replaced (operating system dependent)
Actual Results
Not all not allowed characters are replaced which leads to errors while parsing the test results.
Here is an example where we use parameterized tests that use invalid file path characters:
AttachmentsTests.cs
The related test report:
TestResults.xml
And finally the error when trying to add the results via
junit keepProperties: true, skipPublishingChecks: true, stdioRetention: 'ALL', testDataPublishers: [attachments()], testResults: '*.xml'
in jenkins:

When the test cases "*" and "|" of Can_Use_Invalid_File_Path_Signs_In_TestParameter will be removed, everything is fine.
Anything else?
The provided sample is just for demonstrating the problem.
In real life we use tools like Bogus for generating fake data (to simulate user input and so on). This means any UTF‑8 character can be generated, and in our case, it is completely valid to have such characters appear in a test parameter.
Are you interested in contributing a fix?
No response
Jenkins and plugins versions report
junit-attachments-plugin version: 330.v25180b_263160
What Operating System are you using (both controller, and any agents involved in the problem)?
Windows for controller and agents.
Reproduction steps
In AttachmentPublisher.getAttachmentPath the TestObject.safe method will be used to replace unsafe url characters:
There are two problems with that:
Expected Results
All not allowed characters should be replaced (operating system dependent)
Actual Results
Not all not allowed characters are replaced which leads to errors while parsing the test results.
Here is an example where we use parameterized tests that use invalid file path characters:
AttachmentsTests.cs
The related test report:
TestResults.xml
And finally the error when trying to add the results via

junit keepProperties: true, skipPublishingChecks: true, stdioRetention: 'ALL', testDataPublishers: [attachments()], testResults: '*.xml'in jenkins:
When the test cases "*" and "|" of
Can_Use_Invalid_File_Path_Signs_In_TestParameterwill be removed, everything is fine.Anything else?
The provided sample is just for demonstrating the problem.
In real life we use tools like Bogus for generating fake data (to simulate user input and so on). This means any UTF‑8 character can be generated, and in our case, it is completely valid to have such characters appear in a test parameter.
Are you interested in contributing a fix?
No response