rails-profiler 0.32.1 → 0.32.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 696b15a9e7e1409bea43ef0541724ca559955c2dba15643c5743bf606c62ba60
4
- data.tar.gz: 4091f3101110253c4ff00c32a0010e8b8097c329b7b2af10e91f13df82a15dbe
3
+ metadata.gz: 403d9ff1c8dc1f63d91b2ae71490ab29ef762da12f035ca1cd566d2e036083e5
4
+ data.tar.gz: d63bf66a090688c87efbcfa4c84140c25c0d611f1f760c3c4ff8c24410ce98f1
5
5
  SHA512:
6
- metadata.gz: 101f907c26e725cafa2d4fb70cab3ae957e0e3db9ddca412220137ae66af242f8c8397646bb8c239999e6d5b4d6121bf1c1b73169fe3c8ce982f7fbf2dcd066c
7
- data.tar.gz: f966f148cd6cbb34867691d0f18549190b15e5059e21b87adbdf457b5b62e8cceeeac195f0693fe206e9117440e940d0f96aac4a25c8c411cfc84bec28ec5fb5
6
+ metadata.gz: db9b3d2fbc40310a01d3bde8675f218931bcdb35409c677ae1fc9ca8b490fe0103aba880db1bee5a16d6dda96ebc5caa7763cecc50e3638b3ee74eb60c4a35d4
7
+ data.tar.gz: fe872b2809ec74b20f449cbafbfe3ee440f78ad54e909e0415ce90c222206c8108d191689366655ddcdaf1bbca83cdda489f51e41f59d190fc25fb43945c936b
data/CHANGELOG.md CHANGED
@@ -19,6 +19,24 @@ every commit of every tag interval is accounted for one way or the other.
19
19
 
20
20
  ## [Unreleased]
21
21
 
22
+ ## [0.32.2] - 2026-10-13
23
+
24
+ <!-- stamped -->
25
+
26
+ ### Fixed
27
+
28
+ - **Test profiling:** `Profiler::TestHelpers::RSpecSupport.install` no longer makes every RSpec
29
+ example fail with `NoMethodError: undefined method 'line_number'`. The workaround documented
30
+ for 0.32.1, a hand-written `around` hook, can be replaced by `install` again.
31
+ - **Test profiling:** Failing and pending RSpec examples are recorded with their real status,
32
+ `failed` or `pending`, instead of `passed`, in the test profiles and in the report printed
33
+ after the suite. A failure keeps its message, and an example marked `pending` or `skip` in its
34
+ body keeps its reason. This holds for an example tagged `:aggregate_failures` and for a failure
35
+ raised by an `around` hook of the suite, which the profiler now wraps.
36
+ - **Test profiling:** With Minitest, an error raised by the profiler no longer runs the test a
37
+ second time, unprofiled, while hiding the error. The test fails with that error, once, and the
38
+ run goes on with the next tests.
39
+
22
40
  ## [0.32.1] - 2026-10-13
23
41
 
24
42
  <!-- stamped -->
@@ -847,323 +865,323 @@ every commit of every tag interval is accounted for one way or the other.
847
865
 
848
866
  ### Fixed
849
867
 
850
- - **Cluster:** Resolve profiles across slaves from the master `ProfilesController` <!-- 9236c4c -->
868
+ - **Cluster:** Resolve profiles across slaves from the master `ProfilesController` <!-- 57d379f -->
851
869
 
852
870
  ## [0.30.3] - 2026-06-29
853
871
 
854
872
  ### Fixed
855
873
 
856
- - Wrap the profile dashboards and `TestRunnerPage` with `QueryClientProvider` <!-- 420ae2f -->
874
+ - Wrap the profile dashboards and `TestRunnerPage` with `QueryClientProvider` <!-- e5ad047 -->
857
875
 
858
876
  ## [0.30.2] - 2026-06-29
859
877
 
860
878
  ### Fixed
861
879
 
862
- - **Middleware:** Duplicate downstream headers before mutating them <!-- 3efb20c -->
880
+ - **Middleware:** Duplicate downstream headers before mutating them <!-- 01cea9c -->
863
881
 
864
882
  ## [0.30.1] - 2026-06-29
865
883
 
866
884
  ### Fixed
867
885
 
868
- - **Cluster:** Fix sentinel mismatch, profile list pagination, nil safety in MCP tools and HTTPS slave URLs <!-- 4b5fb1c -->
886
+ - **Cluster:** Fix sentinel mismatch, profile list pagination, nil safety in MCP tools and HTTPS slave URLs <!-- a8a508b -->
869
887
 
870
888
  ## [0.30.0] - 2026-06-28
871
889
 
872
890
  ### Added
873
891
 
874
- - **Cluster:** Add master/slave profiler clustering <!-- 1435f22 -->
892
+ - **Cluster:** Add master/slave profiler clustering <!-- 8109047 -->
875
893
 
876
894
  ## [0.29.0] - 2026-06-28
877
895
 
878
896
  ### Added
879
897
 
880
- - **SSE:** Push live profile updates over server-sent events <!-- fa0ae2e -->
898
+ - **SSE:** Push live profile updates over server-sent events <!-- ff431f6 -->
881
899
 
882
900
  ## [0.28.0] - 2026-06-06
883
901
 
884
902
  ### Added
885
903
 
886
- - **HTTP:** Add the `http_backtrace_depth` configuration option <!-- 25b4f99 -->
904
+ - **HTTP:** Add the `http_backtrace_depth` configuration option <!-- e15864c -->
887
905
 
888
906
  ## [0.27.1] - 2026-06-06
889
907
 
890
908
  ### Changed
891
909
 
892
- - **API:** Replace manual `fetch()` calls with `orval` generated TanStack Query hooks <!-- e33341e -->
910
+ - **API:** Replace manual `fetch()` calls with `orval` generated TanStack Query hooks <!-- cc3e2ca -->
893
911
 
894
912
  ### Fixed
895
913
 
896
- - **File store:** Prevent `ENOENT` errors on concurrent profile file deletion <!-- 8898f0e -->
914
+ - **File store:** Prevent `ENOENT` errors on concurrent profile file deletion <!-- d1dd476 -->
897
915
 
898
916
  ## [0.27.0] - 2026-06-02
899
917
 
900
918
  ### Added
901
919
 
902
- - **MCP:** Add console profiling, mailer detail, logs/env/i18n sections and full documentation <!-- ca362a1 -->
920
+ - **MCP:** Add console profiling, mailer detail, logs/env/i18n sections and full documentation <!-- 9f97a3f -->
903
921
 
904
922
  ## [0.26.0] - 2026-06-02
905
923
 
906
924
  ### Added
907
925
 
908
- - **Test profiler:** Add the `run_tests` MCP tool, the `track_tests` option, specs and docs <!-- 265ce03 -->
909
- - **Test profiler:** Enrich reporter, add SSE streaming, MCP tools and env safety <!-- a410c4b -->
910
- - **Test profiler:** Add test profiling, test runner UI and MCP tool <!-- a116fcb -->
926
+ - **Test profiler:** Add the `run_tests` MCP tool, the `track_tests` option, specs and docs <!-- 5c63fc0 -->
927
+ - **Test profiler:** Enrich reporter, add SSE streaming, MCP tools and env safety <!-- 58b2d8b -->
928
+ - **Test profiler:** Add test profiling, test runner UI and MCP tool <!-- 4c50149 -->
911
929
 
912
930
  ## [0.25.0] - 2026-06-01
913
931
 
914
932
  ### Added
915
933
 
916
- - **Console:** Add a console profiling tab with IRB instrumentation <!-- f29937a -->
934
+ - **Console:** Add a console profiling tab with IRB instrumentation <!-- c6ce1b7 -->
917
935
 
918
936
  ### Changed
919
937
 
920
- - **Docs:** Document the console profiling tab and the env override behaviour <!-- 031cac6 -->
938
+ - **Docs:** Document the console profiling tab and the env override behaviour <!-- e4f6fe9 -->
921
939
 
922
940
  <!-- excluded:
923
- bd55e9b specs only, no visible change
941
+ e8941a4 specs only, no visible change
924
942
  -->
925
943
 
926
944
  ## [0.24.0] - 2026-06-01
927
945
 
928
946
  ### Added
929
947
 
930
- - **MCP:** Add tools to manage `ENV` variables <!-- 9126194 -->
948
+ - **MCP:** Add tools to manage `ENV` variables <!-- 52f43ce -->
931
949
 
932
950
  ## [0.23.0] - 2026-05-27
933
951
 
934
952
  ### Added
935
953
 
936
- - **Profile list:** Add a global clear-all button and auto-refresh on tab switch <!-- 460a110 -->
954
+ - **Profile list:** Add a global clear-all button and auto-refresh on tab switch <!-- b85fc97 -->
937
955
 
938
956
  ## [0.22.1] - 2026-05-26
939
957
 
940
958
  ### Fixed
941
959
 
942
- - **HTTP:** Propagate collector to child threads, add fire-and-forget support, fix deep backtrace capture <!-- 9d0bd61 -->
960
+ - **HTTP:** Propagate collector to child threads, add fire-and-forget support, fix deep backtrace capture <!-- 8fd3f63 -->
943
961
 
944
962
  ## [0.22.0] - 2026-05-04
945
963
 
946
964
  ### Added
947
965
 
948
- - **Mailer:** Add a body preview, a variables display, a queued badge and design alignment <!-- b7d608f -->
949
- - **Collector:** Implement `MailerCollector`, tracking ActionMailer deliveries <!-- e59dd72 -->
966
+ - **Mailer:** Add a body preview, a variables display, a queued badge and design alignment <!-- d016698 -->
967
+ - **Collector:** Implement `MailerCollector`, tracking ActionMailer deliveries <!-- b1705c9 -->
950
968
 
951
969
  ### Changed
952
970
 
953
- - **Toolbar:** Remove the emoji from the mailer toolbar item and the dashboard tab <!-- 55df9bb -->
971
+ - **Toolbar:** Remove the emoji from the mailer toolbar item and the dashboard tab <!-- f18e615 -->
954
972
 
955
973
  ### Fixed
956
974
 
957
- - **Mailer:** Add the Mailers tab to `JobProfileDashboard` <!-- 4ce145d -->
958
- - **Mailer:** Fix thread isolation and `deliver_later` mode detection <!-- 6e76a99 -->
959
- - **Mailer:** Add `MailerCollector` to the job profiler and align the toolbar item design <!-- 915be28 -->
960
- - **Mailer:** Handle the Rails 7 encoded mail string in the `deliver.action_mailer` payload <!-- 5479dcf -->
961
- - **Mailer:** Replace `Thread.current.delete` with a read and nil write for fiber local variables <!-- 8787201 -->
962
- - **Version:** Remove the pre-release suffix, which broke Bundler resolution <!-- 98caecd -->
963
- - **Mailer:** Address code review findings from MR !32 <!-- b46d3d2 -->
975
+ - **Mailer:** Add the Mailers tab to `JobProfileDashboard` <!-- 05f0549 -->
976
+ - **Mailer:** Fix thread isolation and `deliver_later` mode detection <!-- 35c9de3 -->
977
+ - **Mailer:** Add `MailerCollector` to the job profiler and align the toolbar item design <!-- e566a77 -->
978
+ - **Mailer:** Handle the Rails 7 encoded mail string in the `deliver.action_mailer` payload <!-- c5519ce -->
979
+ - **Mailer:** Replace `Thread.current.delete` with a read and nil write for fiber local variables <!-- 2828c44 -->
980
+ - **Version:** Remove the pre-release suffix, which broke Bundler resolution <!-- eba7e9f -->
981
+ - **Mailer:** Address code review findings from MR !32 <!-- 655d090 -->
964
982
 
965
983
  ## [0.21.0] - 2026-05-02
966
984
 
967
985
  ### Added
968
986
 
969
- - **Toolbar:** Add a collapse/expand toggle <!-- 8f0669a -->
987
+ - **Toolbar:** Add a collapse/expand toggle <!-- 7bc637a -->
970
988
 
971
989
  ## [0.20.0] - 2026-05-01
972
990
 
973
991
  ### Added
974
992
 
975
- - **UI:** Display the gem version and warn on a mismatch <!-- 64ff6eb -->
993
+ - **UI:** Display the gem version and warn on a mismatch <!-- a2509c2 -->
976
994
 
977
995
  ## [0.19.2] - 2026-04-24
978
996
 
979
997
  ### Fixed
980
998
 
981
- - **HTTP:** Capture `RestClient` `body_stream`, remove body size limits, show bodies in MCP tool results <!-- 89fb0e5 -->
999
+ - **HTTP:** Capture `RestClient` `body_stream`, remove body size limits, show bodies in MCP tool results <!-- 20654f5 -->
982
1000
 
983
1001
  <!-- excluded:
984
- 4527e12 release plumbing, version placeholder reset
1002
+ a9f2cd3 release plumbing, version placeholder reset
985
1003
  -->
986
1004
 
987
1005
  ## [0.19.1] - 2026-04-17
988
1006
 
989
1007
  ### Fixed
990
1008
 
991
- - **Env vars:** Fix revert restoring wrong value, SQLite busy errors, middleware rescue handling and UI refresh <!-- 55c8661 -->
1009
+ - **Env vars:** Fix revert restoring wrong value, SQLite busy errors, middleware rescue handling and UI refresh <!-- 33bd079 -->
992
1010
 
993
1011
  <!-- excluded:
994
- 4637391 pipeline only
995
- b53b4d7 pipeline only
996
- 7b33bf6 pipeline only
1012
+ 9da240b pipeline only
1013
+ 09748d1 pipeline only
1014
+ 4e8500b pipeline only
997
1015
  -->
998
1016
 
999
1017
  ## [0.19.0] - 2026-04-15
1000
1018
 
1001
1019
  ### Added
1002
1020
 
1003
- - **Env:** Propagate env var overrides to Sidekiq workers <!-- e75a883 -->
1021
+ - **Env:** Propagate env var overrides to Sidekiq workers <!-- c404799 -->
1004
1022
 
1005
1023
  ## [0.18.0] - 2026-04-14
1006
1024
 
1007
1025
  ### Changed
1008
1026
 
1009
- - **UI:** Extract shared tab utilities and redesign the Request tab <!-- 7aa8adb -->
1027
+ - **UI:** Extract shared tab utilities and redesign the Request tab <!-- 47e6269 -->
1010
1028
 
1011
1029
  ### Fixed
1012
1030
 
1013
- - **HTTP:** Capture outbound request body passed as second argument to `http.request()` <!-- 5a59665 -->
1031
+ - **HTTP:** Capture outbound request body passed as second argument to `http.request()` <!-- 2dda00f -->
1014
1032
 
1015
1033
  ## [0.17.0] - 2026-04-13
1016
1034
 
1017
1035
  ### Added
1018
1036
 
1019
- - **Dashboard:** Add env tab on the home page and env/job toolbar items <!-- d0277ab -->
1037
+ - **Dashboard:** Add env tab on the home page and env/job toolbar items <!-- c623c40 -->
1020
1038
 
1021
1039
  ## [0.16.0] - 2026-04-13
1022
1040
 
1023
1041
  ### Added
1024
1042
 
1025
- - **Function profiler:** Add `stackprof` sampling mode with multi-clock support and GC visibility <!-- 5f73512 -->
1043
+ - **Function profiler:** Add `stackprof` sampling mode with multi-clock support and GC visibility <!-- 5f461d9 -->
1026
1044
 
1027
1045
  ### Fixed
1028
1046
 
1029
- - **Function profiler:** Fix `stackprof` bugs, remove minimal mode, improve performance <!-- 76c6197 -->
1047
+ - **Function profiler:** Fix `stackprof` bugs, remove minimal mode, improve performance <!-- 8adc3ca -->
1030
1048
 
1031
1049
  ## [0.15.0] - 2026-04-11
1032
1050
 
1033
1051
  ### Added
1034
1052
 
1035
- - **Env:** Add environment variables tab <!-- 0e85f18 -->
1053
+ - **Env:** Add environment variables tab <!-- fa3bcec -->
1036
1054
 
1037
1055
  ## [0.14.0] - 2026-04-09
1038
1056
 
1039
1057
  ### Added
1040
1058
 
1041
- - **Profiler:** Link jobs to their triggering request or parent job <!-- 74ba5e3 -->
1059
+ - **Profiler:** Link jobs to their triggering request or parent job <!-- 5d598f6 -->
1042
1060
 
1043
1061
  ## [0.13.0] - 2026-04-09
1044
1062
 
1045
1063
  ### Added
1046
1064
 
1047
- - **UI:** Add copy/download buttons on HTTP bodies, waterfall view, date sort, and other UX improvements <!-- 5afd003 -->
1048
- - **UI:** Always show waterfall above the HTTP request list <!-- 32c6b6d -->
1049
- - **UI:** Use `SmartBodyPreview` in RequestTab for copy/download on request and response bodies <!-- aef4c0c -->
1065
+ - **UI:** Add copy/download buttons on HTTP bodies, waterfall view, date sort, and other UX improvements <!-- e7b430b -->
1066
+ - **UI:** Always show waterfall above the HTTP request list <!-- bec6cb0 -->
1067
+ - **UI:** Use `SmartBodyPreview` in RequestTab for copy/download on request and response bodies <!-- 439a9ac -->
1050
1068
 
1051
1069
  ### Fixed
1052
1070
 
1053
- - **UI:** Derive download file extension from actual MIME type instead of body category <!-- 1dc0bc8 -->
1054
- - **UI:** Move `sortedJobs` after `filteredJobs` to fix TDZ error <!-- d4de7bc -->
1071
+ - **UI:** Derive download file extension from actual MIME type instead of body category <!-- 987a65e -->
1072
+ - **UI:** Move `sortedJobs` after `filteredJobs` to fix TDZ error <!-- 235d492 -->
1055
1073
 
1056
1074
  ## [0.12.0] - 2026-04-09
1057
1075
 
1058
1076
  ### Added
1059
1077
 
1060
- - **Profiler:** Add function-level profiling with flamegraph and stats table <!-- fcb04a6 -->
1078
+ - **Profiler:** Add function-level profiling with flamegraph and stats table <!-- 2781cff -->
1061
1079
 
1062
1080
  ## [0.11.1] - 2026-04-09
1063
1081
 
1064
1082
  ### Added
1065
1083
 
1066
- - **Config:** Add `tmp_path` option to centralize the storage directory <!-- 5e77944 -->
1084
+ - **Config:** Add `tmp_path` option to centralize the storage directory <!-- d68a4c7 -->
1067
1085
 
1068
1086
  ### Fixed
1069
1087
 
1070
- - **MCP:** Decompress gzip+base64 bodies before returning to UI and MCP tool results <!-- 8f5ac47 -->
1088
+ - **MCP:** Decompress gzip+base64 bodies before returning to UI and MCP tool results <!-- c551773 -->
1071
1089
 
1072
1090
  ## [0.11.0] - 2026-04-06
1073
1091
 
1074
1092
  ### Added
1075
1093
 
1076
- - **UI:** Add load-more pagination to the profile list <!-- 9f8458b -->
1094
+ - **UI:** Add load-more pagination to the profile list <!-- ef49a2a -->
1077
1095
 
1078
1096
  ## [0.10.1] - 2026-04-06
1079
1097
 
1080
1098
  ### Changed
1081
1099
 
1082
- - **Docs:** Add full user documentation, with a UI guide, an MCP guide and screenshots <!-- 80a9198 -->
1100
+ - **Docs:** Add full user documentation, with a UI guide, an MCP guide and screenshots <!-- 2e34dc1 -->
1083
1101
 
1084
1102
  ## [0.10.0] - 2026-04-06
1085
1103
 
1086
1104
  ### Added
1087
1105
 
1088
- - **Middleware:** Add configurable CORS origins, CSP nonce support and body compression <!-- 3a42188 -->
1106
+ - **Middleware:** Add configurable CORS origins, CSP nonce support and body compression <!-- bb13049 -->
1089
1107
 
1090
1108
  ## [0.9.1] - 2026-04-06
1091
1109
 
1092
1110
  ### Removed
1093
1111
 
1094
- - **Collectors:** Remove `PerformanceCollector`, replaced by `FlameGraphCollector` <!-- 212e155 -->
1112
+ - **Collectors:** Remove `PerformanceCollector`, replaced by `FlameGraphCollector` <!-- fd03ac6 -->
1095
1113
 
1096
1114
  ## [0.9.0] - 2026-04-06
1097
1115
 
1098
1116
  ### Added
1099
1117
 
1100
- - **Profiler:** Add the `Profiler.measure` custom instrumentation API <!-- 0a3044e -->
1118
+ - **Profiler:** Add the `Profiler.measure` custom instrumentation API <!-- a3ab553 -->
1101
1119
 
1102
1120
  ## [0.8.0] - 2026-04-05
1103
1121
 
1104
1122
  ### Added
1105
1123
 
1106
- - **UI:** Add sortable columns, quick filter presets and flamegraph search <!-- ffd2e6f -->
1124
+ - **UI:** Add sortable columns, quick filter presets and flamegraph search <!-- 5bfb511 -->
1107
1125
 
1108
1126
  ## [0.7.0] - 2026-04-05
1109
1127
 
1110
1128
  ### Added
1111
1129
 
1112
- - **Database:** Add N+1 visual detection and `EXPLAIN ANALYZE` integration <!-- a22902d -->
1130
+ - **Database:** Add N+1 visual detection and `EXPLAIN ANALYZE` integration <!-- af266fc -->
1113
1131
 
1114
1132
  ## [0.6.0] - 2026-04-05
1115
1133
 
1116
1134
  ### Added
1117
1135
 
1118
- - **MCP:** Reduce token usage with filtering, body file saving and pagination <!-- 834251d -->
1136
+ - **MCP:** Reduce token usage with filtering, body file saving and pagination <!-- fa67dc8 -->
1119
1137
 
1120
1138
  ## [0.5.0] - 2026-04-04
1121
1139
 
1122
1140
  ### Added
1123
1141
 
1124
- - **MCP:** Add outbound IDs, a domain filter, datetimes, a latest token, exceptions and copy helpers <!-- 9330545 -->
1142
+ - **MCP:** Add outbound IDs, a domain filter, datetimes, a latest token, exceptions and copy helpers <!-- b36bc24 -->
1125
1143
 
1126
1144
  ## [0.4.0] - 2026-04-03
1127
1145
 
1128
1146
  ### Added
1129
1147
 
1130
- - **Collector:** Add an I18n panel tracking translation lookups per request <!-- 3032a15 -->
1148
+ - **Collector:** Add an I18n panel tracking translation lookups per request <!-- ef4a672 -->
1131
1149
 
1132
1150
  <!-- excluded:
1133
- b50d1eb pipeline only
1151
+ ad4fea1 pipeline only
1134
1152
  -->
1135
1153
 
1136
1154
  ## [0.3.0] - 2026-04-02
1137
1155
 
1138
1156
  ### Added
1139
1157
 
1140
- - **Collector:** Add a routes panel and enrich the request collector <!-- bdf0e3c -->
1158
+ - **Collector:** Add a routes panel and enrich the request collector <!-- febed69 -->
1141
1159
 
1142
1160
  ## [0.2.0] - 2026-03-29
1143
1161
 
1144
1162
  ### Added
1145
1163
 
1146
- - **Collector:** Add a Logs panel, capturing `Rails.logger` messages per request <!-- 0e0e7ce -->
1147
- - Publish the gem to RubyGems.org <!-- f292a21 -->
1164
+ - **Collector:** Add a Logs panel, capturing `Rails.logger` messages per request <!-- 3f1d906 -->
1165
+ - Publish the gem to RubyGems.org <!-- a63e6b4 -->
1148
1166
 
1149
1167
  <!-- excluded:
1150
- 10c1314 pipeline only, despite the fix: type
1151
- 3f97b1d pipeline only
1152
- a8c2044 pipeline only
1153
- 27cc550 pipeline only
1168
+ 17feea9 pipeline only, despite the fix: type
1169
+ 86fcb3f pipeline only
1170
+ 5891bfa pipeline only
1171
+ 81150a3 pipeline only
1154
1172
  -->
1155
1173
 
1156
1174
  ## [0.1.4] - 2026-03-29
1157
1175
 
1158
1176
  ### Added
1159
1177
 
1160
- - **Profiler:** Capture the full request and response, and add an MCP history clear <!-- 9922c8a -->
1178
+ - **Profiler:** Capture the full request and response, and add an MCP history clear <!-- 7d54262 -->
1161
1179
 
1162
1180
  ## [0.1.3] - 2026-03-29
1163
1181
 
1164
1182
  ### Changed
1165
1183
 
1166
- - **Assets:** Migrate Sass `@import` to `@use`, which removes the build deprecation warnings <!-- 1a67e48 -->
1184
+ - **Assets:** Migrate Sass `@import` to `@use`, which removes the build deprecation warnings <!-- a0ac9b5 -->
1167
1185
 
1168
1186
  ## [0.1.2] - 2026-03-25
1169
1187
 
@@ -1204,7 +1222,7 @@ carries no change to the gem, so there is nothing to report for this version.
1204
1222
  - **Profiler:** Improve memory tracking and profile deserialisation <!-- a0af47e -->
1205
1223
 
1206
1224
  <!-- excluded:
1207
- e27cdae pipeline only
1225
+ d797be5 pipeline only
1208
1226
  02d63c9 pipeline only
1209
1227
  9f598d9 subject is not conventional, tooling only
1210
1228
  7d1d823 tests only
@@ -24,14 +24,32 @@ module Profiler
24
24
 
25
25
  module RunWrapper
26
26
  def run
27
+ file, line = profiler_test_location
27
28
  Profiler::TestProfiler.profile(
28
29
  test_name: "#{self.class.name}##{name}",
29
- test_file: self.class.instance_method(name).source_location&.first || "",
30
- test_line: self.class.instance_method(name).source_location&.last || 0,
30
+ test_file: file,
31
+ test_line: line,
31
32
  framework: :minitest
32
33
  ) { super }
34
+ rescue StandardError => e
35
+ # Test#run captures what the test raises, so this comes from the
36
+ # profiler. Escaping, it would stop the whole run: it fails this
37
+ # test instead, as it does an RSpec example, without running it again.
38
+ self.time ||= 0
39
+ capture_exceptions { raise e }
40
+ Minitest::Result.from(self)
41
+ end
42
+
43
+ private
44
+
45
+ # Only the lookup is guarded: rescuing around super would run the test
46
+ # again whenever anything raised a NameError after it, NoMethodError
47
+ # included.
48
+ def profiler_test_location
49
+ location = self.class.instance_method(name).source_location
50
+ [location&.first || "", location&.last || 0]
33
51
  rescue NameError
34
- super
52
+ ["", 0]
35
53
  end
36
54
  end
37
55
  end
@@ -15,19 +15,70 @@ module Profiler
15
15
  # end
16
16
  module RSpecSupport
17
17
  def self.install(config)
18
- config.around(:each) do |example|
18
+ hook = proc do |example|
19
19
  Profiler::TestProfiler.profile(
20
20
  test_name: example.full_description,
21
21
  test_file: example.file_path,
22
- test_line: example.line_number,
22
+ test_line: example.metadata[:line_number],
23
23
  framework: :rspec
24
- ) { example.run }
24
+ ) do
25
+ example.run
26
+ Outcome.new(example)
27
+ end
28
+ end
29
+
30
+ # config.around would nest this hook inside the config-level around
31
+ # hooks registered before it, among them the one RSpec registers for
32
+ # :aggregate_failures when the configuration is created. An aggregated
33
+ # failure, like one raised by such a hook after the example, is only
34
+ # set on the example once that hook has returned: the example would be
35
+ # recorded as passed. Appended, the hook wraps them all. Groups already
36
+ # defined get it the way config.around gives it to them. config.hooks
37
+ # is not public API, hence the fallback.
38
+ if config.respond_to?(:hooks) && config.hooks.respond_to?(:register)
39
+ config.hooks.register(:append, :around, :example, &hook)
40
+ RSpec.world.example_groups.each do |group|
41
+ group.hooks.register(:append, :around, :example, &hook)
42
+ end
43
+ else
44
+ config.around(:example, &hook)
25
45
  end
26
46
 
27
47
  config.after(:suite) do
28
48
  Profiler::TestHelpers::Reporter.print
29
49
  end
30
50
  end
51
+
52
+ # What the profiled block hands back to TestProfiler: the same interface as
53
+ # Minitest::Result (passed?, skipped?, failure).
54
+ #
55
+ # Procsy#run returns a boolean, and execution_result.status is still nil at
56
+ # this point: Example#finish only writes it once every around hook has
57
+ # returned. The outcome is read from the state #finish relies on, in the
58
+ # same order: an exception means failed, then a pending message (from
59
+ # `pending` or `skip` in the example) means pending.
60
+ class Outcome
61
+ Reason = Struct.new(:message)
62
+
63
+ def initialize(example)
64
+ @exception = example.exception
65
+ @pending_message = example.execution_result.pending_message
66
+ end
67
+
68
+ def passed?
69
+ @exception.nil? && @pending_message.nil?
70
+ end
71
+
72
+ def skipped?
73
+ @exception.nil? && !@pending_message.nil?
74
+ end
75
+
76
+ def failure
77
+ return @exception if @exception
78
+
79
+ Reason.new(@pending_message) if @pending_message
80
+ end
81
+ end
31
82
  end
32
83
  end
33
84
  end
@@ -67,8 +67,10 @@ module Profiler
67
67
  begin
68
68
  result = block.call
69
69
 
70
- # Minitest: Test#run catches assertion errors internally and returns self.
71
- # Failures don't propagate — detect them from the result object.
70
+ # Test frameworks catch failures themselves, so they never reach the
71
+ # rescue below. The block reports them by returning an object that
72
+ # responds to passed?, skipped? and failure: Minitest::Test#run returns
73
+ # a Minitest::Result, and RSpecSupport builds an equivalent outcome.
72
74
  if result.respond_to?(:passed?)
73
75
  unless result.passed?
74
76
  test_status = result.skipped? ? "pending" : "failed"
@@ -81,17 +83,6 @@ module Profiler
81
83
  )
82
84
  end
83
85
 
84
- # RSpec: example.run catches errors internally and stores them in execution_result.
85
- if result.respond_to?(:execution_result)
86
- er = result.execution_result
87
- rspec_status = er.status&.to_s
88
- if rspec_status && rspec_status != "passed" && test_status == "passed"
89
- test_status = rspec_status
90
- msg = er.exception&.message.to_s
91
- error_message = msg.empty? ? nil : msg
92
- end
93
- end
94
-
95
86
  result
96
87
  rescue Exception => e # rubocop:disable Lint/RescueException
97
88
  # Capture all exceptions (including test failures which may subclass Exception)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Profiler
4
- VERSION = "0.32.1"
4
+ VERSION = "0.32.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.1
4
+ version: 0.32.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Duplessy