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-framework: test script with a space in the name will fail to run #1024

Closed
umsmit32 opened this Issue Mar 3, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@umsmit32
Contributor

umsmit32 commented Mar 3, 2013

If you upload a file with a space in the name, then the test won't be run. It will fail in the launch_test method of the automated_tests_helper.rb file, presumably because it couldn't find the file or some other oddity caused by the space.

This might also occur with test helper files but I don't know for sure.

@umsmit32

This comment has been minimized.

Show comment
Hide comment
@umsmit32

umsmit32 Mar 3, 2013

Contributor

This is in the same vein as Issue #1023

Contributor

umsmit32 commented Mar 3, 2013

This is in the same vein as Issue #1023

@yc2lee

This comment has been minimized.

Show comment
Hide comment
@yc2lee

yc2lee Mar 6, 2013

Contributor

In app/helpers/automated_tests_helper.rb, there is indeed the line

arg_list = arg_list + "#{script.script_name} #{script.halts_testing} "

If the script name contains a space, that space will separate the script name into two arguments. arg_list is used a few lines later in an ssh call:

stdout, stderr, status = Open3.capture3("#{ssh} #{server} \"cd #{run_dir}; ruby #{test_runner_name} #{arg_list}\"")
Contributor

yc2lee commented Mar 6, 2013

In app/helpers/automated_tests_helper.rb, there is indeed the line

arg_list = arg_list + "#{script.script_name} #{script.halts_testing} "

If the script name contains a space, that space will separate the script name into two arguments. arg_list is used a few lines later in an ssh call:

stdout, stderr, status = Open3.capture3("#{ssh} #{server} \"cd #{run_dir}; ruby #{test_runner_name} #{arg_list}\"")
@umsmit32

This comment has been minimized.

Show comment
Hide comment
@umsmit32

umsmit32 Mar 10, 2013

Contributor

It turns out it's a little more difficult than Nick suggested. The script itself splits the argument list based on spaces, so it's parsing the filename into 2 separate arguments. To deal with that I'll have have to modify how testrunner.rb splits the input.

This is the offending line. It's purpose is to split the "halts testing" input from the "filename" input

filedata = nextFile.split(' ')
Contributor

umsmit32 commented Mar 10, 2013

It turns out it's a little more difficult than Nick suggested. The script itself splits the argument list based on spaces, so it's parsing the filename into 2 separate arguments. To deal with that I'll have have to modify how testrunner.rb splits the input.

This is the offending line. It's purpose is to split the "halts testing" input from the "filename" input

filedata = nextFile.split(' ')

benjaminvialle added a commit that referenced this issue Mar 11, 2013

Merge pull request #1042 from umsmit32/issue-1024

The automated test script can now handle a file with a space in the name.

Instead of joining and splitting the argument list with a space, I decided to use a colon (:). Colons can't be used in filenames on Windows and Mac operating systems so there is unlikely to be an issue in the filename getting split up as there was with splitting on whitespace.
Closes #1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment