rusticai-testing 0.0.4__tar.gz → 0.1.0__tar.gz
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.
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/PKG-INFO +2 -2
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/pyproject.toml +2 -2
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/agent_ext/base_test_kvstore.py +3 -2
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/execution/base_test_integration.py +10 -7
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/messaging/base_test_messaging.py +6 -6
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/README.md +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/__init__.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/agent_ext/__init__.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/agents/__init__.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/agents/sample_agents.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/agents/simple_agent.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/execution/__init__.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/execution/integration_agents.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/helpers.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/messaging/__init__.py +0 -0
- {rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/messaging/base_test_backend.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: rusticai-testing
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: Test Utilities for Rustic AI Framework
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: Dragonscale Industries Inc.
|
|
@@ -10,7 +10,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
12
|
Requires-Dist: pytest (>=8.3.5,<9.0.0)
|
|
13
|
-
Requires-Dist: rusticai-core (>=0.0
|
|
13
|
+
Requires-Dist: rusticai-core (>=0.1.0,<0.2.0)
|
|
14
14
|
Project-URL: Homepage, https://www.rustic.ai/
|
|
15
15
|
Project-URL: Repository, https://github.com/rustic-ai/rustic-ai
|
|
16
16
|
Project-URL: Rustic AI Core, https://pypi.org/project/rusticai-core/
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "rusticai-testing"
|
|
7
|
-
version = "0.0
|
|
7
|
+
version = "0.1.0"
|
|
8
8
|
description = "Test Utilities for Rustic AI Framework"
|
|
9
9
|
authors = ["Dragonscale Industries Inc. <dev@dragonscale.ai>"]
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -18,7 +18,7 @@ packages = [{ include = "rustic_ai", from = "src" }]
|
|
|
18
18
|
|
|
19
19
|
[tool.poetry.dependencies]
|
|
20
20
|
python = ">=3.12,<3.13"
|
|
21
|
-
rusticai-core = { version = "0.0
|
|
21
|
+
rusticai-core = { version = "0.1.0"}
|
|
22
22
|
pytest = "^8.3.5"
|
|
23
23
|
|
|
24
24
|
[tool.poetry-monorepo.deps]
|
|
@@ -181,7 +181,7 @@ class BaseTestKVStore(ABC):
|
|
|
181
181
|
"""
|
|
182
182
|
raise NotImplementedError("This fixture should be overridden in subclasses.")
|
|
183
183
|
|
|
184
|
-
def test_kvstore(self, probe_agent: ProbeAgent, dep_map: dict):
|
|
184
|
+
def test_kvstore(self, probe_agent: ProbeAgent, dep_map: dict, org_id):
|
|
185
185
|
agent_spec: AgentSpec = (
|
|
186
186
|
AgentBuilder(KVStoreAgent).set_description("KV Store Agent").set_name("KVStoreAgent").build_spec()
|
|
187
187
|
)
|
|
@@ -191,7 +191,7 @@ class BaseTestKVStore(ABC):
|
|
|
191
191
|
.add_agent_spec(agent_spec)
|
|
192
192
|
.set_dependency_map(dep_map)
|
|
193
193
|
)
|
|
194
|
-
guild = guild_builder.launch()
|
|
194
|
+
guild = guild_builder.launch(organization_id=org_id)
|
|
195
195
|
|
|
196
196
|
if "kvstore" in dep_map:
|
|
197
197
|
guild.dependency_map["kvstore"].class_name = dep_map["kvstore"].class_name
|
|
@@ -278,6 +278,7 @@ class BaseTestKVStore(ABC):
|
|
|
278
278
|
format=KVGet,
|
|
279
279
|
)
|
|
280
280
|
|
|
281
|
+
time.sleep(0.05)
|
|
281
282
|
messages = probe_agent.get_messages()
|
|
282
283
|
|
|
283
284
|
assert len(messages) == 3
|
|
@@ -28,16 +28,17 @@ class IntegrationTestABC(ABC):
|
|
|
28
28
|
|
|
29
29
|
@pytest.fixture
|
|
30
30
|
def wait_time(self) -> float:
|
|
31
|
-
return 0.
|
|
31
|
+
return 0.1
|
|
32
32
|
|
|
33
33
|
@pytest.fixture
|
|
34
|
-
def guild(self, wait_time, messaging, execution_engine, guild_id):
|
|
34
|
+
def guild(self, wait_time, messaging, execution_engine, guild_id, org_id):
|
|
35
35
|
guild = Guild(
|
|
36
36
|
id=guild_id,
|
|
37
37
|
name="Test Guild",
|
|
38
38
|
description="A guild for integration testing",
|
|
39
39
|
messaging_config=messaging,
|
|
40
40
|
execution_engine_clz=execution_engine,
|
|
41
|
+
organization_id=org_id,
|
|
41
42
|
)
|
|
42
43
|
yield guild
|
|
43
44
|
time.sleep(wait_time * 5) # Allow some time for cleanup
|
|
@@ -103,16 +104,18 @@ class IntegrationTestABC(ABC):
|
|
|
103
104
|
rair = execution_engine.is_agent_running(guild.id, ra[0].id)
|
|
104
105
|
assert rair is True
|
|
105
106
|
|
|
106
|
-
local_exec_engine = SyncExecutionEngine(guild_id=guild.id)
|
|
107
|
+
local_exec_engine = SyncExecutionEngine(guild_id=guild.id, organization_id=guild.organization_id)
|
|
107
108
|
guild._add_local_agent(local_test_agent, local_exec_engine)
|
|
108
109
|
|
|
109
|
-
time
|
|
110
|
+
# Give more time for all agents to initialize fully, especially for Ray/distributed execution
|
|
111
|
+
time.sleep(max(wait_time * 10, 1.0))
|
|
112
|
+
|
|
110
113
|
# Initiator sends a message to trigger communication
|
|
111
114
|
local_test_agent.publish_initial_message()
|
|
112
115
|
|
|
113
|
-
# Allow
|
|
116
|
+
# Allow more time for message processing in distributed scenarios
|
|
114
117
|
# Consider using a more sophisticated synchronization mechanism for real-world scenarios
|
|
115
|
-
time.sleep(
|
|
118
|
+
time.sleep(max(wait_time * 30, 3.0))
|
|
116
119
|
|
|
117
120
|
# Assertions to verify communication flow
|
|
118
121
|
# Ensure the local test agent captured the messages as expected
|
|
@@ -154,7 +157,7 @@ class IntegrationTestABC(ABC):
|
|
|
154
157
|
# Send a new message to ensure that the responder agent is no longer processing messages
|
|
155
158
|
local_test_agent.publish_initial_message()
|
|
156
159
|
|
|
157
|
-
time.sleep(
|
|
160
|
+
time.sleep(max(wait_time * 30, 3.0))
|
|
158
161
|
|
|
159
162
|
# Ensure that the responder agent did not process the message
|
|
160
163
|
assert len(local_test_agent.captured_messages) == 1
|
|
@@ -140,7 +140,7 @@ class BaseTestMessagingABC(ABC):
|
|
|
140
140
|
message_id = generator.get_id(Priority.NORMAL)
|
|
141
141
|
sender.send_message("topic1", MessageConstants.RAW_JSON_FORMAT, {"data": "value"}, message_id)
|
|
142
142
|
|
|
143
|
-
time.sleep(
|
|
143
|
+
time.sleep(0.01) # Give the message time to be processed
|
|
144
144
|
|
|
145
145
|
assert len(messages_received) == 1
|
|
146
146
|
assert messages_received[0].payload == {"data": "value"}
|
|
@@ -168,7 +168,7 @@ class BaseTestMessagingABC(ABC):
|
|
|
168
168
|
message_id1,
|
|
169
169
|
)
|
|
170
170
|
|
|
171
|
-
time.sleep(
|
|
171
|
+
time.sleep(0.01)
|
|
172
172
|
assert len(messages_received) == 2
|
|
173
173
|
|
|
174
174
|
assert messages_received[0].payload == {"data": "value1"}
|
|
@@ -223,7 +223,7 @@ class BaseTestMessagingABC(ABC):
|
|
|
223
223
|
message_id = generator.get_id(Priority.NORMAL)
|
|
224
224
|
sender.send_message("topic1", MessageConstants.RAW_JSON_FORMAT, {"data": "value"}, message_id)
|
|
225
225
|
|
|
226
|
-
time.sleep(
|
|
226
|
+
time.sleep(0.01) # Give the message time to be processed
|
|
227
227
|
|
|
228
228
|
assert len(messages_received1) == 1
|
|
229
229
|
assert len(messages_received2) == 1
|
|
@@ -248,7 +248,7 @@ class BaseTestMessagingABC(ABC):
|
|
|
248
248
|
sender.send_message("topic1", MessageConstants.RAW_JSON_FORMAT, {"data": "value1"}, message_id1)
|
|
249
249
|
sender.send_message("topic2", MessageConstants.RAW_JSON_FORMAT, {"data": "value2"}, message_id2)
|
|
250
250
|
|
|
251
|
-
time.sleep(
|
|
251
|
+
time.sleep(0.01) # Give the message time to be processed
|
|
252
252
|
|
|
253
253
|
assert len(messages_received) == 2
|
|
254
254
|
assert messages_received[0].payload == {"data": "value1"}
|
|
@@ -419,7 +419,7 @@ class BaseTestMessagingABC(ABC):
|
|
|
419
419
|
message_id = generator.get_id(Priority.NORMAL)
|
|
420
420
|
sender.send_message("topic1", MessageConstants.RAW_JSON_FORMAT, {"data": "value"}, message_id)
|
|
421
421
|
|
|
422
|
-
time.sleep(
|
|
422
|
+
time.sleep(0.01) # Give the message time to be processed
|
|
423
423
|
|
|
424
424
|
assert len(messages_received) == 1
|
|
425
425
|
assert len(alt_messages_received) == 0
|
|
@@ -452,7 +452,7 @@ class BaseTestMessagingABC(ABC):
|
|
|
452
452
|
)
|
|
453
453
|
sender.send_message(topic, MessageConstants.RAW_JSON_FORMAT, {"data": "value2"}, message_id3, history, 2)
|
|
454
454
|
|
|
455
|
-
time.sleep(
|
|
455
|
+
time.sleep(0.01) # Give the message time to be processed
|
|
456
456
|
|
|
457
457
|
assert len(messages_received) == 3
|
|
458
458
|
|
|
File without changes
|
|
File without changes
|
{rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/agent_ext/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/agents/sample_agents.py
RENAMED
|
File without changes
|
{rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/agents/simple_agent.py
RENAMED
|
File without changes
|
{rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/execution/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rusticai_testing-0.0.4 → rusticai_testing-0.1.0}/src/rustic_ai/testing/messaging/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|