Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
781c16b7
Commit
781c16b7
authored
Aug 14, 2013
by
Wandenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update nginx_test_helper gem
parent
899c46ac
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
Gemfile
misc/Gemfile
+1
-1
Gemfile.lock
misc/Gemfile.lock
+2
-2
channel_statistics_spec.rb
misc/spec/mix/channel_statistics_spec.rb
+2
-2
keepalive_spec.rb
misc/spec/mix/keepalive_spec.rb
+3
-3
measure_memory_spec.rb
misc/spec/mix/measure_memory_spec.rb
+2
-2
publish_messages_spec.rb
misc/spec/publisher/publish_messages_spec.rb
+1
-1
No files found.
misc/Gemfile
View file @
781c16b7
...
@@ -5,7 +5,7 @@ gem 'rake', '~> 10.0.3'
...
@@ -5,7 +5,7 @@ gem 'rake', '~> 10.0.3'
group
:test
do
group
:test
do
gem
'rspec'
,
'~> 2.12.0'
gem
'rspec'
,
'~> 2.12.0'
gem
'em-http-request'
,
'~> 1.0.3'
gem
'em-http-request'
,
'~> 1.0.3'
gem
'nginx_test_helper'
,
'~> 0.
0.1
'
gem
'nginx_test_helper'
,
'~> 0.
1.0
'
gem
'jshintrb'
,
'~> 0.2.1'
gem
'jshintrb'
,
'~> 0.2.1'
gem
'therubyracer'
,
'~> 0.11.3'
gem
'therubyracer'
,
'~> 0.11.3'
gem
'jasmine'
,
'~> 1.3.1'
gem
'jasmine'
,
'~> 1.3.1'
...
...
misc/Gemfile.lock
View file @
781c16b7
...
@@ -44,7 +44,7 @@ GEM
...
@@ -44,7 +44,7 @@ GEM
libv8 (3.11.8.13)
libv8 (3.11.8.13)
listen (0.7.2)
listen (0.7.2)
multi_json (1.5.0)
multi_json (1.5.0)
nginx_test_helper (0.
0.1
)
nginx_test_helper (0.
1.0
)
popen4
popen4
nokogiri (1.5.6)
nokogiri (1.5.6)
open4 (1.3.0)
open4 (1.3.0)
...
@@ -87,7 +87,7 @@ DEPENDENCIES
...
@@ -87,7 +87,7 @@ DEPENDENCIES
jshintrb (~> 0.2.1)
jshintrb (~> 0.2.1)
json (~> 1.7.6)
json (~> 1.7.6)
listen (~> 0.7.2)
listen (~> 0.7.2)
nginx_test_helper (~> 0.
0.1
)
nginx_test_helper (~> 0.
1.0
)
nokogiri (~> 1.5.6)
nokogiri (~> 1.5.6)
rake (~> 10.0.3)
rake (~> 10.0.3)
rb-inotify (~> 0.8.8)
rb-inotify (~> 0.8.8)
...
...
misc/spec/mix/channel_statistics_spec.rb
View file @
781c16b7
...
@@ -361,7 +361,7 @@ shared_examples_for "statistics location" do
...
@@ -361,7 +361,7 @@ shared_examples_for "statistics location" do
0
.
step
(
number_of_channels
-
1
,
1000
)
do
|
i
|
0
.
step
(
number_of_channels
-
1
,
1000
)
do
|
i
|
socket
=
open_socket
(
nginx_host
,
nginx_port
)
socket
=
open_socket
(
nginx_host
,
nginx_port
)
1
.
upto
(
1000
)
do
|
j
|
1
.
upto
(
1000
)
do
|
j
|
headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}#{
i
+
j
}
"
,
body
,
socket
,
"}
\r\n
"
)
headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}#{
i
+
j
}
"
,
body
,
socket
,
{
:wait_for
=>
"}
\r\n
"
}
)
headers
.
should
include
(
"HTTP/1.1 200 OK"
)
headers
.
should
include
(
"HTTP/1.1 200 OK"
)
end
end
socket
.
close
socket
.
close
...
@@ -506,7 +506,7 @@ shared_examples_for "statistics location" do
...
@@ -506,7 +506,7 @@ shared_examples_for "statistics location" do
0
.
step
(
number_of_channels
-
1
,
1000
)
do
|
i
|
0
.
step
(
number_of_channels
-
1
,
1000
)
do
|
i
|
socket
=
open_socket
(
nginx_host
,
nginx_port
)
socket
=
open_socket
(
nginx_host
,
nginx_port
)
1
.
upto
(
1000
)
do
|
j
|
1
.
upto
(
1000
)
do
|
j
|
headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}#{
i
+
j
}
"
,
body
,
socket
,
"}
\r\n
"
)
headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}#{
i
+
j
}
"
,
body
,
socket
,
{
:wait_for
=>
"}
\r\n
"
}
)
headers
.
should
include
(
"HTTP/1.1 200 OK"
)
headers
.
should
include
(
"HTTP/1.1 200 OK"
)
end
end
socket
.
close
socket
.
close
...
...
misc/spec/mix/keepalive_spec.rb
View file @
781c16b7
...
@@ -20,7 +20,7 @@ describe "Keepalive" do
...
@@ -20,7 +20,7 @@ describe "Keepalive" do
0
.
step
(
channels_to_be_created
-
1
,
500
)
do
|
i
|
0
.
step
(
channels_to_be_created
-
1
,
500
)
do
|
i
|
socket
=
open_socket
(
nginx_host
,
nginx_port
)
socket
=
open_socket
(
nginx_host
,
nginx_port
)
1
.
upto
(
500
)
do
|
j
|
1
.
upto
(
500
)
do
|
j
|
headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}#{
i
+
j
}
"
,
body
,
socket
,
"}
\r\n
"
)
headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}#{
i
+
j
}
"
,
body
,
socket
,
{
:wait_for
=>
"}
\r\n
"
}
)
headers
.
should
include
(
"HTTP/1.1 200 OK"
)
headers
.
should
include
(
"HTTP/1.1 200 OK"
)
end
end
socket
.
close
socket
.
close
...
@@ -39,7 +39,7 @@ describe "Keepalive" do
...
@@ -39,7 +39,7 @@ describe "Keepalive" do
body
.
should
eql
(
""
)
body
.
should
eql
(
""
)
headers
.
should
include
(
"No channel id provided."
)
headers
.
should
include
(
"No channel id provided."
)
headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}
"
,
content
,
socket
,
"}
\r\n
"
)
headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}
"
,
content
,
socket
,
{
:wait_for
=>
"}
\r\n
"
}
)
body
.
should
eql
(
"{
\"
channel
\"
:
\"
#{
channel
}
\"
,
\"
published_messages
\"
:
\"
1
\"
,
\"
stored_messages
\"
:
\"
1
\"
,
\"
subscribers
\"
:
\"
0
\"
}
\r\n
"
)
body
.
should
eql
(
"{
\"
channel
\"
:
\"
#{
channel
}
\"
,
\"
published_messages
\"
:
\"
1
\"
,
\"
stored_messages
\"
:
\"
1
\"
,
\"
subscribers
\"
:
\"
0
\"
}
\r\n
"
)
headers
,
body
=
get_in_socket
(
"/channels-stats"
,
socket
)
headers
,
body
=
get_in_socket
(
"/channels-stats"
,
socket
)
...
@@ -65,7 +65,7 @@ describe "Keepalive" do
...
@@ -65,7 +65,7 @@ describe "Keepalive" do
1
.
upto
(
500
)
do
|
j
|
1
.
upto
(
500
)
do
|
j
|
socket
.
print
(
get_messages
)
socket
.
print
(
get_messages
)
post_in_socket
(
"/pub?id=
#{
channel
}
"
,
"
#{
body_prefix
}
#{
j
.
to_s
.
rjust
(
3
,
'0'
)
}
"
,
socket_pub
,
"}
\r\n
"
)
post_in_socket
(
"/pub?id=
#{
channel
}
"
,
"
#{
body_prefix
}
#{
j
.
to_s
.
rjust
(
3
,
'0'
)
}
"
,
socket_pub
,
{
:wait_for
=>
"}
\r\n
"
}
)
headers
,
body
=
read_response_on_socket
(
socket
,
"
\r\n
0
\r\n\r\n
"
)
headers
,
body
=
read_response_on_socket
(
socket
,
"
\r\n
0
\r\n\r\n
"
)
body
.
should
eql
(
"18
\r\n
message to be sent
#{
j
.
to_s
.
rjust
(
3
,
'0'
)
}
\r\n\r\n
0
\r\n\r\n
"
)
body
.
should
eql
(
"18
\r\n
message to be sent
#{
j
.
to_s
.
rjust
(
3
,
'0'
)
}
\r\n\r\n
0
\r\n\r\n
"
)
end
end
...
...
misc/spec/mix/measure_memory_spec.rb
View file @
781c16b7
...
@@ -31,7 +31,7 @@ describe "Measure Memory" do
...
@@ -31,7 +31,7 @@ describe "Measure Memory" do
while
(
true
)
do
while
(
true
)
do
socket
.
print
(
post_channel_message
)
socket
.
print
(
post_channel_message
)
resp_headers
,
resp_body
=
read_response_on_socket
(
socket
,
"}
\r\n
"
)
resp_headers
,
resp_body
=
read_response_on_socket
(
socket
,
{
:wait_for
=>
"}
\r\n
"
}
)
break
unless
resp_headers
.
match
(
/200 OK/
)
break
unless
resp_headers
.
match
(
/200 OK/
)
end
end
socket
.
close
socket
.
close
...
@@ -62,7 +62,7 @@ describe "Measure Memory" do
...
@@ -62,7 +62,7 @@ describe "Measure Memory" do
while
(
true
)
do
while
(
true
)
do
post_channel_message
=
"POST /pub?id=
#{
channel
}
HTTP/1.0
\r\n
Content-Length:
#{
body
.
size
}
\r\n\r\n
#{
body
}
"
post_channel_message
=
"POST /pub?id=
#{
channel
}
HTTP/1.0
\r\n
Content-Length:
#{
body
.
size
}
\r\n\r\n
#{
body
}
"
socket
.
print
(
post_channel_message
)
socket
.
print
(
post_channel_message
)
resp_headers
,
resp_body
=
read_response_on_socket
(
socket
,
"}
\r\n
"
)
resp_headers
,
resp_body
=
read_response_on_socket
(
socket
,
{
:wait_for
=>
"}
\r\n
"
}
)
break
unless
resp_headers
.
match
(
/200 OK/
)
break
unless
resp_headers
.
match
(
/200 OK/
)
channel
+=
1
channel
+=
1
end
end
...
...
misc/spec/publisher/publish_messages_spec.rb
View file @
781c16b7
...
@@ -134,7 +134,7 @@ describe "Publisher Publishing Messages" do
...
@@ -134,7 +134,7 @@ describe "Publisher Publishing Messages" do
0
.
step
(
messagens_to_publish
-
1
,
500
)
do
|
i
|
0
.
step
(
messagens_to_publish
-
1
,
500
)
do
|
i
|
socket
=
open_socket
(
nginx_host
,
nginx_port
)
socket
=
open_socket
(
nginx_host
,
nginx_port
)
1
.
upto
(
500
)
do
|
j
|
1
.
upto
(
500
)
do
|
j
|
resp_headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}
"
,
body_prefix
+
(
i
+
j
).
to_s
,
socket
,
"}
\r\n
"
)
resp_headers
,
body
=
post_in_socket
(
"/pub?id=
#{
channel
}
"
,
body_prefix
+
(
i
+
j
).
to_s
,
socket
,
{
:wait_for
=>
"}
\r\n
"
}
)
fail
(
"Message was not published: "
+
body_prefix
+
(
i
+
j
).
to_s
)
unless
resp_headers
.
include?
(
"HTTP/1.1 200 OK"
)
fail
(
"Message was not published: "
+
body_prefix
+
(
i
+
j
).
to_s
)
unless
resp_headers
.
include?
(
"HTTP/1.1 200 OK"
)
end
end
socket
.
close
socket
.
close
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment