Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude invalid filename characters from snapshot files #1532

Open
lynnkale opened this issue Aug 9, 2024 · 3 comments
Open

Exclude invalid filename characters from snapshot files #1532

lynnkale opened this issue Aug 9, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@lynnkale
Copy link

lynnkale commented Aug 9, 2024

Windows does not allow the following characters in filenames: < > : " / \ | ? * but if these values are included in test parameters, they are included in the file names as well. This causes problems if tests are created with invalid characters on a *nix system but someone tries to run them on a windows machine.

@lynnkale lynnkale added the enhancement New feature or request label Aug 9, 2024
@geoff-powell
Copy link
Collaborator

geoff-powell commented Aug 12, 2024

@jrodbx
Copy link
Collaborator

jrodbx commented Aug 17, 2024

@lynnkale do you have a example handy which highlights "but if these values are included in test parameters"?

Looking at TestParameterInjectorTest, I suppose using a TestParameterValuesProvider that supplies a list of Strings whose literals contain those invalid characters would be one way. Still, I'd be curious to see your specific use case to ensure things are now fixed.

@jrodbx jrodbx reopened this Aug 17, 2024
@lynnkale
Copy link
Author

@jrodbx Most of the tests I was having issues with were using TestParameterValuesProvider supplying strings with invalid characters, for example "Title | Subtitle". The other case was a state class with an Exception attribute. It was using ErrorState(exception = Exception("error string")) which was producing a file name with a colon.

I can't provide direct code examples here, unfortunately, but I'm hoping this provides enough information to verify.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants