Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
2e503eaf
Commit
2e503eaf
authored
Jul 20, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test package status
parent
54f7c734
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
17 deletions
+27
-17
debomatic-webui/test/tests.coffee
debomatic-webui/test/tests.coffee
+27
-17
No files found.
debomatic-webui/test/tests.coffee
View file @
2e503eaf
...
@@ -15,7 +15,7 @@ exec = (c) ->
...
@@ -15,7 +15,7 @@ exec = (c) ->
exec_orig
(
c
)
exec_orig
(
c
)
launch_server
=
()
->
launch_server
=
()
->
server
=
spawn
(
'coffee'
,
[
'../debomatic-webui.coffee'
,
'-c'
,
'test
/test
s.config.coffee'
])
server
=
spawn
(
'coffee'
,
[
'../debomatic-webui.coffee'
,
'-c'
,
'tests.config.coffee'
])
server
.
stdout
.
on
'data'
,
(
data
)
->
console
.
log
(
'
\n
SERVER OUT: '
,
data
.
toString
(
'utf-8'
))
server
.
stdout
.
on
'data'
,
(
data
)
->
console
.
log
(
'
\n
SERVER OUT: '
,
data
.
toString
(
'utf-8'
))
server
.
stderr
.
on
'data'
,
(
data
)
->
console
.
error
(
'
\n
SERVER ERR'
,
data
.
toString
(
'utf-8'
))
server
.
stderr
.
on
'data'
,
(
data
)
->
console
.
error
(
'
\n
SERVER ERR'
,
data
.
toString
(
'utf-8'
))
server
.
on
'exit'
,
(
code
)
->
server
.
on
'exit'
,
(
code
)
->
...
@@ -79,7 +79,7 @@ class Helper
...
@@ -79,7 +79,7 @@ class Helper
helper
=
new
Helper
()
helper
=
new
Helper
()
launch_server
()
launch_server
()
if
process
.
env
.
SERVER
client
=
null
client
=
null
describe
'client'
,
->
describe
'client'
,
->
...
@@ -88,23 +88,32 @@ describe 'client', ->
...
@@ -88,23 +88,32 @@ describe 'client', ->
helper
.
make_distribution
(
'trusty'
)
helper
.
make_distribution
(
'trusty'
)
helper
.
make_distribution
(
'unstable'
)
helper
.
make_distribution
(
'unstable'
)
helper
.
append_json
(
'{"status": "build", "package": "test_1.2.3", "uploader": "", "distribution": "unstable"}'
)
helper
.
append_json
(
'{"status": "build", "package": "test_1.2.3", "uploader": "", "distribution": "unstable"}'
)
)
beforeEach
(
->
client
=
io
.
connect
(
"http://
#{
config
.
host
}
:
#{
config
.
port
}
"
)
client
=
io
.
connect
(
"http://
#{
config
.
host
}
:
#{
config
.
port
}
"
)
)
)
describe
'on connecting'
,
->
afterEach
(
->
it
'get distributions'
,
->
client
.
disconnect
()
client
.
on
events
.
broadcast
.
distributions
,
(
data
)
->
)
data
.
should
.
be
.
eql
([
'trusty'
,
'unstable'
])
it
'get distributions'
,
(
done
)
->
client
.
on
events
.
broadcast
.
distributions
,
(
data
)
->
data
.
should
.
be
.
eql
([
'trusty'
,
'unstable'
])
done
()
it
'get debomatic status'
,
->
it
'get debomatic status'
,
(
done
)
->
client
.
on
events
.
broadcast
.
status_debomatic
,
(
data
)
->
client
.
on
events
.
broadcast
.
status_debomatic
,
(
data
)
->
data
.
running
.
should
.
be
.
false
data
.
running
.
should
.
be
.
false
done
()
it
'get package status'
,
->
it
'get package status'
,
(
done
)
->
client
.
on
events
.
broadcast
.
status
,
(
data
)
->
client
.
on
events
.
broadcast
.
status
,
(
data
)
->
data
.
status
.
should
.
be
.
eql
(
'build'
)
data
.
status
.
should
.
be
.
eql
(
'build'
)
data
.
distribution
.
should
.
be
.
eql
(
'unstable'
)
data
.
distribution
.
should
.
be
.
eql
(
'unstable'
)
data
.
package
.
should
.
be
.
eql
(
'test_1.2.3'
)
data
.
package
.
should
.
be
.
eql
(
'test_1.2.3'
)
done
()
it
'on getting distribution packages'
,
->
it
'on getting distribution packages'
,
->
helper
.
make_package
(
'unstable'
,
'test_1.2.3'
)
helper
.
make_package
(
'unstable'
,
'test_1.2.3'
)
...
@@ -139,7 +148,7 @@ describe 'client', ->
...
@@ -139,7 +148,7 @@ describe 'client', ->
data
.
file
.
name
.
should
.
be
.
eql
(
'buildlog'
)
data
.
file
.
name
.
should
.
be
.
eql
(
'buildlog'
)
data
.
file
.
content
.
should
.
be
.
eql
(
'this is a test
\n
'
)
data
.
file
.
content
.
should
.
be
.
eql
(
'this is a test
\n
'
)
it
'new content'
,
->
it
'new content'
,
(
done
)
->
client
.
on
events
.
client
.
file_newcontent
,
(
data
)
->
client
.
on
events
.
client
.
file_newcontent
,
(
data
)
->
data
.
distribution
.
name
.
should
.
be
.
eql
(
'unstable'
)
data
.
distribution
.
name
.
should
.
be
.
eql
(
'unstable'
)
data
.
package
.
orig_name
.
should
.
be
.
eql
(
'test_1.2.3'
)
data
.
package
.
orig_name
.
should
.
be
.
eql
(
'test_1.2.3'
)
...
@@ -149,13 +158,14 @@ describe 'client', ->
...
@@ -149,13 +158,14 @@ describe 'client', ->
helper
.
append_file
(
'unstable'
,
'test_1.2.3'
,
'buildlog'
,
'this is an appending test'
)
helper
.
append_file
(
'unstable'
,
'test_1.2.3'
,
'buildlog'
,
'this is an appending test'
)
describe
'on build package ends'
,
->
describe
'on build package ends'
,
->
it
'should receive a status update'
,
->
it
'should receive a status update'
,
(
done
)
->
str
=
'{"status": "build", "success": true, "package": "test_1.2.3", "uploader": "", "distribution": "unstable"}'
str
=
'{"status": "build", "success": true, "package": "test_1.2.3", "uploader": "", "distribution": "unstable"}'
helper
.
append_json
(
str
)
helper
.
append_json
(
str
)
client
.
on
events
.
broadcast
.
status_update
,
(
data
)
->
client
.
on
events
.
broadcast
.
status_update
,
(
data
)
->
data
.
success
.
should
.
not
.
be
.
ok
data
.
success
.
should
.
not
.
be
.
ok
done
()
process
.
on
'exit'
,
()
->
process
.
on
'exit'
,
()
->
client
.
disconnect
()
client
.
disconnect
()
helper
.
clean_all
()
helper
.
clean_all
()
server
.
kill
()
server
.
kill
()
if
process
.
env
.
SERVER
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