P08-03: 配置の通常操作受入
This commit is contained in:
Vendored
+8
-8
@@ -343,7 +343,7 @@ func inspect_formal() -> Dictionary:
|
||||
capture_model("formal-model", formal)
|
||||
return formal
|
||||
|
||||
func verify_operation(formal: Dictionary, result: Dictionary, event_type: StringName) -> void:
|
||||
func verify_operation(formal: Dictionary, result: Dictionary, event_type: StringName, prefix: String = "") -> void:
|
||||
var expected := formal.duplicate(true)
|
||||
var model: Dictionary = expected[&"systems"][&"runtime"]
|
||||
var counters: Dictionary = model[&"id_generator"]["counters"]
|
||||
@@ -379,20 +379,20 @@ func verify_operation(formal: Dictionary, result: Dictionary, event_type: String
|
||||
stream["recent_events"].append(notification.to_dictionary())
|
||||
if stream["recent_events"].size() > DomainEventStream.RECENT_EVENT_LIMIT:
|
||||
stream["recent_events"].pop_front()
|
||||
capture_model("expected-operation", expected)
|
||||
capture("operation-actual")
|
||||
var actual: Dictionary = bytes_to_var(FileAccess.get_file_as_bytes(directory.path_join(role + "-checkpoint.var")))
|
||||
json_file(role + "-operation-comparison.json", {
|
||||
capture_model(prefix + "expected-operation", expected)
|
||||
capture(prefix + "operation-actual")
|
||||
var actual: Dictionary = bytes_to_var(FileAccess.get_file_as_bytes(directory.path_join(role + "-" + prefix + "checkpoint.var")))
|
||||
json_file(role + "-" + prefix + "operation-comparison.json", {
|
||||
"pid": OS.get_process_id(), "delta_kind": "source_defined_notification",
|
||||
"formal_model": role + "-formal-model", "actual_model": role + "-checkpoint",
|
||||
"expected_model": role + "-expected-operation", "returned_result": Codec.new().typed(result),
|
||||
"formal_model": role + "-" + prefix + "formal-model", "actual_model": role + "-" + prefix + "checkpoint",
|
||||
"expected_model": role + "-" + prefix + "expected-operation", "returned_result": Codec.new().typed(result),
|
||||
"saved_recent_count": formal[&"systems"][&"runtime"][&"domain_events"]["recent_events"].size(),
|
||||
"expected_recent_count": stream["recent_events"].size(),
|
||||
"actual_recent_count": actual[&"systems"][&"runtime"][&"domain_events"]["recent_events"].size(),
|
||||
"whole_raw_equal": var_to_bytes(expected) == var_to_bytes(actual),
|
||||
})
|
||||
# Complete raw actual/expected snapshots remain available on unknown drift.
|
||||
expect(var_to_bytes(expected) == var_to_bytes(actual), "whole source-defined save operation model; see " + role + "-operation-comparison.json")
|
||||
expect(var_to_bytes(expected) == var_to_bytes(actual), "whole source-defined save operation model; see " + role + "-" + prefix + "operation-comparison.json")
|
||||
expect(var_to_bytes(actual) == var_to_bytes(runtime.create_snapshot()), "read-only inspection preserves live model")
|
||||
|
||||
func record_save_operation(result: Dictionary) -> void:
|
||||
|
||||
Reference in New Issue
Block a user