diff_test 0.8.11 → 0.8.12

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: d36a2feba28342c37ee92d44d615a9466f17824cffc14992c4031901d3035c2b
4
- data.tar.gz: 75996211c6e3f6ba9942c201e3c12ec5b2c0031ebbb4052e11a82ebf3b7a2307
3
+ metadata.gz: 572fb4d96758c15f33fb86d759208c20707bc041e86bd41846ad3fb25e7878bc
4
+ data.tar.gz: 58be1a6c50f15d51ee35c867f9f82351e027f11391e80a00236a72084935c64d
5
5
  SHA512:
6
- metadata.gz: 54fed90750ebe5ab28d7cf81568401f5db7db5b9fd341538eef0f23403255cf1891c3a3795696d207c59b15fbb5f6b965063a8c5a5d968e54722e36b48b66fba
7
- data.tar.gz: bfd6d8d252b80a9769465e6879c36d91613c3998fa9f0f71d0fbfcde5c79a83e9da9fb40a392a74bf572eaf0fe1b6f3d73a39ab9c7ffc7dcd196b9cce95dc60c
6
+ metadata.gz: 3d127f58c88c7e5d05a0af258fda8f1e553f98f2e17c1ca7b5d079f620a769211ca62b5e0e6d9ac1fbb0a44624f3af7c2c2bda947d6cbd8a072d55edf802584e
7
+ data.tar.gz: 296d9ddcff60b4958d90ecdd4f7acf1b7402af66fd4f73c23d392efe22dc4ab3bb2f721bb1c404619f91b69889e4a5ad4fe0b2295d77fdd545b586fe0c00a7c7
data/README.md CHANGED
@@ -256,3 +256,19 @@ method_added/const_added
256
256
 
257
257
 
258
258
  # WRITE test for it setting time from previous successful run
259
+
260
+
261
+
262
+ # Perf improvements
263
+
264
+ # TestExecution
265
+ # - New Test table (just for test name)
266
+ # - Drop updated_at
267
+ # - impacted_file_hash becomes integer
268
+
269
+ # ImpactedFile
270
+ - add file_path and file_hash
271
+
272
+ # TestExecutionImpactedFile
273
+ - Store file hash with impacted file
274
+ - TestExecutionImpactedFile then just belongs to test execution and impacted_file
@@ -11,7 +11,7 @@ module DiffTest
11
11
  content = DiffTest::Integrations::RailsJs::Annotator.unannotate(content)
12
12
 
13
13
  @cache ||= {}
14
- @cache[file_path] = XXhash.xxh64(content).to_s
14
+ @cache[file_path] = XXhash.xxh32(content).to_s
15
15
  end
16
16
 
17
17
  def self.compute_relative(file_path)
@@ -76,7 +76,7 @@ module DiffTest
76
76
  end
77
77
 
78
78
  def log(message)
79
- puts "DiffTest #{Time.current.strftime('%H:%M:%S')}: #{message}"
79
+ puts "DiffTest #{Time.current.strftime('%H:%M:%S')}: #{message}" if ENV['DIFF_TEST_LOG']
80
80
  end
81
81
  end
82
82
  end
@@ -4,16 +4,6 @@ module DiffTest
4
4
  module Lifecycle
5
5
  def self.included(base)
6
6
  base.prepend(InstanceMethods)
7
-
8
- require 'get_process_mem'
9
- Thread.new do
10
- mem = GetProcessMem.new
11
- loop do
12
- # `mem.mb` returns the resident set size as a Float in megabytes
13
- DiffTest::Helper.log("Memory: #{format('%8.2f MB', mem.mb)}")
14
- sleep 1
15
- end
16
- end
17
7
  end
18
8
 
19
9
  module InstanceMethods
@@ -34,7 +34,7 @@ module DiffTest
34
34
  insert_at_first_non_comment_line_str(content, annotation)
35
35
  end
36
36
 
37
- UNANNOTATE_REGEX = /(\/\/|#) Automatically added by DiffTest.*?(\/\/|#) Automatically added by DiffTest\n\n?/m
37
+ UNANNOTATE_REGEX = /(\/\/|#) Automatically added by DiffTest.*?(\/\/|#) Automatically added by DiffTest\n/m
38
38
  def self.unannotate(content)
39
39
  content.gsub!(UNANNOTATE_REGEX, '')
40
40
  content
@@ -45,7 +45,7 @@ module DiffTest
45
45
  end
46
46
 
47
47
  def self.insert_at_first_non_comment_line_str(content, text_to_insert)
48
- lines = content.lines.map(&:chomp)
48
+ lines = content.lines
49
49
 
50
50
  in_multiline_comment = false
51
51
  comment_type = nil
@@ -97,7 +97,7 @@ module DiffTest
97
97
  new_lines = lines.dup
98
98
  new_lines.insert(insert_index, text_to_insert)
99
99
 
100
- new_lines.join("\n")
100
+ new_lines.join
101
101
  end
102
102
  end
103
103
  end
@@ -18,7 +18,7 @@ module DiffTest
18
18
  has_previous_execution_with_no_impacted_changes = previous_test_executions.any? do |previous_test_execution|
19
19
  hashes_match = previous_test_execution['test_execution_impacted_files'].all? do |test_execution_impacted_file|
20
20
  impacted_file_id = test_execution_impacted_file['impacted_file_id'].to_s
21
- file_hash = test_execution_impacted_file['file_hash']
21
+ file_hash = test_execution_impacted_file['file_hash'].to_s
22
22
  impacted_file_path = @impacted_file_path_by_id[impacted_file_id]
23
23
 
24
24
  DiffTest::FileHashComputer.compute_relative(impacted_file_path) == file_hash
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DiffTest
4
- VERSION = "0.8.11"
4
+ VERSION = "0.8.12"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diff_test
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.11
4
+ version: 0.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owais
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-10 00:00:00.000000000 Z
11
+ date: 2025-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty