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

karate.callSingle caching fails on Windows using different keys #2324

Closed
lucarota opened this issue May 26, 2023 · 6 comments
Closed

karate.callSingle caching fails on Windows using different keys #2324

lucarota opened this issue May 26, 2023 · 6 comments
Assignees
Milestone

Comments

@lucarota
Copy link

Hi,

as stated in the documentation Multiple calls using karate.callSingle() I am trying to use different keys for callSingle cache:

var adminResponse = karate.callSingle('classpath:get-token.feature?admin', {'username': 'admin', 'password': 'password123' });

callSingle tries to create a file:

target\classpath-get-token.feature?admin.txt

but fails with this error (The filename, directory name, or volume label syntax is incorrect)

>>> failed features:
java.io.FileNotFoundException: target\classpath-get-token.feature?admin.txt (The filename, directory name, or volume label syntax is incorrect)
src/test/resources/apis/EventsApi/listEvents.feature:43
src/test/resources/apis/EventsApi/listEvents.feature:12
java.io.FileNotFoundException: target\classpath-get-token.feature?admin.txt (The filename, directory name, or volume label syntax is incorrect)
src/test/resources/apis/EventsApi/listEvents.feature:43
src/test/resources/apis/EventsApi/listEvents.feature:26

because in Windows the character '?' is reserved (as reported here Windows - Files - Naming Conventions characters <>:"/|?* are reserved).

Is there a possible workaround for Windows? If not, could you please remove these reserved characters from the filename?

Thank you.

@ptrthomas
Copy link
Member

@lucarota should be possible, do you want to take a shot at contributing a PR ?

@lucarota
Copy link
Author

Hi Peter,

just submitted PR 2325.

Cheers,
Luca

@ptrthomas ptrthomas added this to the 1.4.1 milestone May 26, 2023
@ptrthomas
Copy link
Member

@lucarota awesome. I'll merge as soon as the build passes. thanks ! not sure yet when we release 1.4.1, will update here when it happens

ptrthomas added a commit that referenced this issue May 26, 2023
…dows

Fix #2324 - karate.callSingle caching fails on Windows using different keys
ericdriggs pushed a commit to ericdriggs/karate that referenced this issue May 31, 2023
Remove Windows filename reserved chars (<>:"/|?*)
@ellyxc
Copy link

ellyxc commented Jul 21, 2023

any release date yet?

@ptrthomas
Copy link
Member

@ellyxc 1.4.1.RC2 is available. it should be good for production, let us know how it goes

@ellyxc
Copy link

ellyxc commented Aug 4, 2023

@ptrthomas i tried it and it is working. Thank you

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

No branches or pull requests

3 participants