Skip to content

Commit

Permalink
DEBUG-2334 Split debugger snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Nov 14, 2024
1 parent e9a19ea commit 92fe7e1
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 47 deletions.
15 changes: 15 additions & 0 deletions tests/debugger/probes/probe_snapshot_log_line.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{
"language": "",
"type": "",
"id": "log170aa-acda-4453-9111-1478a697line",
"where": {
"typeName": null,
"sourceFile": "ACTUAL_SOURCE_FILE",
"lines": [
"20"
]
}
}

]
13 changes: 13 additions & 0 deletions tests/debugger/probes/probe_snapshot_log_method.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"language": "",
"type": "",
"id": "log170aa-acda-4453-9111-1478a6method",
"where": {
"typeName": "ACTUAL_TYPE_NAME",
"methodName": "LogProbe",
"sourceFile": null
},
"evaluateAt": "EXIT"
}
]
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
[
{
"language": "",
"type": "",
"id": "log170aa-acda-4453-9111-1478a697line",
"where": {
"typeName": null,
"sourceFile": "ACTUAL_SOURCE_FILE",
"lines": [
"20"
]
}
},
{
"language": "",
"type": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
[
{
"language": "",
"type": "",
"id": "log170aa-acda-4453-9111-1478a6method",
"where": {
"typeName": "ACTUAL_TYPE_NAME",
"methodName": "LogProbe",
"sourceFile": null
},
"evaluateAt": "EXIT"
},
{
"language": "",
"type": "",
"id": "span70aa-acda-4453-9111-1478a6method",
"where": {
"typeName": "ACTUAL_TYPE_NAME",
"methodName": "SpanProbe",
"sourceFile": null
},
"evaluateAt": "EXIT"
},
{
"language": "",
"type": "",
Expand Down
13 changes: 13 additions & 0 deletions tests/debugger/probes/probe_snapshot_span_method.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"language": "",
"type": "",
"id": "span70aa-acda-4453-9111-1478a6method",
"where": {
"typeName": "ACTUAL_TYPE_NAME",
"methodName": "SpanProbe",
"sourceFile": null
},
"evaluateAt": "EXIT"
}
]
79 changes: 66 additions & 13 deletions tests/debugger/test_debugger_probe_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@
@features.debugger
@scenarios.debugger_method_probes_snapshot
class Test_Debugger_Method_Probe_Snaphots(base._Base_Debugger_Test):
def setup_method_probe_snaphots(self):
probes = base.read_probes("probe_snapshot_method")
def setup_log_method_probe_snaphots(self):
probes = base.read_probes("probe_snapshot_log_method")
self.expected_probe_ids = base.extract_probe_ids(probes)
self.rc_state = rc.send_debugger_command(probes, version=1)

interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=30)
interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=12)
self.weblog_responses = [
weblog.get("/debugger/log"),
weblog.get("/debugger/span"),
weblog.get("/debugger/span-decoration/asd/1"),
]

@bug(library="python", reason="DEBUG-2708, DEBUG-2709")
Expand All @@ -29,36 +27,91 @@ def test_method_probe_snaphots(self):
self.assert_all_weblog_responses_ok()

expected_snapshots = ["log170aa-acda-4453-9111-1478a6method"]
expected_spans = ["span70aa-acda-4453-9111-1478a6method", "decor0aa-acda-4453-9111-1478a6method"]

_validate_snapshots(expected_snapshots)

def setup_span_method_probe_snaphots(self):
probes = base.read_probes("probe_snapshot_span_method")
self.expected_probe_ids = base.extract_probe_ids(probes)
self.rc_state = rc.send_debugger_command(probes, version=1)

interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=12)
self.weblog_responses = [
weblog.get("/debugger/span"),
]

@bug(library="python", reason="DEBUG-2708, DEBUG-2709")
def test_span_method_probe_snaphots(self):
self.assert_all_states_not_error()
self.assert_all_probes_are_installed()
self.assert_all_weblog_responses_ok()

expected_spans = ["span70aa-acda-4453-9111-1478a6method"]

_validate_spans(expected_spans)

def setup_span_decoration_method_probe_snaphots(self):
probes = base.read_probes("probe_snapshot_span_decoration_method")
self.expected_probe_ids = base.extract_probe_ids(probes)
self.rc_state = rc.send_debugger_command(probes, version=1)

interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=12)
self.weblog_responses = [
weblog.get("/debugger/span-decoration/asd/1"),
]

@bug(library="python", reason="DEBUG-2708, DEBUG-2709")
def test_span_decoration_method_probe_snaphots(self):
self.assert_all_states_not_error()
self.assert_all_probes_are_installed()
self.assert_all_weblog_responses_ok()

expected_spans = ["decor0aa-acda-4453-9111-1478a6method"]

_validate_spans(expected_spans)


@features.debugger
@scenarios.debugger_line_probes_snapshot
class Test_Debugger_Line_Probe_Snaphots(base._Base_Debugger_Test):
def setup_line_probe_snaphots(self):
probes = base.read_probes("probe_snapshot_line")
def setup_log_line_probe_snaphots(self):
probes = base.read_probes("probe_snapshot_log_line")
self.expected_probe_ids = base.extract_probe_ids(probes)
self.rc_state = rc.send_debugger_command(probes, version=1)

interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=30)
interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=12)

self.weblog_responses = [
weblog.get("/debugger/log"),
weblog.get("/debugger/span-decoration/asd/1"),
]

def test_line_probe_snaphots(self):
def test_log_line_probe_snaphots(self):
self.assert_all_states_not_error()
self.assert_all_probes_are_installed()
self.assert_all_weblog_responses_ok()

expected_snapshots = ["log170aa-acda-4453-9111-1478a697line"]
expected_spans = ["decor0aa-acda-4453-9111-1478a697line"]

_validate_snapshots(expected_snapshots)

def setup_span_decoration_line_probe_snaphots(self):
probes = base.read_probes("probe_snapshot_span_decoration_line")
self.expected_probe_ids = base.extract_probe_ids(probes)
self.rc_state = rc.send_debugger_command(probes, version=1)

interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=12)

self.weblog_responses = [
weblog.get("/debugger/span-decoration/asd/1"),
]

def test_span_decoration_line_probe_snaphots(self):
self.assert_all_states_not_error()
self.assert_all_probes_are_installed()
self.assert_all_weblog_responses_ok()

expected_spans = ["decor0aa-acda-4453-9111-1478a697line"]

_validate_spans(expected_spans)


Expand All @@ -70,7 +123,7 @@ def setup_mix_probe(self):
self.expected_probe_ids = base.extract_probe_ids(probes)
self.rc_state = rc.send_debugger_command(probes, version=1)

interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=30)
interfaces.agent.wait_for(self.wait_for_all_probes_installed, timeout=12)
self.weblog_responses = [weblog.get("/debugger/mix/asd/1")]

@bug(library="python", reason="DEBUG-2710")
Expand Down

0 comments on commit 92fe7e1

Please sign in to comment.