chaotic_job 0.9.2 → 0.10.1
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/CHANGELOG.md +9 -0
- data/lib/chaotic_job/simulation.rb +7 -2
- data/lib/chaotic_job/switch.rb +25 -0
- data/lib/chaotic_job/version.rb +1 -1
- data/lib/chaotic_job.rb +17 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 304867076ba4ade8191d2802075fadc2a2bfe83c35bdf3af8217b35b3097fc2d
|
4
|
+
data.tar.gz: 0a5ca5c1df4253011f0b9894f92424deb85262646eae89d40fd5c293ae6b8263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6877fdc030d30b9c53486a8d60f8be9d70dca9c3327e53f080e58a6dc73c6ca067f4ff91cb50f7de8e1b0812dddcbde5a5fafc37b8a5732d2e3119d614525044
|
7
|
+
data.tar.gz: 772b32d2e2d444cd0d9b1da623a3049071234b6548aab13eac409d15abccee8a49c476211e84d9e774ea6a6bf4a2675af1c4a991ce35e05e49cf6af658bc55ff
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.10.1] - 2025-06-18
|
4
|
+
|
5
|
+
- Add more switch methods [#19](https://github.com/fractaledmind/chaotic_job/pull/19)
|
6
|
+
|
7
|
+
## [0.10.0] - 2025-06-18
|
8
|
+
|
9
|
+
- Run the assertions block within the scenario run to ensure the glitch is executed [#17](https://github.com/fractaledmind/chaotic_job/pull/17)
|
10
|
+
- Add a Switch class to allow tests to control a binary switch [#18](https://github.com/fractaledmind/chaotic_job/pull/18)
|
11
|
+
|
3
12
|
## [0.9.2] - 2025-06-17
|
4
13
|
|
5
14
|
- Allow option to constrain which jobs are performed for a `Simulation` [#16](https://github.com/fractaledmind/chaotic_job/pull/16)
|
@@ -65,14 +65,19 @@ module ChaoticJob
|
|
65
65
|
debug "👾 Running simulation with scenario: #{scenario}"
|
66
66
|
@test.before_setup
|
67
67
|
@test.simulation_scenario = scenario
|
68
|
+
|
68
69
|
if @perform_only_jobs_within
|
69
|
-
scenario.run
|
70
|
+
scenario.run do
|
71
|
+
Performer.perform_all_before(@perform_only_jobs_within)
|
72
|
+
assertions.call(scenario)
|
73
|
+
end
|
70
74
|
else
|
71
75
|
scenario.run
|
76
|
+
assertions.call(scenario)
|
72
77
|
end
|
78
|
+
|
73
79
|
@test.after_teardown
|
74
80
|
@test.assert scenario.glitched?, "Scenario did not execute glitch: #{scenario.glitch}"
|
75
|
-
assertions.call(scenario)
|
76
81
|
ensure
|
77
82
|
@test.simulation_scenario = nil
|
78
83
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ChaoticJob
|
4
|
+
module Switch
|
5
|
+
extend self
|
6
|
+
|
7
|
+
def on?
|
8
|
+
@value ||= false
|
9
|
+
true == @value
|
10
|
+
end
|
11
|
+
|
12
|
+
def off?
|
13
|
+
@value ||= false
|
14
|
+
false == @value
|
15
|
+
end
|
16
|
+
|
17
|
+
def on!
|
18
|
+
@value = true
|
19
|
+
end
|
20
|
+
|
21
|
+
def off!
|
22
|
+
@value = false
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/chaotic_job/version.rb
CHANGED
data/lib/chaotic_job.rb
CHANGED
@@ -7,6 +7,7 @@ require_relative "chaotic_job/tracer"
|
|
7
7
|
require_relative "chaotic_job/glitch"
|
8
8
|
require_relative "chaotic_job/scenario"
|
9
9
|
require_relative "chaotic_job/simulation"
|
10
|
+
require_relative "chaotic_job/switch"
|
10
11
|
require "set"
|
11
12
|
|
12
13
|
module ChaoticJob
|
@@ -62,6 +63,22 @@ module ChaoticJob
|
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
66
|
+
def self.switch_on?
|
67
|
+
Switch.on?
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.switch_off?
|
71
|
+
Switch.off?
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.switch_on!
|
75
|
+
Switch.on!
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.switch_off!
|
79
|
+
Switch.off!
|
80
|
+
end
|
81
|
+
|
65
82
|
module Helpers
|
66
83
|
attr_accessor :simulation_scenario
|
67
84
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chaotic_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Margheim
|
@@ -41,6 +41,7 @@ files:
|
|
41
41
|
- lib/chaotic_job/performer.rb
|
42
42
|
- lib/chaotic_job/scenario.rb
|
43
43
|
- lib/chaotic_job/simulation.rb
|
44
|
+
- lib/chaotic_job/switch.rb
|
44
45
|
- lib/chaotic_job/tracer.rb
|
45
46
|
- lib/chaotic_job/version.rb
|
46
47
|
- sig/chaotic_job.rbs
|