-
Notifications
You must be signed in to change notification settings - Fork 532
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
HTML report produces html files in the wrong directory #521
Comments
This is indeed not the expected behavior. |
I'd be happy to take a stab at a PR to address this, but have some questions about the desired functionality. Currently, the "input file html" files for each input file looks to be created next to the original input file. This is the extra html file in the dir_a directory of the example. Pretty straightforward to create the "input file html" file in the output report directory instead. However, there is potential for name collision, e.g. with input files "/tmp/dir_a/test.hurl" and "./test.hurl". My first thought is to use a hash for each input file. Output directory would then be something like:
There might be an added benefit if a unique html file is generated based on both pathname and contents. Since successive hurl runs append report data, but the source file html is regenerated each time, it will only represent the latest run as currently implemented, which will not be accurate if the input file changes between runs. Unique input file html files assed to the report at each run could capture their state at the time. |
Hi @jleverenz, The HTML file were generated in the report-html directory only when the Hurl input files were specified relatively. I had been mistaken by the API of join of PathBuf. In the fix, the Hurl input path is always be converted to a relative path. for example, The full directory hierarchy is reproduced, therefore, we should not need any hash in the output filename. |
np, took a look at the PR, left a comment. Also, there are some corner cases that I think might need consideration:
|
For me, it's probably ok/acceptable to have collision for But I agree with your second point. A file should only be written below the report-html directory. We could have an initial step to resolve the file in the filesystem. This is easier to explain with examples.
What do you think? |
I agree it's a corner case, but I'm having a hard time looking past it now that I know it's a possibility. Your proposal does look like it should address the original issue reported, though, which seems more urgent. Other issues in the discussion could be tracked separately. I think there are two that would remain after the path-normalization fix:
|
Ok we accept the overwriting issue, it is inherent to to appending feature of the report. |
Hi @jleverenz, I'm now simply generate a relative output HTML filename from it full canonical path. Therefore, an input file will always generate the same output file, independently how it was called at the command-line. For example
The Hurl file could be called with the following filenames, they all generate the same HTML report.
|
Sounds like a good simplification. Only downside I see is the inherently deep directory structure in the output_dir, but otherwise addresses the two issues you mention. 👍 |
Given some Hurl files in
/tmp/dir_a/*.hurl
the following command:hurl --report-html /tmp/dir_b --test /tmp/dir_a/*.hurl
will produces html file for each Hurl file in/tmp/dir_a/
.Not sure if it is by design, but it does seem wrong to me.
Before execution:
After execution:
The text was updated successfully, but these errors were encountered: