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

Spaces in folder name #1271

Open
taylor-benson opened this issue May 14, 2021 · 1 comment
Open

Spaces in folder name #1271

taylor-benson opened this issue May 14, 2021 · 1 comment
Labels
type:bug Something isn't working

Comments

@taylor-benson
Copy link

taylor-benson commented May 14, 2021

Describe the bug
When spaces are in the folder, and the allure:report is ran, the generated report path is quoted, but writing to the disk with an actual " for the first folder.

To Reproduce
Steps to reproduce the behavior:

  1. Create a parent folder with space
  2. Check out source into folder with space
  3. Run allure report generation (ie mvn allure:report)
  4. View workspace, there will be a folder named "/

Expected behavior
Folder should resolve without quotes, in this example it would go in target folder instead of creating "/workspace path/source/target/allure-results"

Screenshots
image

Environment (please complete the following information):

Allure version 2.13.1 and higher
Test framework testng@6.8
Allure adaptor allure-testng@2.13.1
Generate report using allure-maven@2.10

Additional context
Versions 2.13.0 and below are not affected with this issue.

@taylor-benson taylor-benson added the type:bug Something isn't working label May 14, 2021
@dvargas46
Copy link

Hello - I've run into this issue myself and did some investigation.

From what I can tell, this is actually an issue with the allure-maven repo. However, the problem didn't surface until the allure2 update from 2.13.0 to 2.13.1.

In that update, the JCommander dep went from version 2.72 to 2.78, which included a correction to their handling of quoted named parameters. In prior versions, named parameters were trimmed of surrounding double quotes, but this is no longer the case.

How this relates back to allure-maven is with the use of Apache's CommandLine in Commons Exec. This project has a longstanding bug, which causes added arguments that contain any spaces within it, to be surrounded with literal double quotes and passed through to the command launcher as such. This only occurs when the "handleQuote" flag is set, which is enabled by default. This is done in a few places within allure-maven, but in particular here.

So for the path mentioned in this issue: /workspace path/source/target/allure-results
The mvn plugin would add this as an argument to the allure binary with the handleQuotes option set, causing it to be passed through as "/workspace path/source/target/allure-results" with literal quotes in the string and further processed by allure with JCommander, which no longer trims it.

A simple solution to this that I could think would be to pass false to the "handleQuotes" option in the allure-maven project when adding arguments to CommandLine and it doesn't seem to have any negative side effects. I did a quick check on unix-like and windows systems, with and without spaces, and it seems to work. Although, I'm not so sure about some more potentially obscure paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants