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

Test file names exceed Windows file name limits when using Data Providers #6

Open
HammidFunsho opened this issue May 11, 2017 · 1 comment

Comments

@HammidFunsho
Copy link

We're encountering Windows file length issues when running tests which utilize Data Providers.
As you know, when a Data Provider is used, each test gets named according to the data option used, so when we feed in large data sets, the result files created from these tests exceed the Windows filename limits.

Is it possible for a tester to change the way the framework generates file names for Data Provider tests?

One suggestion is to implement conditional logic which evaluates file name length, and uses an alternate naming convention IF it exceeds our defined limit.
We'd of course need to come up with this new schema, but one idea is setting the 1st element in a Data Provider as a counter, then appending that to a shorter file name. This way we use an abbreviated name which would always be unique.

An example using the Sample tests :
new Object[] {“1”, "python", method, test }
new Object[] {“2”, "java", method, test }
new Object[] {“3”, "ruby", method, test }

The resulting file names could be something like googleLanguageSearch1, googleLanguageSearch2, googleLanguageSearch3 (test method name + iteration flag). The Data Provider options used for each test could then be passed into the results file itself for a tester to view (along with other test info).

Another suggestion could be appending time stamps into the file names.

We're of course open to any other solutions you can suggest, as we understand that these changes could impact other areas of the framework.

@msaperst
Copy link
Owner

msaperst commented May 22, 2017

I have implemented this fix for the 2.0.0 release. This release should be out shortly, and I'll close the issue at that time. The new method checks for a filename length (look for maximum length of 200, Windows limit is 255), and if that limit is exceeded, replaced the appended DataProvider list with the unique hash of the DataProvider list.

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

No branches or pull requests

2 participants