cap-sdk-python 2.13.3__tar.gz → 2.14.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.
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/PKG-INFO +1 -1
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/heartbeat.py +1 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/alert_pb2.py +3 -3
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/alert_pb2_grpc.py +1 -1
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/buspacket_pb2.py +3 -3
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/buspacket_pb2_grpc.py +1 -1
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/handshake_pb2.py +3 -3
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/handshake_pb2_grpc.py +1 -1
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/heartbeat_pb2.py +3 -3
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/heartbeat_pb2_grpc.py +1 -1
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/job_pb2.py +3 -3
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/job_pb2_grpc.py +1 -1
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/policy_pb2.py +3 -3
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/policy_pb2_grpc.py +4 -4
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/safety_pb2.py +3 -3
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/safety_pb2_grpc.py +4 -4
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/progress.py +2 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap_sdk_python.egg-info/PKG-INFO +1 -1
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/pyproject.toml +1 -1
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_heartbeat.py +8 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_progress.py +7 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/README.md +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/__init__.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/bus.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/client.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/constants.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/errors.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/handshake.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/metrics.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/middleware.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/__init__.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/__init__.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/__init__.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/pb/cordum/agent/v1/__init__.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/runtime.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/subjects.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/testing.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/validate.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap/worker.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap_sdk_python.egg-info/SOURCES.txt +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap_sdk_python.egg-info/dependency_links.txt +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap_sdk_python.egg-info/requires.txt +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap_sdk_python.egg-info/top_level.txt +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/setup.cfg +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_conformance.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_errors.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_handshake.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_metrics.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_middleware.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_redis_tls.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_runtime.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_sdk.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_testing.py +0 -0
- {cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/tests/test_validate.py +0 -0
|
@@ -95,6 +95,7 @@ def heartbeat_payload_with_progress(
|
|
|
95
95
|
auth_token = auth_token.strip()
|
|
96
96
|
|
|
97
97
|
packet = buspacket_pb2.BusPacket()
|
|
98
|
+
packet.trace_id = worker_id
|
|
98
99
|
packet.sender_id = worker_id
|
|
99
100
|
packet.protocol_version = DEFAULT_PROTOCOL_VERSION
|
|
100
101
|
packet.created_at.CopyFrom(ts)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: cordum/agent/v1/alert.proto
|
|
5
|
-
# Protobuf Python Version: 6.
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -12,8 +12,8 @@ from google.protobuf.internal import builder as _builder
|
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
17
|
'',
|
|
18
18
|
'cordum/agent/v1/alert.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: cordum/agent/v1/buspacket.proto
|
|
5
|
-
# Protobuf Python Version: 6.
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -12,8 +12,8 @@ from google.protobuf.internal import builder as _builder
|
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
17
|
'',
|
|
18
18
|
'cordum/agent/v1/buspacket.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: cordum/agent/v1/handshake.proto
|
|
5
|
-
# Protobuf Python Version: 6.
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -12,8 +12,8 @@ from google.protobuf.internal import builder as _builder
|
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
17
|
'',
|
|
18
18
|
'cordum/agent/v1/handshake.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: cordum/agent/v1/heartbeat.proto
|
|
5
|
-
# Protobuf Python Version: 6.
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -12,8 +12,8 @@ from google.protobuf.internal import builder as _builder
|
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
17
|
'',
|
|
18
18
|
'cordum/agent/v1/heartbeat.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: cordum/agent/v1/job.proto
|
|
5
|
-
# Protobuf Python Version: 6.
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -12,8 +12,8 @@ from google.protobuf.internal import builder as _builder
|
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
17
|
'',
|
|
18
18
|
'cordum/agent/v1/job.proto'
|
|
19
19
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: cordum/agent/v1/policy.proto
|
|
5
|
-
# Protobuf Python Version: 6.
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -12,8 +12,8 @@ from google.protobuf.internal import builder as _builder
|
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
17
|
'',
|
|
18
18
|
'cordum/agent/v1/policy.proto'
|
|
19
19
|
)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from cordum.agent.v1 import policy_pb2 as cordum_dot_agent_dot_v1_dot_policy__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.81.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|
|
@@ -25,7 +25,7 @@ if _version_not_supported:
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
class PolicyEvaluatorStub
|
|
28
|
+
class PolicyEvaluatorStub:
|
|
29
29
|
"""PolicyEvaluator exposes the unified job + edge policy entry-point over gRPC.
|
|
30
30
|
"""
|
|
31
31
|
|
|
@@ -42,7 +42,7 @@ class PolicyEvaluatorStub(object):
|
|
|
42
42
|
_registered_method=True)
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
class PolicyEvaluatorServicer
|
|
45
|
+
class PolicyEvaluatorServicer:
|
|
46
46
|
"""PolicyEvaluator exposes the unified job + edge policy entry-point over gRPC.
|
|
47
47
|
"""
|
|
48
48
|
|
|
@@ -68,7 +68,7 @@ def add_PolicyEvaluatorServicer_to_server(servicer, server):
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
# This class is part of an EXPERIMENTAL API.
|
|
71
|
-
class PolicyEvaluator
|
|
71
|
+
class PolicyEvaluator:
|
|
72
72
|
"""PolicyEvaluator exposes the unified job + edge policy entry-point over gRPC.
|
|
73
73
|
"""
|
|
74
74
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: cordum/agent/v1/safety.proto
|
|
5
|
-
# Protobuf Python Version: 6.
|
|
5
|
+
# Protobuf Python Version: 6.33.5
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -12,8 +12,8 @@ from google.protobuf.internal import builder as _builder
|
|
|
12
12
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
33,
|
|
16
|
+
5,
|
|
17
17
|
'',
|
|
18
18
|
'cordum/agent/v1/safety.proto'
|
|
19
19
|
)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from cordum.agent.v1 import safety_pb2 as cordum_dot_agent_dot_v1_dot_safety__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.81.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|
|
@@ -25,7 +25,7 @@ if _version_not_supported:
|
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
class SafetyKernelStub
|
|
28
|
+
class SafetyKernelStub:
|
|
29
29
|
"""SafetyKernel defines the policy decision service.
|
|
30
30
|
"""
|
|
31
31
|
|
|
@@ -62,7 +62,7 @@ class SafetyKernelStub(object):
|
|
|
62
62
|
_registered_method=True)
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
class SafetyKernelServicer
|
|
65
|
+
class SafetyKernelServicer:
|
|
66
66
|
"""SafetyKernel defines the policy decision service.
|
|
67
67
|
"""
|
|
68
68
|
|
|
@@ -132,7 +132,7 @@ def add_SafetyKernelServicer_to_server(servicer, server):
|
|
|
132
132
|
|
|
133
133
|
|
|
134
134
|
# This class is part of an EXPERIMENTAL API.
|
|
135
|
-
class SafetyKernel
|
|
135
|
+
class SafetyKernel:
|
|
136
136
|
"""SafetyKernel defines the policy decision service.
|
|
137
137
|
"""
|
|
138
138
|
|
|
@@ -26,6 +26,7 @@ def progress_payload(
|
|
|
26
26
|
ts.GetCurrentTime()
|
|
27
27
|
|
|
28
28
|
packet = buspacket_pb2.BusPacket()
|
|
29
|
+
packet.trace_id = job_id
|
|
29
30
|
packet.sender_id = sender_id
|
|
30
31
|
packet.protocol_version = DEFAULT_PROTOCOL_VERSION
|
|
31
32
|
packet.created_at.CopyFrom(ts)
|
|
@@ -51,6 +52,7 @@ def cancel_payload(
|
|
|
51
52
|
ts.GetCurrentTime()
|
|
52
53
|
|
|
53
54
|
packet = buspacket_pb2.BusPacket()
|
|
55
|
+
packet.trace_id = job_id
|
|
54
56
|
packet.sender_id = sender_id
|
|
55
57
|
packet.protocol_version = DEFAULT_PROTOCOL_VERSION
|
|
56
58
|
packet.created_at.CopyFrom(ts)
|
|
@@ -14,6 +14,7 @@ from cap.heartbeat import (
|
|
|
14
14
|
)
|
|
15
15
|
from cap.pb.cordum.agent.v1 import buspacket_pb2
|
|
16
16
|
from cap.subjects import SUBJECT_HEARTBEAT
|
|
17
|
+
from cap.validate import validate_bus_packet
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class MockNATS:
|
|
@@ -45,6 +46,7 @@ class TestHeartbeatPayload(unittest.TestCase):
|
|
|
45
46
|
packet = buspacket_pb2.BusPacket()
|
|
46
47
|
packet.ParseFromString(payload)
|
|
47
48
|
|
|
49
|
+
self.assertEqual(packet.trace_id, "worker-1")
|
|
48
50
|
self.assertEqual(packet.sender_id, "worker-1")
|
|
49
51
|
self.assertEqual(packet.protocol_version, 1)
|
|
50
52
|
self.assertGreater(packet.created_at.seconds, 0)
|
|
@@ -57,6 +59,7 @@ class TestHeartbeatPayload(unittest.TestCase):
|
|
|
57
59
|
self.assertEqual(packet.heartbeat.progress_pct, 0)
|
|
58
60
|
self.assertEqual(packet.heartbeat.last_memo, "")
|
|
59
61
|
self.assertEqual(packet.heartbeat.auth_token, "token-123")
|
|
62
|
+
self.assertEqual(validate_bus_packet(packet), [])
|
|
60
63
|
|
|
61
64
|
def test_heartbeat_payload_with_agent_name(self):
|
|
62
65
|
payload = heartbeat_payload(
|
|
@@ -98,11 +101,13 @@ class TestHeartbeatPayload(unittest.TestCase):
|
|
|
98
101
|
packet = buspacket_pb2.BusPacket()
|
|
99
102
|
packet.ParseFromString(payload)
|
|
100
103
|
|
|
104
|
+
self.assertEqual(packet.trace_id, "worker-2")
|
|
101
105
|
self.assertEqual(packet.sender_id, "worker-2")
|
|
102
106
|
self.assertEqual(packet.protocol_version, 1)
|
|
103
107
|
self.assertEqual(packet.heartbeat.memory_load, 75.0)
|
|
104
108
|
self.assertEqual(packet.heartbeat.progress_pct, 0)
|
|
105
109
|
self.assertEqual(packet.heartbeat.last_memo, "")
|
|
110
|
+
self.assertEqual(validate_bus_packet(packet), [])
|
|
106
111
|
|
|
107
112
|
def test_heartbeat_payload_with_progress_constructor(self):
|
|
108
113
|
payload = heartbeat_payload_with_progress(
|
|
@@ -118,6 +123,7 @@ class TestHeartbeatPayload(unittest.TestCase):
|
|
|
118
123
|
packet = buspacket_pb2.BusPacket()
|
|
119
124
|
packet.ParseFromString(payload)
|
|
120
125
|
|
|
126
|
+
self.assertEqual(packet.trace_id, "worker-3")
|
|
121
127
|
self.assertEqual(packet.sender_id, "worker-3")
|
|
122
128
|
self.assertEqual(packet.protocol_version, 1)
|
|
123
129
|
self.assertEqual(packet.heartbeat.worker_id, "worker-3")
|
|
@@ -128,6 +134,7 @@ class TestHeartbeatPayload(unittest.TestCase):
|
|
|
128
134
|
self.assertEqual(packet.heartbeat.memory_load, 64.0)
|
|
129
135
|
self.assertEqual(packet.heartbeat.progress_pct, 67)
|
|
130
136
|
self.assertEqual(packet.heartbeat.last_memo, "checkpoint-42")
|
|
137
|
+
self.assertEqual(validate_bus_packet(packet), [])
|
|
131
138
|
|
|
132
139
|
def test_heartbeat_payload_with_zero_values(self):
|
|
133
140
|
payload = heartbeat_payload_with_progress(
|
|
@@ -317,6 +324,7 @@ class TestHeartbeatIntegration(unittest.IsolatedAsyncioTestCase):
|
|
|
317
324
|
packet.ParseFromString(data)
|
|
318
325
|
|
|
319
326
|
self.assertEqual(packet.sender_id, "worker-int")
|
|
327
|
+
self.assertEqual(packet.trace_id, "worker-int")
|
|
320
328
|
self.assertEqual(packet.protocol_version, 1)
|
|
321
329
|
self.assertEqual(packet.heartbeat.worker_id, "worker-int")
|
|
322
330
|
self.assertEqual(packet.heartbeat.pool, "pool-int")
|
|
@@ -13,6 +13,7 @@ from cap.progress import (
|
|
|
13
13
|
)
|
|
14
14
|
from cap.pb.cordum.agent.v1 import buspacket_pb2
|
|
15
15
|
from cap.subjects import SUBJECT_CANCEL, SUBJECT_PROGRESS
|
|
16
|
+
from cap.validate import validate_bus_packet
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class MockNATS:
|
|
@@ -35,6 +36,7 @@ class TestProgressPayload(unittest.TestCase):
|
|
|
35
36
|
packet = buspacket_pb2.BusPacket()
|
|
36
37
|
packet.ParseFromString(payload)
|
|
37
38
|
|
|
39
|
+
self.assertEqual(packet.trace_id, "job-1")
|
|
38
40
|
self.assertEqual(packet.sender_id, "worker-1")
|
|
39
41
|
self.assertEqual(packet.protocol_version, 1)
|
|
40
42
|
self.assertGreater(packet.created_at.seconds, 0)
|
|
@@ -42,6 +44,7 @@ class TestProgressPayload(unittest.TestCase):
|
|
|
42
44
|
self.assertEqual(packet.job_progress.step_id, "step-1")
|
|
43
45
|
self.assertEqual(packet.job_progress.percent, 50)
|
|
44
46
|
self.assertEqual(packet.job_progress.message, "halfway")
|
|
47
|
+
self.assertEqual(validate_bus_packet(packet), [])
|
|
45
48
|
|
|
46
49
|
def test_progress_payload_zero_percent(self):
|
|
47
50
|
payload = progress_payload(
|
|
@@ -85,12 +88,14 @@ class TestCancelPayload(unittest.TestCase):
|
|
|
85
88
|
packet = buspacket_pb2.BusPacket()
|
|
86
89
|
packet.ParseFromString(payload)
|
|
87
90
|
|
|
91
|
+
self.assertEqual(packet.trace_id, "job-1")
|
|
88
92
|
self.assertEqual(packet.sender_id, "worker-1")
|
|
89
93
|
self.assertEqual(packet.protocol_version, 1)
|
|
90
94
|
self.assertGreater(packet.created_at.seconds, 0)
|
|
91
95
|
self.assertEqual(packet.job_cancel.job_id, "job-1")
|
|
92
96
|
self.assertEqual(packet.job_cancel.reason, "timeout")
|
|
93
97
|
self.assertEqual(packet.job_cancel.requested_by, "user-7")
|
|
98
|
+
self.assertEqual(validate_bus_packet(packet), [])
|
|
94
99
|
|
|
95
100
|
def test_cancel_payload_empty_reason(self):
|
|
96
101
|
payload = cancel_payload(
|
|
@@ -222,6 +227,7 @@ class TestProgressIntegration(unittest.IsolatedAsyncioTestCase):
|
|
|
222
227
|
packet = buspacket_pb2.BusPacket()
|
|
223
228
|
packet.ParseFromString(data)
|
|
224
229
|
|
|
230
|
+
self.assertEqual(packet.trace_id, "job-int")
|
|
225
231
|
self.assertEqual(packet.sender_id, "worker-int")
|
|
226
232
|
self.assertEqual(packet.protocol_version, 1)
|
|
227
233
|
self.assertEqual(packet.job_progress.job_id, "job-int")
|
|
@@ -242,6 +248,7 @@ class TestProgressIntegration(unittest.IsolatedAsyncioTestCase):
|
|
|
242
248
|
packet = buspacket_pb2.BusPacket()
|
|
243
249
|
packet.ParseFromString(data)
|
|
244
250
|
|
|
251
|
+
self.assertEqual(packet.trace_id, "job-int")
|
|
245
252
|
self.assertEqual(packet.sender_id, "worker-int")
|
|
246
253
|
self.assertEqual(packet.job_cancel.job_id, "job-int")
|
|
247
254
|
self.assertEqual(packet.job_cancel.reason, "user-abort")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cap_sdk_python-2.13.3 → cap_sdk_python-2.14.0}/cap_sdk_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|