-
Notifications
You must be signed in to change notification settings - Fork 318
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
Suites are duplicated in the test tree on Windows #4441
Comments
Seems like the slashes in paths may be the wrong way in the notifications:
|
@jakemac53 what's the expected behaviour here? In the
I'm not sure if this has changed or I just never noticed it (I'll do some testing with different versions shortly), although I also notice that we get relative or absolute paths based on how we run the file (which may be intended, but surprised me, and I think should be noted in the JSON reporter doc so it's clear to users of this what the expectations are):
|
It does appear this changed. Using |
Fixes #4441 (and related failing tests).
Yes there was a change in how paths are reported on windows related to the windows fixes that landed recently. |
@jakemac53 intended, or accidental? I've pushed a fix here that will just naively replace slashes on Windows to fix the issue here, but I think the json reporter docs should be more explicit about what to expect (slash directions, absolute vs relative) since they're likely being consumed by tools. |
It was a known change, tests had to be updated for it, but it was a byproduct of other changes. So I guess we can call it intended :). It was overlooked that this would also potentially affect uses of the json API though. However there are still some cases I think where the backslashes do appear - in particular on github this was showing up still, something weird/different about that environment that I couldn't reproduce. |
Does this mean it's here to stay, or the JSON reporter will be updated? I think it's slightly confusing to use
In the JSON reporter, or somewhere else? |
I do think its here to stay unless we have a really compelling reason to do something else. It is a result of parsing all paths as a URI, we lose the context of the original separator. This allowed us to also remove a fair bit of hacky parsing/trimming of the user input that we had previously.
It could surface in the JSON reporter yes. We only have one "path" internally for tests, for all reporters. We get that path by parsing the user provided path as a URI and then asking for the path of that URI. According to the documentation this would always normalize to forward slashes but there was some weird scenario in which it wasn't, which I couldn't track down. |
You can still get this from a It's a little awkward, but if you've already split the querystring off and are just passing the path around, it'd work. This might be more inline with what's expected (and avoid the potentially breaking change - although perhaps that ship has already sailed).
That does seem odd - I've never seen |
This would be consistent - but still a divergence from what we used to do. The behavior previously would always return the path exactly how it was provided, so regardless of platform it just retained the given style. I believe it would also always be an absolute path, which we wouldn't want generally, we want to report relative paths to the user as they are a lot easier to understand. I could see the JSON reporter always reporting the absolute path, but that would also be breaking, and I worry about doing that change at this time.
What was actually happening is it was encoding the backslashes in the URI. So for some reason it decided to encode them instead of treat them as separators. The existing logic just decodes the path component of the URI when pulling it back out, which ends up just restoring the backslashes. Very weird though and I could not replicate the behavior at all locally. |
Ah, I didn't realise that :-) One way to avoid any confusion would be to add
I'm not sure I understand how it would be breaking if it used to do that (although, I think it might have actually returned absolute if you pass absolute and relative if you pass relative, since I already have some code in the legacy debug adapter to handle relative paths). Whatever is decided here, I think the docs/comments for
Oh, I see. Is it possible there was a mismatch between the platform and it was running on, and the path being given? (eg. a test with a hardcoded Windows path running on non-Windows or vice-versa?). On DartPad if I run |
Yeah I do agree we should update the docs.
It was definitely running on "Windows" but that is just whatever the windows environment on github is. It is possible that this was tricking |
The results from discovery and from running don't seem to have been merged together correctly.
The text was updated successfully, but these errors were encountered: