anyt 1.1.0 → 1.2.0
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/README.md +0 -1
- data/lib/anyt/cli.rb +1 -1
- data/lib/anyt/client.rb +2 -3
- data/lib/anyt/command.rb +1 -3
- data/lib/anyt/config.rb +3 -0
- data/lib/anyt/dummy/application.rb +1 -1
- data/lib/anyt/ext/minitest.rb +14 -0
- data/lib/anyt/remote_control.rb +1 -1
- data/lib/anyt/rpc.rb +4 -1
- data/lib/anyt/tests/core/ping_test.rb +1 -1
- data/lib/anyt/tests/core/welcome_test.rb +1 -1
- data/lib/anyt/tests/features/channel_state_test.rb +4 -4
- data/lib/anyt/tests/features/remote_disconnect_test.rb +11 -6
- data/lib/anyt/tests/features/server_restart_test.rb +8 -6
- data/lib/anyt/tests/request/channel_test.rb +2 -2
- data/lib/anyt/tests/request/connection_test.rb +3 -3
- data/lib/anyt/tests/request/disconnect_reasons_test.rb +7 -5
- data/lib/anyt/tests/request/disconnection_test.rb +11 -11
- data/lib/anyt/tests/streams/broadcast_test.rb +4 -4
- data/lib/anyt/tests/streams/multiple_clients_test.rb +7 -7
- data/lib/anyt/tests/streams/multiple_test.rb +4 -4
- data/lib/anyt/tests/streams/single_test.rb +7 -7
- data/lib/anyt/tests/streams/stop_test.rb +3 -3
- data/lib/anyt/tests/subscriptions/ack_test.rb +2 -2
- data/lib/anyt/tests/subscriptions/params_test.rb +2 -2
- data/lib/anyt/tests/subscriptions/perform_test.rb +3 -3
- data/lib/anyt/tests/subscriptions/transmissions_test.rb +3 -3
- data/lib/anyt/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94cce22072abf225f715de0e1b343e2b94783eba7961778232bfb1508d4ebe6a
|
4
|
+
data.tar.gz: 00fd3d54c2f350c45440ba944e07388bd431668e3a28e34fa6c227b17081576c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f64df7da832de830955aaf6906cf3a72b0984f4fc505db422e272e87aabdfc8ad39b05a9f48717fe2e523354ada94060e077a9ad4e457adb656a253579a3d49
|
7
|
+
data.tar.gz: 0b536582f0df8d7c2bf371fd4fd2cc1424ef289e7db40cc6a6afcbae68e577cf5422322ee0b013fae330f87f9a00778cb2a8be8f7794b246b4fcd0b4e8b87b34
|
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
[](https://cultofmartians.com/tasks/anycable-conformance-tool.html#task)
|
2
2
|
[](https://rubygems.org/gems/anyt)
|
3
3
|

|
4
|
-
[](https://gitter.im/anycable/anycablebility)
|
5
4
|
|
6
5
|
# AnyCable Conformance Testing Tool
|
7
6
|
|
data/lib/anyt/cli.rb
CHANGED
@@ -173,7 +173,7 @@ module Anyt
|
|
173
173
|
def wait_till_terminated
|
174
174
|
self_read = setup_signals
|
175
175
|
|
176
|
-
while readable_io = IO.select([self_read]) # rubocop:disable Lint/AssignmentInCondition
|
176
|
+
while readable_io = IO.select([self_read]) # rubocop:disable Lint/AssignmentInCondition, Lint/IncompatibleIoSelectWithFiberScheduler
|
177
177
|
signal = readable_io.first[0].gets.strip
|
178
178
|
raise Interrupt, "SIG#{signal} received"
|
179
179
|
end
|
data/lib/anyt/client.rb
CHANGED
@@ -12,12 +12,10 @@ module Anyt
|
|
12
12
|
WAIT_WHEN_EXPECTING_EVENT = 5
|
13
13
|
WAIT_WHEN_NOT_EXPECTING_EVENT = 0.5
|
14
14
|
|
15
|
-
# rubocop: disable Metrics/AbcSize
|
16
|
-
# rubocop: disable Metrics/MethodLength
|
17
|
-
# rubocop: disable Metrics/BlockLength
|
18
15
|
def initialize(
|
19
16
|
ignore: [], url: Anyt.config.target_url, qs: "",
|
20
17
|
cookies: "", headers: {},
|
18
|
+
protocol: "actioncable-v1-json",
|
21
19
|
timeout_multiplier: Anyt.config.timeout_multiplier
|
22
20
|
)
|
23
21
|
ignore_message_types = @ignore_message_types = ignore
|
@@ -28,6 +26,7 @@ module Anyt
|
|
28
26
|
@timeout_multiplier = timeout_multiplier
|
29
27
|
|
30
28
|
headers = headers.merge("cookie" => cookies)
|
29
|
+
headers["Sec-WebSocket-Protocol"] = protocol
|
31
30
|
|
32
31
|
open = Concurrent::Promise.new
|
33
32
|
|
data/lib/anyt/command.rb
CHANGED
@@ -6,12 +6,10 @@ module Anyt
|
|
6
6
|
# Runs system command (websocket server)
|
7
7
|
module Command
|
8
8
|
class << self
|
9
|
-
# rubocop: disable Metrics/MethodLength
|
10
|
-
# rubocop: disable Metrics/AbcSize
|
11
9
|
def run
|
12
10
|
return if running?
|
13
11
|
|
14
|
-
|
12
|
+
return unless Anyt.config.command
|
15
13
|
|
16
14
|
AnyCable.logger.debug "Running command: #{Anyt.config.command}"
|
17
15
|
|
data/lib/anyt/config.rb
CHANGED
@@ -13,7 +13,7 @@ class TestApp < Rails::Application
|
|
13
13
|
secrets.secret_token = "secret_token"
|
14
14
|
secrets.secret_key_base = "secret_key_base"
|
15
15
|
|
16
|
-
config.logger = Logger.new(
|
16
|
+
config.logger = Logger.new($stdout)
|
17
17
|
config.log_level = AnyCable.config.log_level
|
18
18
|
config.eager_load = true
|
19
19
|
|
data/lib/anyt/ext/minitest.rb
CHANGED
@@ -30,6 +30,20 @@ module Anyt
|
|
30
30
|
def remote_client
|
31
31
|
@remote_client ||= RemoteControl::Client.connect(Anyt.config.remote_control_port)
|
32
32
|
end
|
33
|
+
|
34
|
+
# Verifies that the actual message Hash is a subset of the expected one
|
35
|
+
# (so we can ignore some irrelevant fields)
|
36
|
+
def assert_message(expected, actual)
|
37
|
+
assert_equal expected, actual.slice(*expected.keys)
|
38
|
+
end
|
39
|
+
|
40
|
+
def assert_includes_message(collection, expected)
|
41
|
+
found = collection.find do |el|
|
42
|
+
el.slice(*expected.keys) == expected
|
43
|
+
end
|
44
|
+
|
45
|
+
assert found, "Expecte #{collection} to include a message matching #{expected}"
|
46
|
+
end
|
33
47
|
end
|
34
48
|
end
|
35
49
|
|
data/lib/anyt/remote_control.rb
CHANGED
data/lib/anyt/rpc.rb
CHANGED
@@ -13,7 +13,6 @@ module Anyt # :nodoc:
|
|
13
13
|
attr_accessor :running
|
14
14
|
attr_reader :server
|
15
15
|
|
16
|
-
# rubocop: disable Metrics/AbcSize,Metrics/MethodLength
|
17
16
|
def start
|
18
17
|
AnyCable.logger.debug "Starting RPC server ..."
|
19
18
|
|
@@ -24,6 +23,10 @@ module Anyt # :nodoc:
|
|
24
23
|
**AnyCable.config.to_grpc_params
|
25
24
|
)
|
26
25
|
|
26
|
+
if defined?(::AnyCable::Middlewares::EnvSid)
|
27
|
+
AnyCable.middleware.use(::AnyCable::Middlewares::EnvSid)
|
28
|
+
end
|
29
|
+
|
27
30
|
AnyCable.middleware.freeze
|
28
31
|
|
29
32
|
server.start
|
@@ -37,7 +37,7 @@ feature "Channel state" do
|
|
37
37
|
"identifier" => identifier, "type" => "confirm_subscription"
|
38
38
|
}
|
39
39
|
|
40
|
-
|
40
|
+
assert_message ack, client.receive
|
41
41
|
end
|
42
42
|
|
43
43
|
scenario %(
|
@@ -53,7 +53,7 @@ feature "Channel state" do
|
|
53
53
|
|
54
54
|
msg = {"identifier" => identifier, "message" => {"count" => 3, "name" => "chipolino"}}
|
55
55
|
|
56
|
-
|
56
|
+
assert_message msg, client.receive
|
57
57
|
end
|
58
58
|
|
59
59
|
scenario %(
|
@@ -67,7 +67,7 @@ feature "Channel state" do
|
|
67
67
|
"identifier" => identifier2, "type" => "confirm_subscription"
|
68
68
|
}
|
69
69
|
|
70
|
-
|
70
|
+
assert_message ack, client2.receive
|
71
71
|
|
72
72
|
client2.close
|
73
73
|
|
@@ -76,6 +76,6 @@ feature "Channel state" do
|
|
76
76
|
"message" => {"data" => "user left: chipollone"}
|
77
77
|
}
|
78
78
|
|
79
|
-
|
79
|
+
assert_message msg, client.receive
|
80
80
|
end
|
81
81
|
end
|
@@ -10,17 +10,22 @@ feature "Remote disconnect" do
|
|
10
10
|
Close single connection by id
|
11
11
|
) do
|
12
12
|
client = build_client(qs: "test=uid&uid=26", ignore: %w[ping])
|
13
|
-
|
13
|
+
assert_message({"type" => "welcome"}, client.receive)
|
14
14
|
|
15
|
+
# Prevent race conditions when we send disconnect before internal channel subscription has been made
|
16
|
+
# (only for Action Cable)
|
17
|
+
sleep 1
|
15
18
|
ActionCable.server.remote_connections.where(uid: "26").disconnect
|
16
19
|
|
17
20
|
# Waiting for https://github.com/rails/rails/pull/39544
|
18
21
|
unless Anyt.config.use_action_cable
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
assert_message(
|
23
|
+
{
|
24
|
+
"type" => "disconnect",
|
25
|
+
"reconnect" => true,
|
26
|
+
"reason" => "remote"
|
27
|
+
},
|
28
|
+
client.receive
|
24
29
|
)
|
25
30
|
end
|
26
31
|
|
@@ -14,15 +14,17 @@ feature "Server restart" do
|
|
14
14
|
ignore: %(ping)
|
15
15
|
)
|
16
16
|
|
17
|
-
|
17
|
+
assert_message({"type" => "welcome"}, client.receive)
|
18
18
|
|
19
19
|
restart_server!
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
assert_message(
|
22
|
+
{
|
23
|
+
"type" => "disconnect",
|
24
|
+
"reconnect" => true,
|
25
|
+
"reason" => "server_restart"
|
26
|
+
},
|
27
|
+
client.receive
|
26
28
|
)
|
27
29
|
end
|
28
30
|
end
|
@@ -13,7 +13,7 @@ feature "Request" do
|
|
13
13
|
Channel has access to request
|
14
14
|
) do
|
15
15
|
client = build_client(qs: "token=secret", ignore: %w[ping])
|
16
|
-
|
16
|
+
assert_message({"type" => "welcome"}, client.receive)
|
17
17
|
|
18
18
|
subscribe_request = {command: "subscribe", identifier: {channel: channel}.to_json}
|
19
19
|
|
@@ -23,6 +23,6 @@ feature "Request" do
|
|
23
23
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
24
24
|
}
|
25
25
|
|
26
|
-
|
26
|
+
assert_message ack, client.receive
|
27
27
|
end
|
28
28
|
end
|
@@ -11,7 +11,7 @@ feature "Request" do
|
|
11
11
|
Url is set during connection
|
12
12
|
) do
|
13
13
|
client = build_client(qs: "test=request_url")
|
14
|
-
|
14
|
+
assert_message({"type" => "welcome"}, client.receive)
|
15
15
|
end
|
16
16
|
|
17
17
|
connect_handler("cookies") do
|
@@ -30,7 +30,7 @@ feature "Request" do
|
|
30
30
|
Accepts when required cookies are set
|
31
31
|
) do
|
32
32
|
client = build_client(qs: "test=cookies", cookies: "username=john green")
|
33
|
-
|
33
|
+
assert_message({"type" => "welcome"}, client.receive)
|
34
34
|
end
|
35
35
|
|
36
36
|
connect_handler("headers") do
|
@@ -49,6 +49,6 @@ feature "Request" do
|
|
49
49
|
Accepts when required header is set
|
50
50
|
) do
|
51
51
|
client = build_client(qs: "test=headers", headers: {"x-api-token" => "abc"})
|
52
|
-
|
52
|
+
assert_message({"type" => "welcome"}, client.receive)
|
53
53
|
end
|
54
54
|
end
|
@@ -10,11 +10,13 @@ feature "Request" do
|
|
10
10
|
Receives disconnect message when rejected
|
11
11
|
) do
|
12
12
|
client = build_client(qs: "test=reasons&reason=unauthorized")
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
assert_message(
|
14
|
+
{
|
15
|
+
"type" => "disconnect",
|
16
|
+
"reconnect" => false,
|
17
|
+
"reason" => "unauthorized"
|
18
|
+
},
|
19
|
+
client.receive
|
18
20
|
)
|
19
21
|
|
20
22
|
client.wait_for_close
|
@@ -45,7 +45,7 @@ feature "Request" do
|
|
45
45
|
"identifier" => {channel: a_channel}.to_json, "type" => "confirm_subscription"
|
46
46
|
}
|
47
47
|
|
48
|
-
|
48
|
+
assert_message ack, client.receive
|
49
49
|
|
50
50
|
subscribe_request = {command: "subscribe", identifier: {channel: b_channel}.to_json}
|
51
51
|
|
@@ -55,7 +55,7 @@ feature "Request" do
|
|
55
55
|
"identifier" => {channel: b_channel}.to_json, "type" => "confirm_subscription"
|
56
56
|
}
|
57
57
|
|
58
|
-
|
58
|
+
assert_message ack, client.receive
|
59
59
|
|
60
60
|
subscribe_request = {command: "subscribe", identifier: {channel: a_channel}.to_json}
|
61
61
|
|
@@ -65,7 +65,7 @@ feature "Request" do
|
|
65
65
|
"identifier" => {channel: a_channel}.to_json, "type" => "confirm_subscription"
|
66
66
|
}
|
67
67
|
|
68
|
-
|
68
|
+
assert_message ack, client2.receive
|
69
69
|
|
70
70
|
subscribe_request = {command: "subscribe", identifier: {channel: b_channel}.to_json}
|
71
71
|
|
@@ -75,7 +75,7 @@ feature "Request" do
|
|
75
75
|
"identifier" => {channel: b_channel}.to_json, "type" => "confirm_subscription"
|
76
76
|
}
|
77
77
|
|
78
|
-
|
78
|
+
assert_message ack, client2.receive
|
79
79
|
|
80
80
|
client2.close
|
81
81
|
|
@@ -90,8 +90,8 @@ feature "Request" do
|
|
90
90
|
|
91
91
|
msgs = [client.receive, client.receive]
|
92
92
|
|
93
|
-
|
94
|
-
|
93
|
+
assert_includes_message msgs, msg
|
94
|
+
assert_includes_message msgs, msg2
|
95
95
|
end
|
96
96
|
|
97
97
|
scenario %(
|
@@ -106,7 +106,7 @@ feature "Request" do
|
|
106
106
|
"identifier" => {channel: c_channel}.to_json, "type" => "confirm_subscription"
|
107
107
|
}
|
108
108
|
|
109
|
-
|
109
|
+
assert_message ack, client.receive
|
110
110
|
|
111
111
|
subscribe_request = {command: "subscribe", identifier: {channel: c_channel, id: 1}.to_json}
|
112
112
|
|
@@ -116,7 +116,7 @@ feature "Request" do
|
|
116
116
|
"identifier" => {channel: c_channel, id: 1}.to_json, "type" => "confirm_subscription"
|
117
117
|
}
|
118
118
|
|
119
|
-
|
119
|
+
assert_message ack, client2.receive
|
120
120
|
|
121
121
|
subscribe_request = {command: "subscribe", identifier: {channel: c_channel, id: 2}.to_json}
|
122
122
|
|
@@ -126,7 +126,7 @@ feature "Request" do
|
|
126
126
|
"identifier" => {channel: c_channel, id: 2}.to_json, "type" => "confirm_subscription"
|
127
127
|
}
|
128
128
|
|
129
|
-
|
129
|
+
assert_message ack, client2.receive
|
130
130
|
|
131
131
|
client2.close
|
132
132
|
|
@@ -142,7 +142,7 @@ feature "Request" do
|
|
142
142
|
|
143
143
|
msgs = [client.receive, client.receive]
|
144
144
|
|
145
|
-
|
146
|
-
|
145
|
+
assert_includes_message msgs, msg
|
146
|
+
assert_includes_message msgs, msg2
|
147
147
|
end
|
148
148
|
end
|
@@ -16,7 +16,7 @@ feature "Broadcast data to stream" do
|
|
16
16
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
17
17
|
}
|
18
18
|
|
19
|
-
|
19
|
+
assert_message ack, client.receive
|
20
20
|
end
|
21
21
|
|
22
22
|
scenario %(
|
@@ -34,7 +34,7 @@ feature "Broadcast data to stream" do
|
|
34
34
|
}
|
35
35
|
}
|
36
36
|
|
37
|
-
|
37
|
+
assert_message msg, client.receive
|
38
38
|
end
|
39
39
|
|
40
40
|
scenario %(
|
@@ -47,7 +47,7 @@ feature "Broadcast data to stream" do
|
|
47
47
|
"message" => "<script>alert('Message!');</script>"
|
48
48
|
}
|
49
49
|
|
50
|
-
|
50
|
+
assert_message msg, client.receive
|
51
51
|
end
|
52
52
|
|
53
53
|
scenario %(
|
@@ -60,6 +60,6 @@ feature "Broadcast data to stream" do
|
|
60
60
|
"message" => '{"script":{"alert":"Message!"}}'
|
61
61
|
}
|
62
62
|
|
63
|
-
|
63
|
+
assert_message msg, client.receive
|
64
64
|
end
|
65
65
|
end
|
@@ -19,8 +19,8 @@ feature "Streams with many clients" do
|
|
19
19
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
20
20
|
}
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
assert_message ack, client.receive
|
23
|
+
assert_message ack, client2.receive
|
24
24
|
end
|
25
25
|
|
26
26
|
scenario %(
|
@@ -30,8 +30,8 @@ feature "Streams with many clients" do
|
|
30
30
|
|
31
31
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
32
32
|
|
33
|
-
|
34
|
-
|
33
|
+
assert_message msg, client.receive
|
34
|
+
assert_message msg, client2.receive
|
35
35
|
end
|
36
36
|
|
37
37
|
scenario %(
|
@@ -41,8 +41,8 @@ feature "Streams with many clients" do
|
|
41
41
|
|
42
42
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
assert_message msg, client.receive
|
45
|
+
assert_message msg, client2.receive
|
46
46
|
|
47
47
|
unsubscribe_request = {command: "unsubscribe", identifier: {channel: channel}.to_json}
|
48
48
|
|
@@ -55,7 +55,7 @@ feature "Streams with many clients" do
|
|
55
55
|
|
56
56
|
msg2 = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
|
57
57
|
|
58
|
-
|
58
|
+
assert_message msg2, client2.receive
|
59
59
|
assert_raises(Anyt::Client::TimeoutError) { client.receive(timeout: 0.5) }
|
60
60
|
end
|
61
61
|
end
|
@@ -17,7 +17,7 @@ feature "Multiple streams" do
|
|
17
17
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
18
18
|
}
|
19
19
|
|
20
|
-
|
20
|
+
assert_message ack, client.receive
|
21
21
|
end
|
22
22
|
|
23
23
|
scenario %(
|
@@ -27,13 +27,13 @@ feature "Multiple streams" do
|
|
27
27
|
|
28
28
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
29
29
|
|
30
|
-
|
30
|
+
assert_message msg, client.receive
|
31
31
|
|
32
32
|
ActionCable.server.broadcast("b", {data: "Y"})
|
33
33
|
|
34
34
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
|
35
35
|
|
36
|
-
|
36
|
+
assert_message msg, client.receive
|
37
37
|
end
|
38
38
|
|
39
39
|
scenario %(
|
@@ -43,7 +43,7 @@ feature "Multiple streams" do
|
|
43
43
|
|
44
44
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
45
45
|
|
46
|
-
|
46
|
+
assert_message msg, client.receive
|
47
47
|
|
48
48
|
unsubscribe_request = {command: "unsubscribe", identifier: {channel: channel}.to_json}
|
49
49
|
|
@@ -16,7 +16,7 @@ feature "Single stream" do
|
|
16
16
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
17
17
|
}
|
18
18
|
|
19
|
-
|
19
|
+
assert_message ack, client.receive
|
20
20
|
end
|
21
21
|
|
22
22
|
scenario %(
|
@@ -26,13 +26,13 @@ feature "Single stream" do
|
|
26
26
|
|
27
27
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
28
28
|
|
29
|
-
|
29
|
+
assert_message msg, client.receive
|
30
30
|
|
31
31
|
ActionCable.server.broadcast("a", {data: "Y"})
|
32
32
|
|
33
33
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
|
34
34
|
|
35
|
-
|
35
|
+
assert_message msg, client.receive
|
36
36
|
end
|
37
37
|
|
38
38
|
scenario %(
|
@@ -42,7 +42,7 @@ feature "Single stream" do
|
|
42
42
|
|
43
43
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
44
44
|
|
45
|
-
|
45
|
+
assert_message msg, client.receive
|
46
46
|
|
47
47
|
unsubscribe_request = {command: "unsubscribe", identifier: {channel: channel}.to_json}
|
48
48
|
|
@@ -68,7 +68,7 @@ feature "Single stream" do
|
|
68
68
|
"identifier" => {channel: channel, some_param: "test"}.to_json, "type" => "confirm_subscription"
|
69
69
|
}
|
70
70
|
|
71
|
-
|
71
|
+
assert_message ack, client.receive
|
72
72
|
|
73
73
|
ActionCable.server.broadcast("a", {data: "XX"})
|
74
74
|
|
@@ -77,7 +77,7 @@ feature "Single stream" do
|
|
77
77
|
|
78
78
|
received = client.receive, client.receive
|
79
79
|
|
80
|
-
|
81
|
-
|
80
|
+
assert_includes_message received, msg
|
81
|
+
assert_includes_message received, msg2
|
82
82
|
end
|
83
83
|
end
|
@@ -25,7 +25,7 @@ feature "Stop streams" do
|
|
25
25
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
26
26
|
}
|
27
27
|
|
28
|
-
|
28
|
+
assert_message ack, client.receive
|
29
29
|
end
|
30
30
|
|
31
31
|
scenario %(
|
@@ -37,7 +37,7 @@ feature "Stop streams" do
|
|
37
37
|
|
38
38
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
|
39
39
|
|
40
|
-
|
40
|
+
assert_message msg, client.receive
|
41
41
|
|
42
42
|
perform_request = {
|
43
43
|
:command => "message",
|
@@ -52,6 +52,6 @@ feature "Stop streams" do
|
|
52
52
|
ActionCable.server.broadcast("b", {data: "Z"})
|
53
53
|
|
54
54
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Z"}}
|
55
|
-
|
55
|
+
assert_message msg, client.receive
|
56
56
|
end
|
57
57
|
end
|
@@ -20,7 +20,7 @@ feature "Subscription aknowledgement" do
|
|
20
20
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
21
21
|
}
|
22
22
|
|
23
|
-
|
23
|
+
assert_message ack, client.receive
|
24
24
|
end
|
25
25
|
|
26
26
|
scenario %(
|
@@ -34,6 +34,6 @@ feature "Subscription aknowledgement" do
|
|
34
34
|
"identifier" => {channel: rejector_channel}.to_json, "type" => "reject_subscription"
|
35
35
|
}
|
36
36
|
|
37
|
-
|
37
|
+
assert_message ack, client.receive
|
38
38
|
end
|
39
39
|
end
|
@@ -14,7 +14,7 @@ feature "Subscription with params" do
|
|
14
14
|
"identifier" => {channel: channel, id: 1}.to_json, "type" => "confirm_subscription"
|
15
15
|
}
|
16
16
|
|
17
|
-
|
17
|
+
assert_message ack, client.receive
|
18
18
|
|
19
19
|
subscribe_request_2 = {command: "subscribe", identifier: {channel: channel, id: 2}.to_json}
|
20
20
|
|
@@ -24,6 +24,6 @@ feature "Subscription with params" do
|
|
24
24
|
"identifier" => {channel: channel, id: 2}.to_json, "type" => "confirm_subscription"
|
25
25
|
}
|
26
26
|
|
27
|
-
|
27
|
+
assert_message ack, client.receive
|
28
28
|
end
|
29
29
|
end
|
@@ -23,7 +23,7 @@ feature "Subscription perform methods" do
|
|
23
23
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
24
24
|
}
|
25
25
|
|
26
|
-
|
26
|
+
assert_message ack, client.receive
|
27
27
|
end
|
28
28
|
|
29
29
|
scenario %(
|
@@ -39,7 +39,7 @@ feature "Subscription perform methods" do
|
|
39
39
|
|
40
40
|
msg = {"identifier" => {channel: channel}.to_json, "message" => "tock"}
|
41
41
|
|
42
|
-
|
42
|
+
assert_message msg, client.receive
|
43
43
|
end
|
44
44
|
|
45
45
|
scenario %(
|
@@ -55,6 +55,6 @@ feature "Subscription perform methods" do
|
|
55
55
|
|
56
56
|
msg = {"identifier" => {channel: channel}.to_json, "message" => {"response" => "hello"}}
|
57
57
|
|
58
|
-
|
58
|
+
assert_message msg, client.receive
|
59
59
|
end
|
60
60
|
end
|
@@ -17,16 +17,16 @@ feature "Subscription transmissions" do
|
|
17
17
|
|
18
18
|
msg = {"identifier" => {channel: channel}.to_json, "message" => "hello"}
|
19
19
|
|
20
|
-
|
20
|
+
assert_message msg, client.receive
|
21
21
|
|
22
22
|
msg = {"identifier" => {channel: channel}.to_json, "message" => "world"}
|
23
23
|
|
24
|
-
|
24
|
+
assert_message msg, client.receive
|
25
25
|
|
26
26
|
ack = {
|
27
27
|
"identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
|
28
28
|
}
|
29
29
|
|
30
|
-
|
30
|
+
assert_message ack, client.receive
|
31
31
|
end
|
32
32
|
end
|
data/lib/anyt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anyt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '6.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: anyway_config
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.2.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.2.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: anycable-rails
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,14 +148,14 @@ dependencies:
|
|
134
148
|
requirements:
|
135
149
|
- - "~>"
|
136
150
|
- !ruby/object:Gem::Version
|
137
|
-
version: 1.0
|
151
|
+
version: '1.0'
|
138
152
|
type: :runtime
|
139
153
|
prerelease: false
|
140
154
|
version_requirements: !ruby/object:Gem::Requirement
|
141
155
|
requirements:
|
142
156
|
- - "~>"
|
143
157
|
- !ruby/object:Gem::Version
|
144
|
-
version: 1.0
|
158
|
+
version: '1.0'
|
145
159
|
- !ruby/object:Gem::Dependency
|
146
160
|
name: childprocess
|
147
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,14 +271,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
257
271
|
requirements:
|
258
272
|
- - ">="
|
259
273
|
- !ruby/object:Gem::Version
|
260
|
-
version:
|
274
|
+
version: 2.6.0
|
261
275
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
262
276
|
requirements:
|
263
277
|
- - ">="
|
264
278
|
- !ruby/object:Gem::Version
|
265
279
|
version: '0'
|
266
280
|
requirements: []
|
267
|
-
rubygems_version: 3.
|
281
|
+
rubygems_version: 3.3.7
|
268
282
|
signing_key:
|
269
283
|
specification_version: 4
|
270
284
|
summary: Anycable conformance testing tool
|