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

syntax error near unexpected token `(' #727

Closed
swiknaba opened this issue Nov 22, 2019 · 12 comments · Fixed by #832
Closed

syntax error near unexpected token `(' #727

swiknaba opened this issue Nov 22, 2019 · 12 comments · Fixed by #832

Comments

@swiknaba
Copy link

swiknaba commented Nov 22, 2019

Fails with syntax error near unexpected token '(' if any file has a ( or ) in its name. It seems space characters also break parallel.

Ruby 2.6.5
Rails 5.2.3
Parallel Tests 2.29.2
RSpec 3.9

running rails parallel:spec (also executed via bin/rake, etc., error persists).

I was lazy, so I renamed my file and it is good now. However, the gem should not fail to parse files, when their names are valid file names.

FYI: also having an issue with the --color and --tty options, tried everything found in issues of the related gems, nothing worked, it keeps on failing with "invalid option". So I forked it and just removed the colors/tty. No one needs that anyway.

@grosser
Copy link
Owner

grosser commented Nov 23, 2019

yeah, I think the file name escaping logic is very native, PR welcome :)

Do you have an example command that fails ... or was it just straight up rails parallel:spec ?
... maybe try rake / running the binary and see if it's different

@swiknaba
Copy link
Author

Thanks for the reply.

yeah, I think the file name escaping logic is very native, PR welcome :)

cool 🙂 - I'll have a look at the source code.

It was just straight-up rails parallel:spec, when narrowing it down to a specific folder that I know has proper names, it was running smoothly. I also tried running it via the binary and rake, same issue.

@grosser
Copy link
Owner

grosser commented Nov 23, 2019

sorry, second question was meant for the --color problem.

@swiknaba
Copy link
Author

ah, yes. for the --color option I as well run it with, without binstubs, with rake, rails, bundler, without bundler. I wipe some older versions of related gems. All without success.

@grosser
Copy link
Owner

grosser commented Nov 23, 2019 via email

@scarroll32
Copy link
Contributor

if any file has a ( or ) in its name

@swiknaba why would you want to have ')' in filenames?

@swiknaba
Copy link
Author

swiknaba commented Sep 11, 2021

if any file has a ( or ) in its name

@swiknaba why would you want to have ')' in filenames?

I don't want to :D, however, file names in legacy codebases just have them in my case. Those files in particular are auto-generated spec files where the names are taken from PDF files that we collected from our business (testing OCR and parsing of these files). So the names ultimately come from "the business people". We could normalize them, but I'm reluctant to change the file name if it is valid in terms of the operating system; where would I end if I adjusted that for each library that has different issues? ;)

@scarroll32
Copy link
Contributor

Those files in particular are auto-generated spec files where the namesare taken from PDF files that we collected from our business

Thanks for your response @swiknaba, that sounds like quite a tricky situation, definitely an edge case also.

Have you thought about submitting a PR to handle this situation?

@scarroll32
Copy link
Contributor

Or maybe replacing the ) character with some other placeholder, eg _

@grosser
Copy link
Owner

grosser commented Sep 11, 2021

prefer a failing test-case, should be an easy fix

@swiknaba
Copy link
Author

swiknaba commented Sep 13, 2021

Not 100% what would be the best way to test this, for now, I've just added a new blank test file to the sample Rails apps found in the spec/fixtures directory. The rails spec now fails if the filenames of the new test files contain bad characters, but succeeds if you give them a rails-standard file name. find detailed logs in the PR #831

@grosser
Copy link
Owner

grosser commented Sep 17, 2021

3.7.3

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

Successfully merging a pull request may close this issue.

3 participants