-
-
Notifications
You must be signed in to change notification settings - Fork 384
Base Path in renderer #689
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #689 +/- ##
============================================
- Coverage 85.05% 84.84% -0.22%
- Complexity 813 814 +1
============================================
Files 32 32
Lines 2476 2481 +5
============================================
- Hits 2106 2105 -1
- Misses 370 376 +6
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #689 +/- ##
============================================
+ Coverage 85.05% 85.08% +0.03%
- Complexity 813 814 +1
============================================
Files 32 32
Lines 2476 2481 +5
============================================
+ Hits 2106 2111 +5
Misses 370 370
Continue to review full report at Codecov.
|
Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I am reluctant to merge it as I do not understand the problem this is trying to solve. |
@sebastianbergmann Did you see the issue I linked? There's been a discussion about another attribute For the attribute to have any effect, the |
Yes, I saw the issue linked. I still do not understand what the problem is supposed to be. The generated HTML works just fine, both locally through |
It does work for me as well both directly and through a web server, but only on root page, e.g. This is because every asset in template links to |
Just put your generated report in a nested folder, and you'll see Styles and scripts aren't loaded. |
This could be either solved by prepending all assets with base path, or by using |
I was able to reproduce it, thanks to your explanation. However, I do not understand why this is happening. The top-level This needs to be addresses, I agree, but can we do so without adding another configuration variable? |
I cannot reproduce this. All links in the generated html files are relative - even including Running this through
Even multiple levels of sub-directories are no issue:
What do I have to do to trigger this issue? |
You're talking about generating a report in a nested folder structure. My problem is generating it in one structure, and then presenting it in another.
Generate the raport, and then move it to another folder or rename the folder it's in (basically, just change the path). |
I will investigate it later today, around 19:00 today and I will give you an update, how to fix it without setting that variable, ok? |
Works like charm? |
Again, all links to assets are relative. The actual name of the I do believe you have an issue with it but I'm not convinced it's based on the links. |
Okay, looks like it's a path problem after all - but different than one might think. Trying
When opening
But when opening the actually technically correct
The first URI is technically invalid and shouldn`t even return the directory index.html without redirecting to the second. Maybe that qualifies as a bug in the PHP cli webserver. Nginx for instance does redirect. |
Maybe it helps to clarify what I mean with "technically invalid". The request to What PHP should probably be doing is what Nginx - and I believe so did apache when i used it last years ago - do as well: If the requested URL resolves to a directory but has no trailing slash, it should send a 301 to the URL with a trailing slash added. The problem does not occur when using tl;dr Imho, this is not a bug in php-code-coverage. |
I agree with @theseer. |
I found an issue: #610
I really would like to pass my custom basePath for the coverage HTML report. Right now it's generated by
AbstractNode#getId()
without any form of customization.This is my first phpunit PR, let me know if it's ok.