kezhenxu94 commented on a change in pull request #55:
URL: https://github.com/apache/skywalking-python/pull/55#discussion_r463918394
##########
File path: tests/plugin/sw_flask/services/provider.py
##########
@@ -24,12 +24,16 @@
config.logging_level = 'DEBUG'
agent.start()
- from flask import Flask, jsonify
+ from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route("/users", methods=["POST", "GET"])
def application():
+ print(request.headers)
+ from skywalking.trace.context import get_context
+ print(get_context().get_correlation("test"))
+ print(get_context().get_correlation("test2"))
Review comment:
Do not simply print the correlation headers, this can not verify
anything, even the headers are empty, the tests still passed, one way is to
propagate these headers to the test codes, return the headers as the http
response, for example, then get the response and verify the expected data here,
https://github.com/apache/skywalking-python/blob/0246634b8e908b845e1540c6d2b70d9058794601/tests/plugin/sw_flask/test_flask.py#L38
`self.validate()` returns the response, and you can get the response and
verify further
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]