grntest 1.6.4 → 1.6.6

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: 5ce455333ded86e81b262c5bb46ffd1d712b08a6d15135aa18f39a52e2258f6e
4
- data.tar.gz: 26324018775c7543a54d3caeac5ff782799182c76fb591e9cf50ad0532e33340
3
+ metadata.gz: cb9c21dbf97a69dcd226668ff67f8443bf8ab3e57559137c78180ec07c85a147
4
+ data.tar.gz: 5aa1f037756aa689fff0e5d665fe747ed65d9b2a9f0953015feca997b460a300
5
5
  SHA512:
6
- metadata.gz: 3869551fa9869d793f80dca800ca9fb6396a2c26abd0cd414eec6dbd79456dbbffc305732fc53cb55b1ae7f424bf9602d5ffec6d2a28a827d9be14bfd6ee8c59
7
- data.tar.gz: 6ec7b1118ffd8e70f3d044b10a5f3704b2c5811cda23da8eab23c8df37356b35fb1a4e6b994958705035dcb01afbbff46f5ba83840fd64172bdbea807b42b6e9
6
+ metadata.gz: eb052fcb4fd03ca1b757cb4fe96f341e9214efd522f8269463267f1be16a6556f1a489e4c1fca6c94934eceff00cdd03002f32e83e6595d4ca4ae941b61ca6d2
7
+ data.tar.gz: 838ca099c5ea3db31f6754f4b78ec6c5d76de23fe1fd184a5579b0e4eeba399d32c779e4057dc7a6571aa6e011bcbf538b30b25ba2c50191cf278c5495430d12
data/doc/text/news.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # News
2
2
 
3
+ ## 1.6.6: 2023-10-24
4
+
5
+ ### Improvements
6
+
7
+ * arrow: Removed a needless new line.
8
+
9
+ ## 1.6.5: 2023-10-24
10
+
11
+ ### Improvements
12
+
13
+ * Added support for trace log.
14
+
3
15
  ## 1.6.4: 2023-10-21
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,40 +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
- when "error_message"
715
- value = normalize_error_message(value) if value
716
- when "error_file"
717
- value = normalize_error_file_path(value) if value
718
- when "error_line"
719
- value = 0 if value
720
- when "error_function"
721
- value = normalize_error_function(value) if value
722
- end
723
- normalized_record << value
724
- end
725
- normalized_record
726
- end
727
- noramlized_table = Arrow::Table.new(schema, normalized_records)
728
- 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
729
718
  else
730
719
  normalized << table.to_s
731
720
  end
732
721
  end
733
722
  end
734
- normalized
723
+ normalize_raw_content(normalized.chomp)
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)
735
747
  end
736
748
 
737
- def apache_arrow_metadata?(schema)
738
- metadata = schema.metadata
739
- return false if metadata.nil?
740
- metadata["GROONGA:data_type"] == "metadata"
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)
741
762
  end
742
763
 
743
764
  def normalize_output_xml(content, options)
@@ -833,6 +854,20 @@ http {
833
854
  end
834
855
  end
835
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
+
836
871
  def normalize_error(content)
837
872
  content = normalize_error_message(content)
838
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.4"
17
+ VERSION = "1.6.6"
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.4
4
+ version: 1.6.6
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-10-20 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