-
Notifications
You must be signed in to change notification settings - Fork 10
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
Khanayan123/add consistent config system tests #3745
Open
khanayan123
wants to merge
43
commits into
main
Choose a base branch
from
khanayan123/add-consistent-config-system-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
b0eea10
save changes
khanayan123 264a755
Add runtime metrics tests
cbeauchesne 252ad46
Add basic deserialization
cbeauchesne c1d9118
add runtime metrics test
khanayan123 f53f99c
push changes
khanayan123 60d2872
fix redordering
khanayan123 72fd00a
update
khanayan123 b792106
update
khanayan123 41dd15a
update
khanayan123 efa3ef3
update php manifest
khanayan123 e871399
fix redordering
khanayan123 d963739
try
khanayan123 a4d445f
update test
khanayan123 6cf3b31
update manifest file
khanayan123 918fbbb
update logger
khanayan123 bb91710
lint
khanayan123 78b9e7b
update test
khanayan123 e954a94
enable 128 bit trace id tests
khanayan123 6a2057e
update
khanayan123 bf111d5
add new endpoint logs
khanayan123 dd4a9c6
format
khanayan123 3afd035
fix
khanayan123 7f51151
update implemented version
khanayan123 f5b4d41
update version
khanayan123 59c1a37
address feedback
khanayan123 3429244
refactor
khanayan123 9f484c5
run lint
khanayan123 54b89be
update annotations
khanayan123 2d42831
add jira ticket number
khanayan123 69a1e60
break apart test_w3c_128_bit_propagation_tid_in_chunk_root test
khanayan123 0eb65dd
run format
khanayan123 17b45bd
skip ruby
khanayan123 6945a62
address feedback
khanayan123 3d14959
run format
khanayan123 9ed1223
simplify
khanayan123 4c75e27
format
khanayan123 7d68776
add ipv6 tests, wait for generator
khanayan123 d2e0312
update node test app
khanayan123 75e4d32
run formatter
khanayan123 bda76a0
update to skip test for missing_features
khanayan123 9dfa2a3
run formatter
khanayan123 6e8f305
fix test app
khanayan123 c363d24
fix testapp
khanayan123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -437,23 +437,11 @@ def test_log_injection_enabled(self): | |
assert self.r.status_code == 200 | ||
pattern = r'"dd":\{[^}]*\}' | ||
stdout.assert_presence(pattern) | ||
for data in stdout.get_data(): | ||
json_string = json.dumps(data) | ||
parsed_data = json.loads(json_string) | ||
message = {} | ||
try: | ||
message = json.loads(parsed_data.get("message")) | ||
except json.JSONDecodeError: | ||
continue | ||
if ( | ||
message.get("dd") | ||
and message.get(log_injection_fields[context.library.library]["message"]) == self.message | ||
): | ||
dd = message.get("dd") | ||
required_fields = ["trace_id", "span_id", "service", "version", "env"] | ||
for field in required_fields: | ||
assert field in dd, f"Missing field: {field}" | ||
return | ||
dd = parse_log_injection_message(self.message) | ||
required_fields = ["trace_id", "span_id", "service", "version", "env"] | ||
for field in required_fields: | ||
assert field in dd, f"Missing field: {field}" | ||
return | ||
|
||
|
||
@rfc("https://docs.google.com/document/d/1kI-gTAKghfcwI7YzKhqRv2ExUstcHqADIWA4-TZ387o/edit#heading=h.8v16cioi7qxp") | ||
|
@@ -484,22 +472,9 @@ def test_log_injection_128bit_traceid_default(self): | |
assert self.r.status_code == 200 | ||
pattern = r'"dd":\{[^}]*\}' | ||
stdout.assert_presence(pattern) | ||
for data in stdout.get_data(): | ||
json_string = json.dumps(data) | ||
parsed_data = json.loads(json_string) | ||
message = {} | ||
try: | ||
message = json.loads(parsed_data.get("message")) | ||
except json.JSONDecodeError: | ||
continue | ||
if ( | ||
message.get("dd") | ||
and message.get(log_injection_fields[context.library.library]["message"]) == self.message | ||
): | ||
dd = message.get("dd") | ||
trace_id = dd.get("trace_id") | ||
assert re.match(r"^[0-9a-f]{32}$", trace_id), f"Invalid 128-bit trace_id: {trace_id}" | ||
|
||
dd = parse_log_injection_message(self.message) | ||
trace_id = dd.get("trace_id") | ||
assert re.match(r"^[0-9a-f]{32}$", trace_id), f"Invalid 128-bit trace_id: {trace_id}" | ||
|
||
@rfc("https://docs.google.com/document/d/1kI-gTAKghfcwI7YzKhqRv2ExUstcHqADIWA4-TZ387o/edit#heading=h.8v16cioi7qxp") | ||
@scenarios.tracing_config_nondefault_3 | ||
|
@@ -513,21 +488,9 @@ def test_log_injection_128bit_traceid_disabled(self): | |
assert self.r.status_code == 200 | ||
pattern = r'"dd":\{[^}]*\}' | ||
stdout.assert_presence(pattern) | ||
for data in stdout.get_data(): | ||
json_string = json.dumps(data) | ||
parsed_data = json.loads(json_string) | ||
message = {} | ||
try: | ||
message = json.loads(parsed_data.get("message")) | ||
except json.JSONDecodeError: | ||
continue | ||
if ( | ||
message.get("dd") | ||
and message.get(log_injection_fields[context.library.library]["message"]) == self.message | ||
): | ||
dd = message.get("dd") | ||
trace_id = dd.get("trace_id") | ||
assert re.match(r"\d+", trace_id), f"Invalid 64-bit trace_id: {trace_id}" | ||
dd = parse_log_injection_message(self.message) | ||
trace_id = dd.get("trace_id") | ||
assert re.match(r"\d+", trace_id), f"Invalid 64-bit trace_id: {trace_id}" | ||
|
||
|
||
@rfc("https://docs.google.com/document/d/1kI-gTAKghfcwI7YzKhqRv2ExUstcHqADIWA4-TZ387o/edit#heading=h.8v16cioi7qxp") | ||
|
@@ -554,3 +517,19 @@ class Test_Config_RuntimeMetrics_Default: | |
def test_config_runtimemetrics_default(self): | ||
data = list(interfaces.library.get_data("/dogstatsd/v2/proxy")) | ||
assert len(data) == 0 | ||
|
||
def parse_log_injection_message(log_message): | ||
for data in stdout.get_data(): | ||
json_string = json.dumps(data) | ||
parsed_data = json.loads(json_string) | ||
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 don't get the purpose of those two line 🤔 |
||
message = {} | ||
try: | ||
message = json.loads(parsed_data.get("message")) | ||
except json.JSONDecodeError: | ||
continue | ||
if ( | ||
message.get("dd") | ||
and message.get(log_injection_fields[context.library.library]["message"]) == log_message | ||
): | ||
dd = message.get("dd") | ||
return dd |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you document a little bit the object of this function?