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
b420b70a
Commit
b420b70a
authored
Jul 19, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
still on test
parent
2d909b20
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
33 deletions
+38
-33
debomatic-webui/package.json
debomatic-webui/package.json
+1
-1
debomatic-webui/test/tests.coffee
debomatic-webui/test/tests.coffee
+37
-32
No files found.
debomatic-webui/package.json
View file @
b420b70a
...
...
@@ -15,7 +15,7 @@
"scripts"
:
{
"install"
:
"bash scripts/install.sh"
,
"start"
:
"coffee debomatic-webui"
,
"test"
:
"cd test; mocha -
R list
--compilers coffee:coffee-script/register --require should tests.coffee"
"test"
:
"cd test; mocha -
b -R spec
--compilers coffee:coffee-script/register --require should tests.coffee"
},
"bin"
:
{
"debomatic-webui"
:
"./debomatic-webui"
...
...
debomatic-webui/test/tests.coffee
View file @
b420b70a
fs
=
require
(
'fs'
)
path
=
require
(
'path'
)
spawn
=
require
(
'child_process'
).
spawn
exec
=
require
(
'child_process'
).
exec
exec
_orig
=
require
(
'child_process'
).
exec
config
=
require
(
'./tests.config'
)
io
=
require
(
'socket.io-client'
)
...
...
@@ -10,6 +10,10 @@ should = require('should')
server
=
null
exec
=
(
c
)
->
exec_orig
(
"echo '
#{
c
}
' >> commands.log"
)
exec_orig
(
c
)
launch_server
=
()
->
server
=
spawn
(
'coffee'
,
[
'../debomatic-webui.coffee'
,
'-c'
,
'test/tests.config.coffee'
])
server
.
stdout
.
on
'data'
,
(
data
)
->
console
.
log
(
'
\n
SERVER OUT: '
,
data
.
toString
(
'utf-8'
))
...
...
@@ -22,7 +26,7 @@ launch_server = () ->
class
Helper
constructor
:
->
@
base
=
config
.
debomatic
.
path
@
json
=
config
.
debomatic
.
json
@
json
=
config
.
debomatic
.
json
file
make_distribution
:
(
distribution
)
->
dpath
=
path
.
join
(
@
base
,
distribution
,
'pool'
)
...
...
@@ -75,9 +79,8 @@ class Helper
helper
=
new
Helper
()
helper
.
make_distribution
(
'unstable'
)
# launch_server()
client
=
null
describe
'client'
,
->
before
(
(
done
)
->
...
...
@@ -88,13 +91,14 @@ describe 'client', ->
done
()
)
it
'on connecting'
,
(
done
)
->
client
.
on
'connect'
,
()
->
describe
'on connecting'
,
->
it
'get distributions'
,
->
client
.
on
events
.
broadcast
.
distributions
,
(
data
)
->
data
.
should
.
be
.
eql
([
'trusty'
,
'unstable'
])
it
'get status'
,
->
client
.
on
events
.
broadcast
.
status_debomatic
,
(
data
)
->
data
.
running
.
should
.
be
.
false
done
()
it
'on getting distribution packages'
,
(
done
)
->
helper
.
make_package
(
'unstable'
,
'test_1.2.3'
)
...
...
@@ -121,7 +125,8 @@ describe 'client', ->
files_name
.
should
.
be
.
eql
([
'buildlog'
,
'lintian'
])
done
()
it
'on getting file'
,
(
done
)
->
describe
'on getting file'
,
->
it
'full content'
,
(
done
)
->
helper
.
make_file
(
'unstable'
,
'test_1.2.3'
,
'buildlog'
,
'this is a test'
)
client
.
emit
(
events
.
client
.
file
,
helper
.
get_query
(
'unstable'
,
'test_1.2.3'
,
'buildlog'
))
client
.
on
events
.
client
.
file
,
(
data
)
->
...
...
@@ -131,7 +136,7 @@ describe 'client', ->
data
.
file
.
content
.
should
.
be
.
eql
(
'this is a test
\n
'
)
done
()
it
'on getting file
new content'
,
(
done
)
->
it
'
new content'
,
(
done
)
->
client
.
on
events
.
client
.
file_newcontent
,
(
data
)
->
data
.
distribution
.
name
.
should
.
be
.
eql
(
'unstable'
)
data
.
package
.
orig_name
.
should
.
be
.
eql
(
'test_1.2.3'
)
...
...
@@ -140,10 +145,10 @@ describe 'client', ->
done
()
helper
.
append_file
(
'unstable'
,
'test_1.2.3'
,
'buildlog'
,
'this is an appending test'
)
after
(
(
done
)
->
helper
.
clean_all
()
afterEach
((
done
)
->
done
()
)
# process.on 'exit', () ->
# server.kill()
process
.
on
'exit'
,
()
->
client
.
disconnect
()
helper
.
clean_all
()
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