-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added code to handle more oddities in file naming. #328
Conversation
This fix isn't working for me because of the output directory. The testing program creates
As you can see in those warnings, the output directory is part of the protected filename and the renaming rules "fix" it. Either the testing program has to create a "safe" output directory or the renaming rules have to be made aware of the possibility of an output directory and not play with its name when making the file names "safe". I'm not sure at this point which is the better option and will have to study the problem when I'm not going to bed. |
It's possible, I suppose, to alter the directory created for the output, but doesn't that indicate a potential issue when a user uses a directory with problematic characters in it? |
I looked a bit at the lua code, and it makes me think that perhaps it would be better to quote/escape things in the command than to fiddle with the arguments. The difficulty with this is OS-compatibility, unless there is an explicit form of execution with explicit arguments. |
That's what has me vacillating on whether the solution should be changing the testing protocol or the program behavior. I need to do some testing as to what happens currently and with my proposed changes when the directory name contains a protected character. |
Have you tried quoting the arguments? If it works, I think it would cover most of the cases. Should be compatible with both Posix and Windows. To wit: l.150/156. |
Trying that (after undoing the other changes I had made) works for the new test, but now I'm getting a bunch of the following errors:
As you can see there's an extra level of directory introduced in the the path down which the testing program searches for the expectation. I'm not sure what might be causing that as it's only happening on 16 tests. I'm going to have to look more closely at those tests to see what they might have in common (and which is different from all the others) in order to figure out why they are having this issue. |
That seems odd indeed. Let me see if I can figure out what's going on. It smells like a bug in the test harness implementation rather that in gregorio. |
I ran the my
What version are you using? |
Looks like I have a more recent version, but only at a bug-fix level. |
I'm unfortunately at a loss as to the problem. I think I have to depend on your ability to debug this. |
Also, if there's any other information you can give me that might help me focus my efforts, that would be helpful. For example, what is the command you are using to invoke the tests? |
When an expectation image cannot be found the image comparison is skipped and the test fails. Previously, however, this was reported as a "Results differ" failure, implying that the comparison was run. This change makes it so that the reported error message indicates the real cause of the test failure (missing expectation image).
The same directory gets referenced several times in a row (and will be referenced even more often in the next commit) so I store it in a variable.
When the `convert` command to populate an image-cache directory fails, we remove the empty directory. We do this because subsequent runs of the script will use the existence (and timestamp) on the directory to determine if the image-cache can be used for a particular test and an empty directory would falsely indicate that the image-cache was available.
…ages Differentiation error message
This test is named as testing a bug, but wasn't in the bugs folder. Thus I move it.
This fix for problematic filenames seems to work and is simpler than what I was working on in gregorio-project#1426. It is compatible with gregorio-project/gregorio-test#328 after the changes I proposed on henryso/gregorio-test#1 are pulled in. The corresponding PR which adds the test for this problem is gregorio-project/gregorio-test#331
Filename quote
Please note that this changes the VIEW / DIFF settings in the gregorio-test.rc file. See the example file for the required format. Basically, what used to be a string should now be an array. For example, what was:
should now be
This is to support weird filenames for gregorio-project/gregorio#1426.
This also pulls in some bug fixes from the
develop
branch, but these are acceptable for thectan
branch as well.