diff_test 0.8.8 → 0.8.9
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 +4 -4
- data/README.md +0 -3
- data/lib/diff_test/integrations/minitest/lifecycle.rb +5 -4
- data/lib/diff_test/integrations/rails_js/processing_skip_analyzer.rb +1 -1
- data/lib/diff_test/should_run_decider.rb +3 -11
- data/lib/diff_test/test_execution.rb +3 -18
- data/lib/diff_test/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0eb6d31f88ec71845c1da318d944b46bcb0d7c6b550b0bb9c936a4236cd4e802
|
4
|
+
data.tar.gz: 879e45fa217f327c095c4f1bccac3d7308df661a3735ba3a549cdc8550c4360c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d935e9d4ebce09151f96d998b9aa7cfcd4adc3f8a5e45622b29e1e57a093184b39e98321392eab581b37c2a7b51f8927bbb99fb4df447896ced3f3e409868b3f
|
7
|
+
data.tar.gz: cf82343110711249ec65a56486a559ae899614e886f49faceea1c35020abc58758f438a87969db609f866171abe5228421e7e23f12fcd9170689cbe1c8e40580
|
data/README.md
CHANGED
@@ -55,7 +55,7 @@ module DiffTest
|
|
55
55
|
test_name = self.name
|
56
56
|
|
57
57
|
DiffTest::TestExecution.current = execution = DiffTest::TestExecution.new(test_file_path:, test_name:)
|
58
|
-
should_run =
|
58
|
+
should_run = DiffTest::ShouldRunDecider.should_run?(execution.id, system_test: true)
|
59
59
|
DiffTest::TestSuiteExecution.current.ensure_application_eager_loaded! if should_run
|
60
60
|
rescue => e
|
61
61
|
DiffTest.error("An error ocurred while trying to create a test execution. Please report this issue.\nException: #{e}")
|
@@ -67,10 +67,11 @@ module DiffTest
|
|
67
67
|
super
|
68
68
|
else
|
69
69
|
# Skip raises an exception too, which is handled by `capture_exception`
|
70
|
-
|
71
|
-
|
70
|
+
time_it do
|
71
|
+
capture_exceptions do
|
72
|
+
skip("Impacted files have not changed. Skipping...")
|
73
|
+
end
|
72
74
|
end
|
73
|
-
self.time = execution.previous_runtime_s
|
74
75
|
::Minitest::Result.from(self)
|
75
76
|
end
|
76
77
|
ensure
|
@@ -8,10 +8,9 @@ module DiffTest
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def should_run?(test_id, system_test:)
|
11
|
-
return
|
11
|
+
return true unless @test_executions_by_test
|
12
12
|
|
13
13
|
previous_test_executions = @test_executions_by_test[test_id] || []
|
14
|
-
previous_runtime_ms = nil
|
15
14
|
|
16
15
|
# If there are any previous test executions run whose impacted files are the same as now
|
17
16
|
# Assume its safe to skip
|
@@ -24,8 +23,6 @@ module DiffTest
|
|
24
23
|
DiffTest::FileHashComputer.compute_relative(impacted_file_path) == file_hash
|
25
24
|
end
|
26
25
|
next false unless hashes_match
|
27
|
-
|
28
|
-
previous_runtime_ms = previous_test_execution['runtime_ms']
|
29
26
|
next true unless system_test
|
30
27
|
|
31
28
|
test_suite_execution = @test_suite_executions_by_id[previous_test_execution['test_suite_execution_id'].to_s]
|
@@ -35,13 +32,8 @@ module DiffTest
|
|
35
32
|
false
|
36
33
|
end
|
37
34
|
|
38
|
-
return
|
39
|
-
|
40
|
-
should_run = !has_previous_execution_with_no_impacted_changes
|
41
|
-
{
|
42
|
-
should_run:,
|
43
|
-
previous_runtime_ms:,
|
44
|
-
}
|
35
|
+
return true if ENV['DIFF_TEST_ALWAYS_RUN'] == '1'
|
36
|
+
!has_previous_execution_with_no_impacted_changes
|
45
37
|
end
|
46
38
|
|
47
39
|
def self.current
|
@@ -13,16 +13,9 @@ module DiffTest
|
|
13
13
|
self.class.set(id, self)
|
14
14
|
end
|
15
15
|
|
16
|
-
def should_run_decider_result
|
17
|
-
@should_run_decider_result ||= DiffTest::ShouldRunDecider.should_run?(id, system_test: system_test?)
|
18
|
-
end
|
19
|
-
|
20
16
|
def should_run?
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
def previous_runtime_s
|
25
|
-
(should_run_decider_result[:previous_runtime_ms] / 1000.0) if should_run_decider_result[:previous_runtime_ms]
|
17
|
+
return @should_run unless @should_run.nil?
|
18
|
+
@should_run = DiffTest::ShouldRunDecider.should_run?(id, system_test: system_test?)
|
26
19
|
end
|
27
20
|
|
28
21
|
def save_payload
|
@@ -30,7 +23,7 @@ module DiffTest
|
|
30
23
|
test: id,
|
31
24
|
result: @result,
|
32
25
|
runtime_ms: runtime_ms,
|
33
|
-
impacted_files: (@impacted_file_tracker.save_payload if
|
26
|
+
impacted_files: (@impacted_file_tracker.save_payload if passed?),
|
34
27
|
}.compact
|
35
28
|
end
|
36
29
|
|
@@ -73,14 +66,6 @@ module DiffTest
|
|
73
66
|
@result == :passed
|
74
67
|
end
|
75
68
|
|
76
|
-
def skipped?
|
77
|
-
@result == :skipped
|
78
|
-
end
|
79
|
-
|
80
|
-
def successful?
|
81
|
-
passed? || skipped?
|
82
|
-
end
|
83
|
-
|
84
69
|
def runtime_ms
|
85
70
|
return 0 if @stopped_at.nil? || @started_at.nil?
|
86
71
|
(@stopped_at - @started_at) * 1000
|
data/lib/diff_test/version.rb
CHANGED
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.
|
4
|
+
version: 0.8.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Owais
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|