@@ -7,6 +7,8 @@ defmodule Services.TraceServiceTest do
77 alias LiveDebugger.Services.TraceService
88 alias LiveDebugger.MockEtsTableServer
99
10+ @ all_functions LiveDebugger.Utils.Callbacks . callbacks_functions ( )
11+
1012 setup :verify_on_exit!
1113
1214 setup_all do
@@ -56,7 +58,8 @@ defmodule Services.TraceServiceTest do
5658 MockEtsTableServer
5759 |> expect ( :table , fn ^ pid -> table end )
5860
59- assert { [ ^ trace1 , ^ trace2 ] , _ } = TraceService . existing_traces ( pid )
61+ assert { [ ^ trace1 , ^ trace2 ] , _ } =
62+ TraceService . existing_traces ( pid , functions: @ all_functions )
6063 end
6164
6265 test "returns traces with limit and continuation" , % { module: module , pid: pid , table: table } do
@@ -71,12 +74,13 @@ defmodule Services.TraceServiceTest do
7174 MockEtsTableServer
7275 |> expect ( :table , fn ^ pid -> table end )
7376
74- { traces1 , cont } = TraceService . existing_traces ( pid , limit: 2 )
75- { traces2 , cont } = TraceService . existing_traces ( pid , cont: cont )
77+ { traces1 , cont } = TraceService . existing_traces ( pid , limit: 2 , functions: @ all_functions )
78+ { traces2 , cont } = TraceService . existing_traces ( pid , cont: cont , functions: @ all_functions )
7679
7780 assert [ trace1 , trace2 ] == traces1
7881 assert [ trace3 ] == traces2
7982 assert cont == :end_of_table
83+
8084 assert :end_of_table == TraceService . existing_traces ( pid , cont: :end_of_table )
8185 end
8286
@@ -121,12 +125,14 @@ defmodule Services.TraceServiceTest do
121125
122126 assert { [ ^ trace2 ] , _ } =
123127 TraceService . existing_traces ( pid ,
124- execution_times: [ exec_time_min: 15 , exec_time_max: 50 ]
128+ execution_times: [ exec_time_min: 15 , exec_time_max: 50 ] ,
129+ functions: @ all_functions
125130 )
126131
127132 assert { [ ^ trace2 , ^ trace3 ] , _ } =
128133 TraceService . existing_traces ( pid ,
129- execution_times: [ exec_time_min: 15 , exec_time_max: :infinity ]
134+ execution_times: [ exec_time_min: 15 , exec_time_max: :infinity ] ,
135+ functions: @ all_functions
130136 )
131137 end
132138
@@ -173,8 +179,11 @@ defmodule Services.TraceServiceTest do
173179 MockEtsTableServer
174180 |> expect ( :table , 2 , fn ^ pid -> table end )
175181
176- assert { [ ^ trace1 ] , _ } = TraceService . existing_traces ( pid , node_id: pid )
177- assert { [ ^ trace2 , ^ trace3 ] , _ } = TraceService . existing_traces ( pid , node_id: cid )
182+ assert { [ ^ trace1 ] , _ } =
183+ TraceService . existing_traces ( pid , node_id: pid , functions: @ all_functions )
184+
185+ assert { [ ^ trace2 , ^ trace3 ] , _ } =
186+ TraceService . existing_traces ( pid , node_id: cid , functions: @ all_functions )
178187 end
179188
180189 test "returns :end_of_table when no traces match" , % { module: module , pid: pid , table: table } do
@@ -201,7 +210,7 @@ defmodule Services.TraceServiceTest do
201210 MockEtsTableServer
202211 |> expect ( :table , fn ^ pid -> table end )
203212
204- assert { [ ^ trace1 ] , _ } = TraceService . existing_traces ( pid )
213+ assert { [ ^ trace1 ] , _ } = TraceService . existing_traces ( pid , functions: @ all_functions )
205214 end
206215 end
207216
@@ -218,15 +227,16 @@ defmodule Services.TraceServiceTest do
218227 MockEtsTableServer
219228 |> expect ( :table , 5 , fn ^ pid -> table end )
220229
221- assert { [ ^ trace1 , ^ trace2 ] , _ } = TraceService . existing_traces ( pid )
230+ assert { [ ^ trace1 , ^ trace2 ] , _ } =
231+ TraceService . existing_traces ( pid , functions: @ all_functions )
222232
223233 TraceService . clear_traces ( pid , trace1 . pid )
224234
225- assert { [ ^ trace2 ] , _ } = TraceService . existing_traces ( pid )
235+ assert { [ ^ trace2 ] , _ } = TraceService . existing_traces ( pid , functions: @ all_functions )
226236
227237 TraceService . clear_traces ( pid , trace2 . cid )
228238
229- assert :end_of_table = TraceService . existing_traces ( pid )
239+ assert :end_of_table = TraceService . existing_traces ( pid , functions: @ all_functions )
230240 end
231241 end
232242end
0 commit comments