-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: allow single object proxy config #1633
fix: allow single object proxy config #1633
Conversation
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 PR, good job, we need fix CI problem before merge
@evilebottnawi I'm not sure what the issue is with CI, it timed out. I ran tests on both Node.js It doesn't make much sense because the LTS one passed and it's also Can you retrigger the CI? |
@lukebro done, somethings wrong with Travis, let's wait rebuild, feel free to ping me after build |
Codecov Report
@@ Coverage Diff @@
## master #1633 +/- ##
==========================================
+ Coverage 75.37% 75.45% +0.08%
==========================================
Files 19 19
Lines 597 599 +2
Branches 172 173 +1
==========================================
+ Hits 450 452 +2
Misses 113 113
Partials 34 34
Continue to review full report at Codecov.
|
@evilebottnawi failed again by timeout. How do you recommend I debug this? |
@lukebro do you have mac os machine? We need run this on this system and look what is happening |
@evilebottnawi Yeah I'm on macOS 10.14.2 with Node.js v10.6.0. I've tried with Node.js v10.15.0 also and I can't reproduce the timeout. I'm going to setup my own Travis CI build to debug, I'll ping you when I find something. |
@lukebro thanks for helping |
Yeah @evilebottnawi it is the proxy middleware. When the test helpers call close the middleware just hangs and callback is never called: Should I open an issue there and look into it there? If I remove my changes and create a test with this config:
This should have the same effect (from proxy middleware perspective) and fail. |
@lukebro hm, don't know without this fix all works fine, maybe something wrong with tests, need investigate how we can reproduce bug without dev server |
Nevermind. I was able to track the timeout all the way to For example: Furthermore, I kept the changes I made but removed the the test change and the tests on CI are all green. @evilebottnawi would you be okay with me debugging and possibly refactoring the tests in this PR to address the issues? I can also take a look at the |
For some tests it is normal. Okey, let's comment tests and add todo with link on this issue and i think we can merge |
I'm going to get back to this tomorrow. |
Need rebase too 👍 |
@evilebottnawi sorry, better late then never! Apex came out and I got really distracted. Since the jump to Jest it looks like the failing tests on 10, 8, 6 are now passing 😊. The failure for 11 is extremely weird, and might not be related. Can you quickly take a look and possibly rebuild? |
Node11 is often unstable only on CI 🤔 |
@hiroppy other on macos, and it is very strange, maybe we can investigate which test break CI? |
Somebody can test this locally? |
@evilebottnawi 8 and 10 are good, but 11 is not good. |
@hiroppy let me know if I can help investigate in any way. @evilebottnawi For me 8, 10 and 11 all pass locally. Like Yuta mentioned this seems to be a CI problem with 11. |
fyi: nodejs/node#24835 |
The results of the investigation are as follows. Proxy.test.js has libuv errors.
HistoryApiFallback.test.js has segmentation fault.
|
@hiroppy Great work! Maybe we can skip test what break CI? Like |
Waiting for #1667 to be merged. |
/cc @lukebro please rebase |
Rename the original test of proxy options as an obect to be a test of an object of paths as properties. Add a single test demonstraiting a simple proxy option config.
… config Check for a target property on the proxy config object, and if one exists wrap it an array.
@evilebottnawi all set 👍 |
For Bugs and Features; did you add new tests?
Yes.
Motivation / Use-Case
Fix #1438. Allow for a simple object proxy config as described in the options schema and demonstrated in the docs.
Breaking Changes
N/A
Additional Info
I'm not sure if just checking for a
target
prop is too naive on the proxy config.