mirror of
https://github.com/gorules/zen.git
synced 2026-11-30 00:07:34 +00:00
feat: engine version (#574)
* feat(engine): select the engine with a version option * ci: run the two feature sets as parallel jobs * refactor(engine): drop the global compiled switch * feat(engine): pin the clock through options instead of the environment The __ZEN_MOCK_UTC_TIME variable and the ZEN_EXPRESSION_CONFIG lane flag are gone. Isolate takes with_now and with_lane, and the interpreted engine now honours the now option in expressions, so tests pass the instant explicitly. * test(engine): count trace paths per thread and drop the trace test lock * ci: run tests with nextest * test(engine): share golden trace outcomes between variants
This commit is contained in:
@@ -6,7 +6,7 @@ import os
|
||||
|
||||
import zen
|
||||
|
||||
os.environ['__ZEN_MOCK_UTC_TIME'] = '2025-08-19T16:55:02.078Z'
|
||||
NOW = "2025-08-19T16:55:02.078Z"
|
||||
|
||||
def loader(key):
|
||||
with open("../../test-data/" + key, "r") as f:
|
||||
@@ -165,9 +165,9 @@ class ZenEngine(unittest.TestCase):
|
||||
for test_case in json_contents["tests"]:
|
||||
key = os.path.basename(json_file)
|
||||
|
||||
engine_response = engine.evaluate(key, test_case["input"])
|
||||
engine_response = engine.evaluate(key, test_case["input"], {"now": NOW})
|
||||
decision = engine.get_decision(key)
|
||||
decision_response = decision.evaluate(test_case["input"])
|
||||
decision_response = decision.evaluate(test_case["input"], {"now": NOW})
|
||||
|
||||
self.assertEqual(engine_response["result"], test_case["output"], key)
|
||||
self.assertEqual(decision_response["result"], test_case["output"], key)
|
||||
|
||||
Reference in New Issue
Block a user