@@ -5,7 +5,7 @@ defmodule Sentry.EventTest do
55
66 def event_generated_by_exception ( extra \\ % { } ) do
77 try do
8- Event . not_a_function
8+ Event . not_a_function ( 1 , 2 , 3 )
99 rescue
1010 e -> Event . transform_exception ( e , [ stacktrace: System . stacktrace , extra: extra ] )
1111 end
@@ -15,23 +15,24 @@ defmodule Sentry.EventTest do
1515 event = event_generated_by_exception ( )
1616
1717 assert event . platform == "elixir"
18- assert event . culprit == "Sentry.Event.not_a_function() "
18+ assert event . culprit == "Sentry.Event.not_a_function/3 "
1919 assert event . extra == % { }
2020 assert event . exception == [
2121 % { type: UndefinedFunctionError ,
22- value: "function Sentry.Event.not_a_function/0 is undefined or private" ,
22+ value: "function Sentry.Event.not_a_function/3 is undefined or private" ,
2323 module: nil }
2424 ]
2525 assert event . level == "error"
26- assert event . message == "(UndefinedFunctionError) function Sentry.Event.not_a_function/0 is undefined or private"
26+ assert event . message == "(UndefinedFunctionError) function Sentry.Event.not_a_function/3 is undefined or private"
2727 assert is_binary ( event . server_name )
28- assert event . stacktrace == % { frames: Enum . reverse ( [
29- % { filename: nil , function: "Sentry.Event.not_a_function/0" , lineno: nil , module: Sentry.Event , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false } ,
30- % { filename: "test/event_test.exs" , function: "Sentry.EventTest.event_generated_by_exception/1" , lineno: 8 , module: Sentry.EventTest , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false } ,
31- % { filename: "test/event_test.exs" , function: "Sentry.EventTest.\" test parses error exception\" /1" , lineno: 15 , module: Sentry.EventTest , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false } ,
32- % { filename: "lib/ex_unit/runner.ex" , function: "ExUnit.Runner.exec_test/1" , lineno: 302 , module: ExUnit.Runner , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false } ,
33- % { filename: "timer.erl" , function: ":timer.tc/1" , lineno: 166 , module: :timer , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false } ,
34- % { filename: "lib/ex_unit/runner.ex" , function: "anonymous fn/3 in ExUnit.Runner.spawn_test/3" , lineno: 250 , module: ExUnit.Runner , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false } ] )
28+ assert event . stacktrace == % {
29+ frames: Enum . reverse ( [
30+ % { filename: nil , function: "Sentry.Event.not_a_function/3" , lineno: nil , module: Sentry.Event , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false , vars: % { "arg0" => "1" , "arg1" => "2" , "arg2" => "3" } } ,
31+ % { filename: "test/event_test.exs" , function: "Sentry.EventTest.event_generated_by_exception/1" , lineno: 8 , module: Sentry.EventTest , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false , vars: % { } } ,
32+ % { filename: "test/event_test.exs" , function: "Sentry.EventTest.\" test parses error exception\" /1" , lineno: 15 , module: Sentry.EventTest , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false , vars: % { } } ,
33+ % { filename: "lib/ex_unit/runner.ex" , function: "ExUnit.Runner.exec_test/1" , lineno: 302 , module: ExUnit.Runner , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false , vars: % { } } ,
34+ % { filename: "timer.erl" , function: ":timer.tc/1" , lineno: 166 , module: :timer , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false , vars: % { } } ,
35+ % { filename: "lib/ex_unit/runner.ex" , function: "anonymous fn/3 in ExUnit.Runner.spawn_test/3" , lineno: 250 , module: ExUnit.Runner , context_line: nil , post_context: [ ] , pre_context: [ ] , in_app: false , vars: % { } } ] )
3536 }
3637 assert event . tags == % { }
3738 assert event . timestamp =~ ~r/ \d {4}-\d {2}-\d {2}T\d {2}:\d {2}:\d {2}/
@@ -83,34 +84,39 @@ defmodule Sentry.EventTest do
8384 event = Sentry.Event . transform_exception ( exception , [ stacktrace: [ { Elixir.Sentry.Fun , :method , 2 , [ ] } , { Elixir.Sentry , :other_method , 4 , [ ] } ,
8485 { :other_module , :a_method , 8 , [ ] } , { :random , :uniform , 0 , [ ] } ,
8586 { Sentry.Submodule.Fun , :this_method , 0 , [ ] } ] ] )
86- assert % { frames: [
87+ assert % {
88+ frames: [
8789 % {
8890 module: Sentry.Submodule.Fun ,
8991 function: "Sentry.Submodule.Fun.this_method/0" ,
9092 in_app: true ,
9193 filename: nil , lineno: nil ,
92- context_line: nil , post_context: [ ] , pre_context: [ ]
94+ context_line: nil , post_context: [ ] , pre_context: [ ] ,
95+ vars: % { } ,
9396 } ,
9497 % {
9598 module: :random ,
9699 function: ":random.uniform/0" ,
97100 in_app: true ,
98101 filename: nil , lineno: nil ,
99- context_line: nil , post_context: [ ] , pre_context: [ ]
102+ context_line: nil , post_context: [ ] , pre_context: [ ] ,
103+ vars: % { } ,
100104 } ,
101105 % {
102106 module: :other_module ,
103107 function: ":other_module.a_method/8" ,
104108 in_app: false ,
105109 filename: nil , lineno: nil ,
106- context_line: nil , post_context: [ ] , pre_context: [ ]
110+ context_line: nil , post_context: [ ] , pre_context: [ ] ,
111+ vars: % { } ,
107112 } ,
108113 % {
109114 module: Sentry ,
110115 function: "Sentry.other_method/4" ,
111116 in_app: true ,
112117 filename: nil , lineno: nil ,
113- context_line: nil , post_context: [ ] , pre_context: [ ]
118+ context_line: nil , post_context: [ ] , pre_context: [ ] ,
119+ vars: % { } ,
114120 } ,
115121 % {
116122 filename: nil ,
@@ -120,7 +126,8 @@ defmodule Sentry.EventTest do
120126 in_app: true ,
121127 context_line: nil ,
122128 post_context: [ ] ,
123- pre_context: [ ]
129+ pre_context: [ ] ,
130+ vars: % { } ,
124131 } ,
125132 ] } == event . stacktrace
126133 end
@@ -129,9 +136,9 @@ defmodule Sentry.EventTest do
129136 exception = RuntimeError . exception ( "error" )
130137 event = Sentry.Event . transform_exception ( exception , [ ] )
131138
132- assert event . modules == % { bunt: "0.2.0" , bypass: "0.7.0 " , certifi: "1.1.0" , cowboy: "1.1.2" ,
139+ assert event . modules == % { bunt: "0.2.0" , bypass: "0.8.1 " , certifi: "1.1.0" , cowboy: "1.1.2" ,
133140 cowlib: "1.0.2" , credo: "0.8.6" , hackney: "1.8.0" , idna: "4.0.0" ,
134- metrics: "1.0.1" , mime: "1.1.0" , mimerl: "1.0.2" , plug: "1.3.5 " ,
141+ metrics: "1.0.1" , mime: "1.1.0" , mimerl: "1.0.2" , plug: "1.4.3 " ,
135142 poison: "3.1.0" , ranch: "1.3.2" , ssl_verify_fun: "1.1.1" ,
136143 uuid: "1.1.7" }
137144 end
0 commit comments