-
Notifications
You must be signed in to change notification settings - Fork 258
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
chore: add integration tests for CORS #1989
Conversation
@tusharmath I think it's ready for your review. If any suggestions or modifications needed, I am ready to incorporate them |
Action required: PR inactive for 2 days. |
Will update the tests as required soon |
Action required: PR inactive for 2 days. |
Action required: PR inactive for 2 days. |
Action required: PR inactive for 2 days. |
Action required: PR inactive for 2 days. |
src/core/http/request_handler.rs
Outdated
req_ctx: &RequestContext, | ||
app_ctx: &AppContext, | ||
) { | ||
set_common_headers(resp.headers_mut(), app_ctx, req_ctx); | ||
} |
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.
These changes doesn't seem to be doing much. Can we revert it to the one it was in main?
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.
Okay! @tusharmath.
@tusharmath Any tip would be great for my efforts of trying to get optimise the |
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.
Fix review comments. Whenever completed, please mark it as ready to review.
Pull request was converted to draft
@tusharmath I have added some more tests. PTAL |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1989 +/- ##
==========================================
- Coverage 85.91% 84.15% -1.76%
==========================================
Files 211 212 +1
Lines 19993 19987 -6
==========================================
- Hits 17177 16821 -356
- Misses 2816 3166 +350 ☔ View full report in Codecov by Sentry. |
I am unable to run |
Action required: PR inactive for 2 days. |
@server( | ||
port: 8000 | ||
headers: { | ||
cors: {allowHeaders: ["*"], allowMethods: ["GET", "POST", "OPTIONS"], allowOrigins: ["https://tailcall.run"]} |
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.
The issue is intended to test headers that put automatically for tailcall.run
and therefore we don't need to specify headers in test - we need to test that it works without headers
} | ||
|
||
type Query { | ||
example: String @http(path: "/example") |
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.
need to mock this request
expected: | ||
status: 200 | ||
headers: | ||
access-control-allow-origin: https://tailcall.run |
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.
we use snapshots and not explicit expected
definitions in tests. That should be removed and proper snapshots should be generated
Closing for now since it requires additional work. Feel free to reopen this when it's ready. If you have any troubles with code/tooling please ask in our #contributors channel on Discord |
Summary:
Issue Reference(s):
Build & Testing:
cargo test
successfully../lint.sh --mode=fix
to fix all linting issues raised by./lint.sh --mode=check
.Checklist:
<type>(<optional scope>): <title>