-
Notifications
You must be signed in to change notification settings - Fork 685
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
Feature/tracecontext integration test #228
Changes from 12 commits
872d22c
922087c
a0b04fd
c7a094b
754a703
638e0fa
0d4fd01
d656a63
ed628aa
2bf7d12
6194a5f
ad5ba02
b5be7cc
7dd47da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,3 +53,4 @@ _build/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
target |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -301,7 +301,6 @@ def set_status(self, status: trace_api.Status) -> None: | |
|
||
def generate_span_id() -> int: | ||
"""Get a new random span ID. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a particular reason to remove these empty lines? |
||
Returns: | ||
A random 64-bit int for use as a span ID | ||
""" | ||
|
@@ -310,7 +309,6 @@ def generate_span_id() -> int: | |
|
||
def generate_trace_id() -> int: | ||
"""Get a new random trace ID. | ||
|
||
Returns: | ||
A random 128-bit int for use as a trace ID | ||
""" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
set -e | ||
# hard-coding the git tag to ensure stable builds. | ||
TRACECONTEXT_GIT_TAG="98f210efd89c63593dce90e2bae0a1bdcb986f51" | ||
# clone w3c tracecontext tests | ||
mkdir -p target | ||
rm -rf ./target/trace-context | ||
git clone https://github.com/w3c/trace-context ./target/trace-context | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity: why do it this way instead of adding as a submodule? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think submodules work fine here, but generally track a branch vs a commit. I'll look through and may re-add as a followup, or fix it here depending on approvers. |
||
cd ./target/trace-context && git checkout $TRACECONTEXT_GIT_TAG && cd - | ||
# start example opentelemetry service, which propagates trace-context by | ||
# default. | ||
python ./tests/w3c_tracecontext_validation_server.py 1>&2 & | ||
EXAMPLE_SERVER_PID=$! | ||
# give the app server a little time to start up. Not adding some sort | ||
# of delay would cause many of the tracecontext tests to fail being | ||
# unable to connect. | ||
sleep 1 | ||
onshutdown() | ||
{ | ||
# send a sigint, to ensure | ||
# it is caught as a KeyboardInterrupt in the | ||
# example service. | ||
kill $EXAMPLE_SERVER_PID | ||
} | ||
trap onshutdown EXIT | ||
cd ./target/trace-context/test | ||
python test.py http://127.0.0.1:5000/verify-tracecontext | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: empty line before EOF |
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 tests were invalid behaviors in reference to the spec. I removed them as the integration test will validate it is working as intended.