-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Handle execution under root more correctly #154
Handle execution under root more correctly #154
Conversation
bfd0f5b
to
ad6af6d
Compare
Pull Request Test Coverage Report for Build 388
💛 - Coveralls |
ad6af6d
to
fabf276
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @P0lip !
Can you provide an example of the problem that you're fixing? What does the URL/path that your getting look like currently, and what do you think it should look like?
process.cwd = processCwd; // already restored at line 19, but just in case | ||
}); | ||
|
||
it("should resolve successfully a $ref pointing at absolute location", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match the other test suites, there need to be tests for the parse()
, resolve()
, dereference()
, and bundle()
methods, each with absolute paths, relative paths, and URLs. I recommend copying the contents of "test/specs/external" into this directory and using that as your starting point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relative paths
This is not going to work since I spoof process.cwd
. I'd need to spoof fs calls as well.
Are you okay with that?
So, the fs library we use for browsers in case of Stoplight Studio, operates on |
7a72c09
to
2c49146
Compare
Sorry for the delayed response. Last week got crazy busy.
Right, but what's the result of this? What's the problem that you're seeing and fixing? I want to make sure we're fixing the right problem in the right place. And that we have the right tests in place. |
@P0lip - can you please enable edits from maintainers on this PR? |
The result is that we try reading such paths starting with more than a single slash, i.e
Hm, I cannot seem to find that option. |
Huh... weird. I wonder if it's an org-level setting that someone at Stoplight would need to allow. 🤷♂️ Anyway... the PR looks good 👍 I have some changes to the tests, which I'll push after merging your changes. |
Hm, that might be the case. I'll touch base with folks to see whether there is such an option exposed somewhere in the panel.
Thanks! |
Right now, the file url starts with triple slashes (
///
). This PR fixes it.