grntest 1.6.3 → 1.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aa40165815d080049dd1910a6e417d10c669225e5b151882192181f830e24347
4
- data.tar.gz: d4c4f85b34059a6d8f4c5ed66e4bc60e7294253dcfd8a0f1fc1dbecb42684912
3
+ metadata.gz: 8698dc27823fe6b4865c631af65ba6f8cb5393c17c3dffe688d562aa1217941e
4
+ data.tar.gz: 3ef417fad36461099a6c2b2715aca265e7e8d7a5b71e9e418a5de701f3a5652a
5
5
  SHA512:
6
- metadata.gz: 595dda68c29ddd69b0cdb5b76c96c3471c811e23d1a0f3a13622d5341ad463db65d0d71a21556675d22e56dc087b167fea64f61886abd9e62d0745a8cf157e13
7
- data.tar.gz: bbdf5697336b6e0a7963e7d6b399624829fd3184bf5971c056292a9ac7f9197e28093c980c231772f323e2f072be9a3ceee87021a22d559ee59ffbe4eac3e80a
6
+ metadata.gz: dd789d02b42adc35269d73590ac50922220dc33740ffa4f36ab9efefec02cfad7f40152e19fb2ca305d8a37b594b94cc4dfdfb72b9e8363fb363e45bf5214ed6
7
+ data.tar.gz: 35cf29b8cc1ea65ff15ee25fccde7155aab203522e89e8e89955101e3428c7c5bdb036ee1dc8e2a27699eaa7b0dd3642dc33fd8fdcf43be74d5672e429363772
data/doc/text/news.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # News
2
2
 
3
+ ## 1.6.5: 2023-10-24
4
+
5
+ ### Improvements
6
+
7
+ * Added support for trace log.
8
+
9
+ ## 1.6.4: 2023-10-21
10
+
11
+ ### Improvements
12
+
13
+ * arrow: Added support for metadata normalization.
14
+
3
15
  ## 1.6.3: 2023-09-18
4
16
 
5
17
  ### Improvements
@@ -664,6 +664,10 @@ http {
664
664
  "header" => normalize_header(response["header"]),
665
665
  "body" => normalize_body(response["body"]),
666
666
  })
667
+ if normalized_response.key?("trace_log")
668
+ normalized_response["trace_log"] =
669
+ normalize_trace_log(normalized_response["trace_log"])
670
+ end
667
671
  else
668
672
  header, *values = response
669
673
  normalized_header = normalize_header(header)
@@ -704,33 +708,57 @@ http {
704
708
  normalized << schema.to_s
705
709
  end
706
710
  normalized << "\n"
707
- if apache_arrow_metadata?(schema)
708
- normalized_records = table.each_record.collect do |record|
709
- normalized_record = []
710
- record.to_h.each do |name, value|
711
- case name
712
- when "start_time", "elapsed_time"
713
- value = 0
714
- end
715
- normalized_record << value
716
- end
717
- normalized_record
718
- end
719
- noramlized_table = Arrow::Table.new(schema, normalized_records)
720
- normalized << noramlized_table.to_s
711
+ case (schema.metadata || {})["GROONGA:data_type"]
712
+ when "metadata"
713
+ normalized_table = normalize_apache_arrow_content_metadata(table)
714
+ normalized << normalized_table.to_s
715
+ when "trace_log"
716
+ normalized_table = normalize_apache_arrow_content_trace_log(table)
717
+ normalized << normalized_table.to_s
721
718
  else
722
719
  normalized << table.to_s
723
720
  end
724
721
  end
725
722
  end
726
- normalized
723
+ normalize_raw_content(normalized)
724
+ end
725
+
726
+ def normalize_apache_arrow_content_metadata(table)
727
+ normalized_records = table.each_record.collect do |record|
728
+ normalized_record = []
729
+ record.to_h.each do |name, value|
730
+ case name
731
+ when "start_time", "elapsed_time"
732
+ value = 0
733
+ when "error_message"
734
+ value = normalize_error_message(value) if value
735
+ when "error_file"
736
+ value = normalize_error_file_path(value) if value
737
+ when "error_line"
738
+ value = 0 if value
739
+ when "error_function"
740
+ value = normalize_error_function(value) if value
741
+ end
742
+ normalized_record << value
743
+ end
744
+ normalized_record
745
+ end
746
+ Arrow::Table.new(table.schema, normalized_records)
727
747
  end
728
748
 
729
- def apache_arrow_metadata?(schema)
730
- # TODO: Use schema.metadata with gobject-introspection 3.4.2 and
731
- # Red Arrow 0.17.0.
732
- schema.fields.collect(&:name) ==
733
- ["return_code", "start_time", "elapsed_time"]
749
+ def normalize_apache_arrow_content_trace_log(table)
750
+ normalized_columns = table.columns.collect do |column|
751
+ case column.name
752
+ when "elapsed_time"
753
+ normalized_elapsed_times =
754
+ column.data_type.build_array(column.n_rows.times.to_a)
755
+ Arrow::Column.new(Arrow::Table.new(elapsed_time: normalized_elapsed_times),
756
+ 0)
757
+ else
758
+ column
759
+ end
760
+ end
761
+ Arrow::Table.new(table.schema, normalized_columns)
734
762
  end
735
763
 
736
764
  def normalize_output_xml(content, options)
@@ -826,6 +854,20 @@ http {
826
854
  end
827
855
  end
828
856
 
857
+ def normalize_trace_log(trace_log)
858
+ if trace_log["logs"]
859
+ elapsed_time_index = trace_log["columns"].index do |column|
860
+ column["name"] == "elapsed_time"
861
+ end
862
+ normalized_elapsed_time = 0
863
+ trace_log["logs"].each do |log|
864
+ log[elapsed_time_index] = normalized_elapsed_time
865
+ normalized_elapsed_time += 1
866
+ end
867
+ end
868
+ trace_log
869
+ end
870
+
829
871
  def normalize_error(content)
830
872
  content = normalize_error_message(content)
831
873
  normalize_raw_content(content)
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Grntest
17
- VERSION = "1.6.3"
17
+ VERSION = "1.6.5"
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grntest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.3
4
+ version: 1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-18 00:00:00.000000000 Z
12
+ date: 2023-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs