moar specs. test setup still fucked
This commit is contained in:
parent
fb618f05a7
commit
ba0e3827de
|
@ -13,22 +13,13 @@ Travis.reopen
|
||||||
@connectOutlet(outletName: 'top', controller: @topController, viewClass: Travis.TopView)
|
@connectOutlet(outletName: 'top', controller: @topController, viewClass: Travis.TopView)
|
||||||
@topController.set('tab', @get('name'))
|
@topController.set('tab', @get('name'))
|
||||||
|
|
||||||
BuildsController: Em.ArrayController.extend
|
|
||||||
repositoryBinding: 'parent.repository'
|
|
||||||
contentBinding: 'parent.builds'
|
|
||||||
|
|
||||||
QueuesController: Em.ArrayController.extend()
|
|
||||||
UserController: Em.Controller.extend()
|
|
||||||
HooksController: Em.ArrayController.extend()
|
|
||||||
|
|
||||||
# TopController: Em.Controller.extend
|
# TopController: Em.Controller.extend
|
||||||
# userBinding: 'Travis.app.currentUser'
|
# userBinding: 'Travis.app.currentUser'
|
||||||
|
|
||||||
|
require 'controllers/builds'
|
||||||
require 'controllers/home'
|
require 'controllers/home'
|
||||||
require 'controllers/profile'
|
require 'controllers/profile'
|
||||||
require 'controllers/repository'
|
|
||||||
require 'controllers/repositories'
|
require 'controllers/repositories'
|
||||||
|
require 'controllers/repository'
|
||||||
require 'controllers/sidebar'
|
require 'controllers/sidebar'
|
||||||
require 'controllers/sponsors'
|
|
||||||
require 'controllers/stats'
|
require 'controllers/stats'
|
||||||
require 'controllers/workers'
|
|
||||||
|
|
7
assets/javascripts/app/controllers/builds.coffee
Normal file
7
assets/javascripts/app/controllers/builds.coffee
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Travis.BuildsController = Em.ArrayController.extend
|
||||||
|
# sortAscending: false
|
||||||
|
|
||||||
|
repositoryBinding: 'parent.repository'
|
||||||
|
contentBinding: 'parent.builds'
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,24 @@
|
||||||
Travis.ProfileController = Travis.Controller.extend
|
Travis.reopen
|
||||||
name: 'profile'
|
ProfileController: Travis.Controller.extend
|
||||||
|
name: 'profile'
|
||||||
|
|
||||||
init: ->
|
init: ->
|
||||||
@_super('top', 'user', 'hooks')
|
@_super('top', 'user', 'hooks')
|
||||||
|
|
||||||
connect: (parent) ->
|
connect: (parent) ->
|
||||||
@_super(parent)
|
@_super(parent)
|
||||||
@connectTop()
|
@connectTop()
|
||||||
|
|
||||||
viewShow: (params) ->
|
viewShow: (params) ->
|
||||||
@connectUser(@currentUser)
|
@connectUser(@currentUser)
|
||||||
@connectHooks(Travis.Hook.find())
|
@connectHooks(Travis.Hook.find())
|
||||||
|
|
||||||
connectUser: (user) ->
|
connectUser: (user) ->
|
||||||
@profileController.connectOutlet(outletName: 'main', name: 'user', context: user)
|
@profileController.connectOutlet(outletName: 'main', name: 'user', context: user)
|
||||||
|
|
||||||
connectHooks: (hooks) ->
|
connectHooks: (hooks) ->
|
||||||
@userController.connectOutlet(outletName: 'hooks', name: 'hooks', context: hooks) if hooks
|
@userController.connectOutlet(outletName: 'hooks', name: 'hooks', context: hooks) if hooks
|
||||||
|
|
||||||
|
UserController: Em.Controller.extend()
|
||||||
|
HooksController: Em.ArrayController.extend()
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ Travis.RepositoryController = Travis.Controller.extend
|
||||||
activate: (action, params) ->
|
activate: (action, params) ->
|
||||||
@_unbind()
|
@_unbind()
|
||||||
@setParams(params)
|
@setParams(params)
|
||||||
# console.log "view#{$.camelize(action)}"
|
|
||||||
this["view#{$.camelize(action)}"]()
|
this["view#{$.camelize(action)}"]()
|
||||||
|
|
||||||
viewIndex: ->
|
viewIndex: ->
|
||||||
|
@ -17,14 +16,14 @@ Travis.RepositoryController = Travis.Controller.extend
|
||||||
@connectTab('current')
|
@connectTab('current')
|
||||||
|
|
||||||
viewCurrent: ->
|
viewCurrent: ->
|
||||||
|
@connectTab('current')
|
||||||
@_bind('repository', 'repositoriesByParams.firstObject')
|
@_bind('repository', 'repositoriesByParams.firstObject')
|
||||||
@_bind('build', 'repository.lastBuild')
|
@_bind('build', 'repository.lastBuild')
|
||||||
@connectTab('current')
|
|
||||||
|
|
||||||
viewBuilds: ->
|
viewBuilds: ->
|
||||||
|
@connectTab('builds')
|
||||||
@_bind('repository', 'repositoriesByParams.firstObject')
|
@_bind('repository', 'repositoriesByParams.firstObject')
|
||||||
@_bind('builds', 'repository.builds')
|
@_bind('builds', 'repository.builds')
|
||||||
@connectTab('builds')
|
|
||||||
|
|
||||||
viewBuild: ->
|
viewBuild: ->
|
||||||
@_bind('repository', 'repositoriesByParams.firstObject')
|
@_bind('repository', 'repositoriesByParams.firstObject')
|
||||||
|
|
|
@ -1,35 +1,75 @@
|
||||||
Travis.SidebarController = Em.ArrayController.extend
|
Travis.reopen
|
||||||
init: ->
|
SidebarController: Em.ArrayController.extend
|
||||||
@tickables = []
|
init: ->
|
||||||
Travis.Ticker.create(target: this, interval: Travis.INTERVALS.sponsors)
|
@tickables = []
|
||||||
|
Travis.Ticker.create(target: this, interval: Travis.INTERVALS.sponsors)
|
||||||
|
|
||||||
@connectWorkers(Travis.Worker.find())
|
@connectWorkers(Travis.Worker.find())
|
||||||
@connectQueues(Travis.QUEUES)
|
@connectQueues(Travis.QUEUES)
|
||||||
|
|
||||||
@connectSponsors('decks', Travis.Sponsor.decks(), 1)
|
@connectSponsors('decks', Travis.Sponsor.decks(), 1)
|
||||||
@connectSponsors('links', Travis.Sponsor.links(), 6)
|
@connectSponsors('links', Travis.Sponsor.links(), 6)
|
||||||
|
|
||||||
connectSponsors: (name, sponsors, perPage) ->
|
connectSponsors: (name, sponsors, perPage) ->
|
||||||
controller = Travis.SponsorsController.create(perPage: perPage, content: sponsors)
|
controller = Travis.SponsorsController.create(perPage: perPage, content: sponsors)
|
||||||
viewClass = Em.View.extend(templateName: "sponsors/#{name}")
|
viewClass = Em.View.extend(templateName: "sponsors/#{name}")
|
||||||
@connectOutlet(outletName: name, controller: controller, viewClass: viewClass)
|
@connectOutlet(outletName: name, controller: controller, viewClass: viewClass)
|
||||||
@tickables.push(controller)
|
@tickables.push(controller)
|
||||||
|
|
||||||
connectWorkers: (workers) ->
|
connectWorkers: (workers) ->
|
||||||
controller = Travis.WorkersController.create(content: workers)
|
controller = Travis.WorkersController.create(content: workers)
|
||||||
viewClass = Em.View.extend(templateName: 'workers/list')
|
viewClass = Em.View.extend(templateName: 'workers/list')
|
||||||
@connectOutlet(outletName: 'workers', controller: controller, viewClass: viewClass)
|
@connectOutlet(outletName: 'workers', controller: controller, viewClass: viewClass)
|
||||||
|
|
||||||
connectQueues: (queues) ->
|
connectQueues: (queues) ->
|
||||||
queues = for queue in queues
|
queues = for queue in queues
|
||||||
Em.ArrayController.create
|
Em.ArrayController.create
|
||||||
content: Travis.Job.queued(queue.name)
|
content: Travis.Job.queued(queue.name)
|
||||||
name: queue.display
|
name: queue.display
|
||||||
controller = Travis.QueuesController.create(content: queues)
|
controller = Travis.QueuesController.create(content: queues)
|
||||||
viewClass = Em.View.extend(templateName: 'queues/list')
|
viewClass = Em.View.extend(templateName: 'queues/list')
|
||||||
@connectOutlet(outletName: 'queues', controller: controller, viewClass: viewClass)
|
@connectOutlet(outletName: 'queues', controller: controller, viewClass: viewClass)
|
||||||
|
|
||||||
tick: ->
|
tick: ->
|
||||||
tickable.tick() for tickable in @tickables
|
tickable.tick() for tickable in @tickables
|
||||||
|
|
||||||
|
QueuesController: Em.ArrayController.extend()
|
||||||
|
|
||||||
|
WorkersController: Em.ArrayController.extend
|
||||||
|
groups: (->
|
||||||
|
groups = {}
|
||||||
|
for worker in @get('content').toArray()
|
||||||
|
host = worker.get('host')
|
||||||
|
groups[host] = Em.ArrayProxy.create(content: []) if !(host in groups)
|
||||||
|
groups[host].pushObject(worker)
|
||||||
|
$.values(groups)
|
||||||
|
).property('content.length')
|
||||||
|
|
||||||
|
SponsorsController: Em.ArrayController.extend
|
||||||
|
page: 0
|
||||||
|
|
||||||
|
arrangedContent: (->
|
||||||
|
@get('shuffled').slice(@start(), @end())
|
||||||
|
).property('shuffled.length', 'page')
|
||||||
|
|
||||||
|
shuffled: (->
|
||||||
|
if content = @get('content') then $.shuffle(content) else []
|
||||||
|
).property('content.length')
|
||||||
|
|
||||||
|
tick: ->
|
||||||
|
@set('page', if @isLast() then 0 else @get('page') + 1)
|
||||||
|
|
||||||
|
pages: (->
|
||||||
|
length = @getPath('content.length')
|
||||||
|
if length then parseInt(length / @get('perPage') + 1) else 1
|
||||||
|
).property('length')
|
||||||
|
|
||||||
|
isLast: ->
|
||||||
|
@get('page') == @get('pages') - 1
|
||||||
|
|
||||||
|
start: ->
|
||||||
|
@get('page') * @get('perPage')
|
||||||
|
|
||||||
|
end: ->
|
||||||
|
@start() + @get('perPage')
|
||||||
|
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
Travis.SponsorsController = Em.ArrayController.extend
|
|
||||||
page: 0
|
|
||||||
|
|
||||||
arrangedContent: (->
|
|
||||||
@get('shuffled').slice(@start(), @end())
|
|
||||||
).property('shuffled.length', 'page')
|
|
||||||
|
|
||||||
shuffled: (->
|
|
||||||
if content = @get('content') then $.shuffle(content) else []
|
|
||||||
).property('content.length')
|
|
||||||
|
|
||||||
tick: ->
|
|
||||||
@set('page', if @isLast() then 0 else @get('page') + 1)
|
|
||||||
|
|
||||||
pages: (->
|
|
||||||
length = @getPath('content.length')
|
|
||||||
if length then parseInt(length / @get('perPage') + 1) else 1
|
|
||||||
).property('length')
|
|
||||||
|
|
||||||
isLast: ->
|
|
||||||
@get('page') == @get('pages') - 1
|
|
||||||
|
|
||||||
start: ->
|
|
||||||
@get('page') * @get('perPage')
|
|
||||||
|
|
||||||
end: ->
|
|
||||||
@start() + @get('perPage')
|
|
|
@ -1,10 +0,0 @@
|
||||||
Travis.WorkersController = Em.ArrayController.extend
|
|
||||||
groups: (->
|
|
||||||
groups = {}
|
|
||||||
for worker in @get('content').toArray()
|
|
||||||
host = worker.get('host')
|
|
||||||
groups[host] = Em.ArrayProxy.create(content: []) if !(host in groups)
|
|
||||||
groups[host].pushObject(worker)
|
|
||||||
$.values(groups)
|
|
||||||
).property('content.length')
|
|
||||||
|
|
|
@ -1,36 +1,34 @@
|
||||||
require 'travis/model'
|
require 'travis/model'
|
||||||
|
|
||||||
@Travis.Build = Travis.Model.extend
|
@Travis.Build = Travis.Model.extend
|
||||||
|
eventType: DS.attr('string')
|
||||||
repositoryId: DS.attr('number')
|
repositoryId: DS.attr('number')
|
||||||
commitId: DS.attr('number')
|
commitId: DS.attr('number')
|
||||||
|
|
||||||
state: DS.attr('string')
|
state: DS.attr('string')
|
||||||
number: DS.attr('number')
|
number: DS.attr('number')
|
||||||
branch: DS.attr('string')
|
branch: DS.attr('string')
|
||||||
message: DS.attr('string')
|
message: DS.attr('string')
|
||||||
result: DS.attr('number')
|
result: DS.attr('number')
|
||||||
duration: DS.attr('number')
|
duration: DS.attr('number')
|
||||||
started_at: DS.attr('string')
|
startedAt: DS.attr('string')
|
||||||
finished_at: DS.attr('string')
|
finishedAt: DS.attr('string')
|
||||||
committed_at: DS.attr('string')
|
|
||||||
committer_name: DS.attr('string')
|
# committedAt: DS.attr('string')
|
||||||
committer_email: DS.attr('string')
|
# committerName: DS.attr('string')
|
||||||
author_name: DS.attr('string')
|
# committerEmail: DS.attr('string')
|
||||||
author_email: DS.attr('string')
|
# authorName: DS.attr('string')
|
||||||
compare_url: DS.attr('string')
|
# authorEmail: DS.attr('string')
|
||||||
|
# compareUrl: DS.attr('string')
|
||||||
|
|
||||||
repository: DS.belongsTo('Travis.Repository', key: 'repository_id')
|
repository: DS.belongsTo('Travis.Repository', key: 'repository_id')
|
||||||
commit: DS.belongsTo('Travis.Commit')
|
commit: DS.belongsTo('Travis.Commit')
|
||||||
# jobs: DS.hasMany('Travis.Job')
|
jobs: DS.hasMany('Travis.Job', key: 'job_ids')
|
||||||
|
|
||||||
config: (->
|
config: (->
|
||||||
@getPath 'data.config'
|
@getPath 'data.config'
|
||||||
).property('data.config')
|
).property('data.config')
|
||||||
|
|
||||||
# TODO why does the hasMany association not work?
|
|
||||||
jobs: (->
|
|
||||||
Travis.Job.findMany(@getPath('data.job_ids') || [])
|
|
||||||
).property('data.job_ids.length')
|
|
||||||
|
|
||||||
isMatrix: (->
|
isMatrix: (->
|
||||||
@getPath('data.job_ids.length') > 1
|
@getPath('data.job_ids.length') > 1
|
||||||
).property('data.job_ids.length')
|
).property('data.job_ids.length')
|
||||||
|
|
|
@ -2,22 +2,23 @@ require 'travis/model'
|
||||||
|
|
||||||
@Travis.Job = Travis.Model.extend
|
@Travis.Job = Travis.Model.extend
|
||||||
repositoryId: DS.attr('number')
|
repositoryId: DS.attr('number')
|
||||||
commitId: DS.attr('number')
|
|
||||||
buildId: DS.attr('number')
|
buildId: DS.attr('number')
|
||||||
|
commitId: DS.attr('number')
|
||||||
logId: DS.attr('number')
|
logId: DS.attr('number')
|
||||||
|
|
||||||
queue: DS.attr('string')
|
queue: DS.attr('string')
|
||||||
state: DS.attr('string')
|
state: DS.attr('string')
|
||||||
number: DS.attr('string')
|
number: DS.attr('string')
|
||||||
result: DS.attr('number')
|
result: DS.attr('number')
|
||||||
duration: DS.attr('number')
|
duration: DS.attr('number')
|
||||||
started_at: DS.attr('string')
|
startedAt: DS.attr('string')
|
||||||
finished_at: DS.attr('string')
|
finishedAt: DS.attr('string')
|
||||||
allow_failure: DS.attr('boolean')
|
allowFailure: DS.attr('boolean')
|
||||||
|
|
||||||
repository: DS.belongsTo('Travis.Repository')
|
repository: DS.belongsTo('Travis.Repository', key: 'repository_id')
|
||||||
commit: DS.belongsTo('Travis.Commit')
|
build: DS.belongsTo('Travis.Build', key: 'build_id')
|
||||||
build: DS.belongsTo('Travis.Build')
|
commit: DS.belongsTo('Travis.Commit', key: 'commit_id')
|
||||||
log: DS.belongsTo('Travis.Artifact')
|
log: DS.belongsTo('Travis.Artifact', key: 'log_id')
|
||||||
|
|
||||||
config: (->
|
config: (->
|
||||||
@getPath 'data.config'
|
@getPath 'data.config'
|
||||||
|
|
|
@ -14,11 +14,15 @@ require 'travis/model'
|
||||||
lastBuild: DS.belongsTo('Travis.Build')
|
lastBuild: DS.belongsTo('Travis.Build')
|
||||||
|
|
||||||
builds: (->
|
builds: (->
|
||||||
Travis.Build.byRepositoryId @get('id'), event_type: 'push'
|
id = @get('id')
|
||||||
|
Travis.Build.byRepositoryId id, event_type: 'push'
|
||||||
|
Travis.Build.filter (data) -> parseInt(data.get('repository_id')) == id && data.get('event_type') == 'push'
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
pullRequests: (->
|
pullRequests: (->
|
||||||
Travis.Build.byRepositoryId @get('id'), event_type: 'pull_request'
|
id = @get('id')
|
||||||
|
Travis.Build.byRepositoryId id, event_type: 'pull_request'
|
||||||
|
Travis.Build.filter (data) -> parseInt(data.get('repository_id')) == id && data.get('event_type') == 'pull_request'
|
||||||
).property()
|
).property()
|
||||||
|
|
||||||
branches: (->
|
branches: (->
|
||||||
|
|
|
@ -19,9 +19,17 @@ Travis.Store = DS.Store.extend
|
||||||
root = type.singularName()
|
root = type.singularName()
|
||||||
@adapter.sideload(store, type, json, root)
|
@adapter.sideload(store, type, json, root)
|
||||||
type.load(json[root])
|
type.load(json[root])
|
||||||
|
@_updateAssociations(type, json[root])
|
||||||
|
|
||||||
_loadMany: (store, type, json) ->
|
# _loadMany: (store, type, json) ->
|
||||||
root = type.pluralName()
|
# root = type.pluralName()
|
||||||
@adapter.sideload(store, type, json, root)
|
# @adapter.sideload(store, type, json, root)
|
||||||
@loadMany(type, json[root])
|
# @loadMany(type, json[root])
|
||||||
|
|
||||||
|
_updateAssociations: (type, data) ->
|
||||||
|
Em.get(type, 'associationsByName').forEach (key, meta) =>
|
||||||
|
if meta.kind == 'belongsTo' && id = data["#{key}_id"]
|
||||||
|
parent = type.find(data.id).getPath("#{key}.data")
|
||||||
|
ids = parent.get("#{root}_ids")
|
||||||
|
parent.set("#{root}_ids", ids.concat(data.id)) if ids && !(data.id in ids)
|
||||||
|
|
||||||
|
|
|
@ -1,37 +1,31 @@
|
||||||
{{#if builds.isLoaded}}
|
<table id="builds" class="list">
|
||||||
<table id="builds" class="list">
|
<thead>
|
||||||
<thead>
|
<tr>
|
||||||
<tr>
|
<th>{{t builds.name}}</th>
|
||||||
<th>{{t builds.name}}</th>
|
<th>{{t builds.commit}}</th>
|
||||||
<th>{{t builds.commit}}</th>
|
<th>{{t builds.message}}</th>
|
||||||
<th>{{t builds.message}}</th>
|
<th>{{t builds.duration}}</th>
|
||||||
<th>{{t builds.duration}}</th>
|
<th>{{t builds.finished_at}}</th>
|
||||||
<th>{{t builds.finished_at}}</th>
|
</tr>
|
||||||
</tr>
|
</thead>
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each build in builds}}
|
{{#each build in builds}}
|
||||||
{{#view Travis.BuildsItemView contextBinding="build"}}
|
{{#view Travis.BuildsItemView contextBinding="build"}}
|
||||||
<tr {{bindAttr class="view.color"}}>
|
<tr {{bindAttr class="view.color"}}>
|
||||||
<td class="number"><a {{bindAttr href="view.urlBuild"}}>{{number}}</a></td>
|
<td class="number"><a {{bindAttr href="view.urlBuild"}}>{{number}}</a></td>
|
||||||
<td class="commit"><a {{bindAttr href="view.urlGithubCommit"}}>{{formatCommit commit}}</a></td>
|
<td class="commit"><a {{bindAttr href="view.urlGithubCommit"}}>{{formatCommit commit}}</a></td>
|
||||||
<td class="message">{{{formatMessage commit.message short="true"}}}</td>
|
<td class="message">{{{formatMessage commit.message short="true"}}}</td>
|
||||||
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
|
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
|
||||||
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finishedAt}}</td>
|
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finishedAt}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/view}}
|
{{/view}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<button {{action showMore on="click" target="builds" isVisibleBinding="hasMore"}}>
|
<button {{action showMore on="click" target="builds" isVisibleBinding="hasMore"}}>
|
||||||
{{t builds.show_more}}
|
{{t builds.show_more}}
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
{{else}}
|
|
||||||
<div id="builds" class="loading">
|
|
||||||
<span>Loading</span>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<dt>{{t builds.name}}</dt>
|
<dt>{{t builds.name}}</dt>
|
||||||
<dd class="number"><a {{bindAttr href="urlBuild"}}>{{build.number}}</a></dd>
|
<dd class="number"><a {{bindAttr href="urlBuild"}}>{{build.number}}</a></dd>
|
||||||
<dt class="finished_at_label">{{t builds.finished_at}}</dt>
|
<dt class="finished_at_label">{{t builds.finished_at}}</dt>
|
||||||
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime build.finished_at}}</dd>
|
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime build.finishedAt}}</dd>
|
||||||
<dt>{{t builds.duration}}</dt>
|
<dt>{{t builds.duration}}</dt>
|
||||||
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration build.duration}}</dd>
|
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration build.duration}}</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,58 +1,56 @@
|
||||||
{{#with view}}
|
{{#if view.jobs.length}}
|
||||||
{{#if jobs.length}}
|
{{#if view.required}}
|
||||||
{{#if required}}
|
<table id="jobs" class="list">
|
||||||
<table id="jobs" class="list">
|
<caption>
|
||||||
<caption>
|
{{t jobs.build_matrix}}
|
||||||
{{t jobs.build_matrix}}
|
</caption>
|
||||||
</caption>
|
{{else}}
|
||||||
{{else}}
|
<table id="allowed_failure_jobs" class="list">
|
||||||
<table id="allowed_failure_jobs" class="list">
|
<caption>
|
||||||
<caption>
|
{{t jobs.allowed_failures}}
|
||||||
{{t jobs.allowed_failures}}
|
<a title="What's this?" class="help" {{action toggleHelp}}></a>
|
||||||
<a title="What's this?" class="help" {{action toggleHelp}}></a>
|
</caption>
|
||||||
</caption>
|
{{/if}}
|
||||||
{{/if}}
|
<thead>
|
||||||
<thead>
|
<tr>
|
||||||
<tr>
|
{{#each key in view.build.configKeys}}
|
||||||
{{#each build.configKeys}}
|
<th>{{key}}</th>
|
||||||
<th>{{this}}</th>
|
|
||||||
{{/each}}
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{{#each job in jobs}}
|
|
||||||
{{#view Travis.JobsItemView contextBinding="job"}}
|
|
||||||
<tr {{bindAttr class="view.color"}}>
|
|
||||||
<td class="number"><a {{bindAttr href="view.urlJob"}}>{{number}}</a></td>
|
|
||||||
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
|
|
||||||
<td class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime finished_at}}</td>
|
|
||||||
{{#each configValues}}
|
|
||||||
<td>{{this}}</td>
|
|
||||||
{{/each}}
|
|
||||||
</tr>
|
|
||||||
{{/view}}
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tr>
|
||||||
</table>
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each job in view.jobs}}
|
||||||
|
{{#view Travis.JobsItemView contextBinding="job"}}
|
||||||
|
<tr {{bindAttr class="view.color"}}>
|
||||||
|
<td class="number"><a {{bindAttr href="view.urlJob"}}>{{number}}</a></td>
|
||||||
|
<td class="duration" {{bindAttr title="started_at"}}>{{formatDuration duration}}</td>
|
||||||
|
<td class="finished_at timeago" {{bindAttr title="finishedAt"}}>{{formatTime finishedAt}}</td>
|
||||||
|
{{#each value in configValues}}
|
||||||
|
<td>{{value}}</td>
|
||||||
|
{{/each}}
|
||||||
|
</tr>
|
||||||
|
{{/view}}
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
{{#unless required}}
|
{{#unless required}}
|
||||||
<div id="allow_failure_help" class="context_help">
|
<div id="allow_failure_help" class="context_help">
|
||||||
<div class="context_help_caption">{{t "jobs.allowed_failures"}}</div>
|
<div class="context_help_caption">{{t "jobs.allowed_failures"}}</div>
|
||||||
<div class="context_help_body">
|
<div class="context_help_body">
|
||||||
<p>
|
<p>
|
||||||
Allowed Failures are items in your build matrix that are allowed to
|
Allowed Failures are items in your build matrix that are allowed to
|
||||||
fail without causing the entire build to be shown as failed. This lets you add
|
fail without causing the entire build to be shown as failed. This lets you add
|
||||||
in experimental and preparatory builds to test against versions or
|
in experimental and preparatory builds to test against versions or
|
||||||
configurations that you are not ready to officially support.
|
configurations that you are not ready to officially support.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
You can define allowed failures in the build matrix as follows:
|
You can define allowed failures in the build matrix as follows:
|
||||||
</p>
|
</p>
|
||||||
<pre> matrix:
|
<pre> matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rvm: ruby-head </pre>
|
- rvm: ruby-head </pre>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
</div>
|
||||||
{{/if}}
|
{{/unless}}
|
||||||
{{/with}}
|
{{/if}}
|
||||||
|
|
|
@ -6,17 +6,17 @@
|
||||||
<dt>Job</dt>
|
<dt>Job</dt>
|
||||||
<dd class="number"><a {{bindAttr href="view.urlJob"}}>{{job.number}}</a></dd>
|
<dd class="number"><a {{bindAttr href="view.urlJob"}}>{{job.number}}</a></dd>
|
||||||
<dt class="finished_at_label">{{t jobs.finished_at}}</dt>
|
<dt class="finished_at_label">{{t jobs.finished_at}}</dt>
|
||||||
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime job.finished_at}}</dd>
|
<dd class="finished_at timeago" {{bindAttr title="finished_at"}}>{{formatTime job.finishedAt}}</dd>
|
||||||
<dt>{{t jobs.duration}}</dt>
|
<dt>{{t jobs.duration}}</dt>
|
||||||
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration job.duration}}</dd>
|
<dd class="duration" {{bindAttr title="started_at"}}>{{formatDuration job.duration}}</dd>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<dt>{{t jobs.commit}}</dt>
|
<dt>{{t jobs.commit}}</dt>
|
||||||
<dd class="commit-hash"><a {{bindAttr href="urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
<dd class="commit"><a {{bindAttr href="urlGithubCommit"}}>{{formatCommit commit}}</a></dd>
|
||||||
{{#if commit.compareUrl}}
|
{{#if commit.compareUrl}}
|
||||||
<dt>{{t jobs.compare}}</dt>
|
<dt>{{t jobs.compare}}</dt>
|
||||||
<dd class="compare_view"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
<dd class="compare"><a {{bindAttr href="commit.compareUrl"}}>{{pathFrom commit.compareUrl}}</a></dd>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if commit.authorName}}
|
{{#if commit.authorName}}
|
||||||
<dt>{{t jobs.author}}</dt>
|
<dt>{{t jobs.author}}</dt>
|
||||||
|
@ -29,7 +29,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<dt>{{t jobs.message}}</dt>
|
<dt>{{t jobs.message}}</dt>
|
||||||
<dd class="commit-message">{{formatMessage commit.message}}</dd>
|
<dd class="message">{{formatMessage commit.message}}</dd>
|
||||||
<dt>{{t jobs.config}}</dt>
|
<dt>{{t jobs.config}}</dt>
|
||||||
<dd class="config">{{formatConfig job.config}}</dd>
|
<dd class="config">{{formatConfig job.config}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
|
@ -49,10 +49,10 @@
|
||||||
|
|
||||||
requiredJobs: (->
|
requiredJobs: (->
|
||||||
jobs = @getPath('build.jobs')
|
jobs = @getPath('build.jobs')
|
||||||
jobs.filter((job) -> job.get('allow_failure') != true) if jobs
|
jobs.filter((job) -> job.get('allowFailure') != true) if jobs
|
||||||
).property('build.jobs')
|
).property('build.jobs')
|
||||||
|
|
||||||
allowedFailureJobs: (->
|
allowedFailureJobs: (->
|
||||||
jobs = @getPath('build.jobs')
|
jobs = @getPath('build.jobs')
|
||||||
jobs.filter((job) -> job.get('allow_failure')) if jobs
|
jobs.filter((job) -> job.get('allowFailure')) if jobs
|
||||||
).property('build.jobs')
|
).property('build.jobs')
|
||||||
|
|
|
@ -9,10 +9,10 @@ repositories = [
|
||||||
]
|
]
|
||||||
|
|
||||||
builds = [
|
builds = [
|
||||||
{ id: 1, repository_id: '1', commit_id: 1, job_ids: [1, 2], number: 1, event_type: 'push', config: { rvm: ['rbx', '1.9.3'] }, duration: 30, started_at: '2012-07-02T00:00:00Z', finished_at: '2012-07-02T00:00:30Z', result: 0 },
|
{ id: 1, repository_id: '1', commit_id: 1, job_ids: [1, 2, 3], number: 1, event_type: 'push', config: { rvm: ['rbx', '1.9.3', 'jruby'] }, duration: 30, started_at: '2012-07-02T00:00:00Z', finished_at: '2012-07-02T00:00:30Z', result: 0 },
|
||||||
{ id: 2, repository_id: '1', commit_id: 2, job_ids: [3], number: 2, event_type: 'push', config: { rvm: ['rbx'] } },
|
{ id: 2, repository_id: '1', commit_id: 2, job_ids: [4], number: 2, event_type: 'push', config: { rvm: ['rbx'] } },
|
||||||
{ id: 3, repository_id: '2', commit_id: 3, job_ids: [4], number: 3, event_type: 'push', config: { rvm: ['rbx'] }, duration: 30, started_at: '2012-07-02T00:01:00Z', finished_at: '2012-07-01T00:01:30Z', result: 1 },
|
{ id: 3, repository_id: '2', commit_id: 3, job_ids: [5], number: 3, event_type: 'push', config: { rvm: ['rbx'] }, duration: 30, started_at: '2012-07-02T00:01:00Z', finished_at: '2012-07-01T00:01:30Z', result: 1 },
|
||||||
{ id: 4, repository_id: '3', commit_id: 4, job_ids: [5], number: 4, event_type: 'push', config: { rvm: ['rbx'] }, started_at: '2012-07-02T00:02:00Z' },
|
{ id: 4, repository_id: '3', commit_id: 4, job_ids: [6], number: 4, event_type: 'push', config: { rvm: ['rbx'] }, started_at: '2012-07-02T00:02:00Z' },
|
||||||
]
|
]
|
||||||
|
|
||||||
commits = [
|
commits = [
|
||||||
|
@ -23,13 +23,14 @@ commits = [
|
||||||
]
|
]
|
||||||
|
|
||||||
jobs = [
|
jobs = [
|
||||||
{ id: 1, repository_id: 1, build_id: 1, commit_id: 1, log_id: 1, number: '1.1', config: { rvm: 'rbx' }, duration: 30, started_at: '2012-07-02T00:00:00Z', finished_at: '2012-07-02T00:00:30Z', result: 0 }
|
{ id: 1, repository_id: 1, build_id: 1, commit_id: 1, log_id: 1, number: '1.1', config: { rvm: 'rbx' }, duration: 30, started_at: '2012-07-02T00:00:00Z', finished_at: '2012-07-02T00:00:30Z', result: 0 }
|
||||||
{ id: 2, repository_id: 1, build_id: 1, commit_id: 1, log_id: 2, number: '1.2', config: { rvm: '1.9.3' }, allow_failure: true }
|
{ id: 2, repository_id: 1, build_id: 1, commit_id: 1, log_id: 2, number: '1.2', config: { rvm: '1.9.3' }, duration: 40, started_at: '2012-07-02T00:00:00Z', finished_at: '2012-07-02T00:00:40Z', result: 1 }
|
||||||
{ id: 3, repository_id: 1, build_id: 2, commit_id: 2, log_id: 3, number: '2.1', config: { rvm: 'rbx' } }
|
{ id: 3, repository_id: 1, build_id: 1, commit_id: 1, log_id: 3, number: '1.3', config: { rvm: 'jruby' }, allow_failure: true }
|
||||||
{ id: 4, repository_id: 2, build_id: 3, commit_id: 3, log_id: 4, number: '3.1', config: { rvm: 'rbx' }, duration: 30, started_at: '2012-07-02T00:01:00Z', finished_at: '2012-07-02T00:01:30Z', result: 1 }
|
{ id: 4, repository_id: 1, build_id: 2, commit_id: 2, log_id: 4, number: '2.1', config: { rvm: 'rbx' } }
|
||||||
{ id: 5, repository_id: 3, build_id: 4, commit_id: 4, log_id: 5, number: '4.1', config: { rvm: 'rbx' }, started_at: '2012-07-02T00:02:00Z' }
|
{ id: 5, repository_id: 2, build_id: 3, commit_id: 3, log_id: 5, number: '3.1', config: { rvm: 'rbx' }, duration: 30, started_at: '2012-07-02T00:01:00Z', finished_at: '2012-07-02T00:01:30Z', result: 1 }
|
||||||
{ id: 6, repository_id: 1, build_id: 5, commit_id: 5, log_id: 5, number: '5.1', config: { rvm: 'rbx' }, state: 'created', queue: 'builds.common' }
|
{ id: 6, repository_id: 3, build_id: 4, commit_id: 4, log_id: 6, number: '4.1', config: { rvm: 'rbx' }, started_at: '2012-07-02T00:02:00Z' }
|
||||||
{ id: 7, repository_id: 1, build_id: 5, commit_id: 5, log_id: 5, number: '5.2', config: { rvm: 'rbx' }, state: 'created', queue: 'builds.common' }
|
{ id: 7, repository_id: 1, build_id: 5, commit_id: 5, log_id: 7, number: '5.1', config: { rvm: 'rbx' }, state: 'created', queue: 'builds.common' }
|
||||||
|
{ id: 8, repository_id: 1, build_id: 5, commit_id: 5, log_id: 8, number: '5.2', config: { rvm: 'rbx' }, state: 'created', queue: 'builds.common' }
|
||||||
]
|
]
|
||||||
|
|
||||||
artifacts = [
|
artifacts = [
|
||||||
|
@ -37,7 +38,10 @@ artifacts = [
|
||||||
{ id: 2, body: 'log 2' }
|
{ id: 2, body: 'log 2' }
|
||||||
{ id: 3, body: 'log 3' }
|
{ id: 3, body: 'log 3' }
|
||||||
{ id: 4, body: 'log 4' }
|
{ id: 4, body: 'log 4' }
|
||||||
{ id: 5, body: 'log 4' }
|
{ id: 5, body: 'log 5' }
|
||||||
|
{ id: 6, body: 'log 6' }
|
||||||
|
{ id: 7, body: 'log 7' }
|
||||||
|
{ id: 8, body: 'log 8' }
|
||||||
]
|
]
|
||||||
|
|
||||||
branches = [
|
branches = [
|
||||||
|
|
|
@ -12,6 +12,9 @@
|
||||||
this
|
this
|
||||||
|
|
||||||
@Travis.Model.reopenClass
|
@Travis.Model.reopenClass
|
||||||
|
filter: (callback) ->
|
||||||
|
Travis.app.store.filter(this, callback)
|
||||||
|
|
||||||
load: (attrs) ->
|
load: (attrs) ->
|
||||||
Travis.app.store.load(this, attrs)
|
Travis.app.store.load(this, attrs)
|
||||||
|
|
||||||
|
|
46
assets/javascripts/spec/build_spec.coffee
Normal file
46
assets/javascripts/spec/build_spec.coffee
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
describe 'on the "build" state', ->
|
||||||
|
beforeEach ->
|
||||||
|
app '!/travis-ci/travis-core/builds/1'
|
||||||
|
waitFor buildRendered
|
||||||
|
|
||||||
|
it 'displays the expected stuff', ->
|
||||||
|
displaysReposList [
|
||||||
|
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '#!/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
||||||
|
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '#!/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
||||||
|
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '#!/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||||
|
]
|
||||||
|
|
||||||
|
displaysRepository
|
||||||
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
|
||||||
|
displaysSummary
|
||||||
|
type: 'build'
|
||||||
|
id: 1
|
||||||
|
repo: 'travis-ci/travis-core'
|
||||||
|
commit: '1234567'
|
||||||
|
branch: 'master'
|
||||||
|
compare: '0123456..1234567'
|
||||||
|
finishedAt: '3 minutes ago'
|
||||||
|
duration: '30 sec'
|
||||||
|
message: 'commit message 1'
|
||||||
|
|
||||||
|
displaysTabs
|
||||||
|
current: { href: '#!/travis-ci/travis-core' }
|
||||||
|
builds: { href: '#!/travis-ci/travis-core/builds' }
|
||||||
|
build: { href: '#!/travis-ci/travis-core/builds/1', active: true }
|
||||||
|
job: { hidden: true }
|
||||||
|
|
||||||
|
displaysJobMatrix
|
||||||
|
element: '#jobs'
|
||||||
|
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
||||||
|
jobs: [
|
||||||
|
{ id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' }
|
||||||
|
{ id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '2 minutes ago', duration: '40 sec', rvm: '1.9.3' }
|
||||||
|
]
|
||||||
|
|
||||||
|
displaysJobMatrix
|
||||||
|
element: '#allowed_failure_jobs'
|
||||||
|
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
||||||
|
jobs: [
|
||||||
|
{ id: 3, number: '1.3', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: 'jruby' }
|
||||||
|
]
|
27
assets/javascripts/spec/builds_spec.coffee
Normal file
27
assets/javascripts/spec/builds_spec.coffee
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
# describe 'on the "builds" state', ->
|
||||||
|
# beforeEach ->
|
||||||
|
# app '!/travis-ci/travis-core/builds'
|
||||||
|
# waitFor buildsRendered
|
||||||
|
#
|
||||||
|
# it 'displays the expected stuff', ->
|
||||||
|
# displaysReposList [
|
||||||
|
# { slug: 'travis-ci/travis-core', build: { number: 1, url: '#!/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
||||||
|
# { slug: 'travis-ci/travis-assets', build: { number: 3, url: '#!/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
||||||
|
# { slug: 'travis-ci/travis-hub', build: { number: 4, url: '#!/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||||
|
# ]
|
||||||
|
#
|
||||||
|
# displaysRepository
|
||||||
|
# href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
#
|
||||||
|
# displaysTabs
|
||||||
|
# current: { href: '#!/travis-ci/travis-core' }
|
||||||
|
# builds: { href: '#!/travis-ci/travis-core/builds', active: true }
|
||||||
|
# build: { hidden: true }
|
||||||
|
# job: { hidden: true }
|
||||||
|
#
|
||||||
|
# displaysBuildsList [
|
||||||
|
# { id: 1, slug: 'travis-ci/travis-core', number: '1', sha: '1234567', branch: 'master', message: 'commit message 1', duration: '30 sec', finishedAt: '3 minutes ago' }
|
||||||
|
# { id: 2, slug: 'travis-ci/travis-core', number: '2', sha: '2345678', branch: 'feature', message: 'commit message 2', duration: '-', finishedAt: '-' }
|
||||||
|
# ]
|
||||||
|
#
|
||||||
|
#
|
|
@ -1,17 +1,20 @@
|
||||||
describe 'on the "current" state', ->
|
describe 'on the "current" state', ->
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
app '!/travis-ci/travis-core'
|
app '!/travis-ci/travis-core'
|
||||||
waitFor repositoriesRendered
|
|
||||||
waitFor buildRendered
|
waitFor buildRendered
|
||||||
|
|
||||||
it 'displays the expected stuff', ->
|
it 'displays the expected stuff', ->
|
||||||
displaysRepoList [
|
displaysReposList [
|
||||||
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '#!/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '#!/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
||||||
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '#!/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '#!/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
||||||
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '#!/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '#!/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||||
]
|
]
|
||||||
|
|
||||||
displaysBuildSummary
|
displaysRepository
|
||||||
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
|
||||||
|
displaysSummary
|
||||||
|
type: 'build'
|
||||||
id: 1
|
id: 1
|
||||||
repo: 'travis-ci/travis-core'
|
repo: 'travis-ci/travis-core'
|
||||||
commit: '1234567'
|
commit: '1234567'
|
||||||
|
@ -22,19 +25,22 @@ describe 'on the "current" state', ->
|
||||||
message: 'commit message 1'
|
message: 'commit message 1'
|
||||||
|
|
||||||
displaysTabs
|
displaysTabs
|
||||||
current: '#!/travis-ci/travis-core'
|
current: { href: '#!/travis-ci/travis-core', active: true }
|
||||||
builds: '#!/travis-ci/travis-core/builds'
|
builds: { href: '#!/travis-ci/travis-core/builds' }
|
||||||
|
build: { hidden: true }
|
||||||
|
job: { hidden: true }
|
||||||
|
|
||||||
displaysJobMatrix
|
displaysJobMatrix
|
||||||
element: '#jobs'
|
element: '#jobs'
|
||||||
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
||||||
jobs: [
|
jobs: [
|
||||||
{ id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' }
|
{ id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' }
|
||||||
|
{ id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '2 minutes ago', duration: '40 sec', rvm: '1.9.3' }
|
||||||
]
|
]
|
||||||
|
|
||||||
displaysJobMatrix
|
displaysJobMatrix
|
||||||
element: '#allowed_failure_jobs'
|
element: '#allowed_failure_jobs'
|
||||||
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
||||||
jobs: [
|
jobs: [
|
||||||
{ id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: '1.9.3' }
|
{ id: 3, number: '1.3', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: 'jruby' }
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
describe 'events', ->
|
# describe 'events', ->
|
||||||
beforeEach ->
|
# beforeEach ->
|
||||||
app
|
# app
|
||||||
waitFor buildRendered
|
# waitFor buildRendered
|
||||||
|
#
|
||||||
it 'foo', ->
|
# it 'foo', ->
|
||||||
# Travis.app.receive 'job:created',
|
# Travis.app.receive 'job:created',
|
||||||
# job:
|
# job:
|
||||||
# id: 10
|
# id: 10
|
||||||
|
@ -24,32 +24,32 @@ describe 'events', ->
|
||||||
# compare_url: 'http://github.com/compare/0123456..1234567'
|
# compare_url: 'http://github.com/compare/0123456..1234567'
|
||||||
|
|
||||||
|
|
||||||
Travis.app.receive 'build:started',
|
# Travis.app.receive 'build:started',
|
||||||
repository:
|
# repository:
|
||||||
id: 10
|
# id: 10
|
||||||
owner: 'travis-ci'
|
# owner: 'travis-ci'
|
||||||
name: 'travis-support'
|
# name: 'travis-support'
|
||||||
slug: 'travis-ci/travis-support'
|
# slug: 'travis-ci/travis-support'
|
||||||
build_ids: [10]
|
# build_ids: [10]
|
||||||
last_build_id: 10
|
# last_build_id: 10
|
||||||
last_build_number: 10
|
# last_build_number: 10
|
||||||
last_build_started_at: '2012-07-02T00:02:00Z'
|
# last_build_started_at: '2012-07-02T00:02:00Z'
|
||||||
description: 'Description of travis-hub'
|
# description: 'Description of travis-hub'
|
||||||
build:
|
# build:
|
||||||
id: 10
|
# id: 10
|
||||||
repository_id: 1
|
# repository_id: 1
|
||||||
commit_id: 10
|
# commit_id: 10
|
||||||
job_ids: [10]
|
# job_ids: [10]
|
||||||
number: 10
|
# number: 10
|
||||||
event_type: 'push'
|
# event_type: 'push'
|
||||||
config: { rvm: ['rbx'] }
|
# config: { rvm: ['rbx'] }
|
||||||
commit:
|
# commit:
|
||||||
id: 10
|
# id: 10
|
||||||
sha: '1234567'
|
# sha: '1234567'
|
||||||
branch: 'master'
|
# branch: 'master'
|
||||||
message: 'commit message 1'
|
# message: 'commit message 1'
|
||||||
author_name: 'author name'
|
# author_name: 'author name'
|
||||||
author_email: 'author@email.com'
|
# author_email: 'author@email.com'
|
||||||
committer_name: 'committer name'
|
# committer_name: 'committer name'
|
||||||
committer_email: 'committer@email.com'
|
# committer_email: 'committer@email.com'
|
||||||
compare_url: 'http://github.com/compare/0123456..1234567'
|
# compare_url: 'http://github.com/compare/0123456..1234567'
|
||||||
|
|
|
@ -4,7 +4,7 @@ describe 'on the "index" state', ->
|
||||||
waitFor buildRendered
|
waitFor buildRendered
|
||||||
|
|
||||||
it 'displays the expected stuff', ->
|
it 'displays the expected stuff', ->
|
||||||
displaysRepoList [
|
displaysReposList [
|
||||||
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '#!/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '#!/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
||||||
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '#!/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '#!/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
||||||
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '#!/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '#!/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||||
|
@ -13,7 +13,8 @@ describe 'on the "index" state', ->
|
||||||
displaysRepository
|
displaysRepository
|
||||||
href: 'http://github.com/travis-ci/travis-core'
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
|
||||||
displaysBuildSummary
|
displaysSummary
|
||||||
|
type: 'build'
|
||||||
id: 1
|
id: 1
|
||||||
repo: 'travis-ci/travis-core'
|
repo: 'travis-ci/travis-core'
|
||||||
commit: '1234567'
|
commit: '1234567'
|
||||||
|
@ -24,21 +25,22 @@ describe 'on the "index" state', ->
|
||||||
message: 'commit message 1'
|
message: 'commit message 1'
|
||||||
|
|
||||||
displaysTabs
|
displaysTabs
|
||||||
current: '#!/travis-ci/travis-core'
|
current: { href: '#!/travis-ci/travis-core', active: true }
|
||||||
builds: '#!/travis-ci/travis-core/builds'
|
builds: { href: '#!/travis-ci/travis-core/builds' }
|
||||||
|
build: { hidden: true }
|
||||||
|
job: { hidden: true }
|
||||||
|
|
||||||
displaysJobMatrix
|
displaysJobMatrix
|
||||||
element: '#jobs'
|
element: '#jobs'
|
||||||
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
||||||
jobs: [
|
jobs: [
|
||||||
{ id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' }
|
{ id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: '3 minutes ago', duration: '30 sec', rvm: 'rbx' }
|
||||||
|
{ id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '2 minutes ago', duration: '40 sec', rvm: '1.9.3' }
|
||||||
]
|
]
|
||||||
|
|
||||||
displaysJobMatrix
|
displaysJobMatrix
|
||||||
element: '#allowed_failure_jobs'
|
element: '#allowed_failure_jobs'
|
||||||
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
headers: ['Job', 'Duration', 'Finished', 'Rvm']
|
||||||
jobs: [
|
jobs: [
|
||||||
{ id: 2, number: '1.2', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: '1.9.3' }
|
{ id: 3, number: '1.3', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: 'jruby' }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
36
assets/javascripts/spec/job_spec.coffee
Normal file
36
assets/javascripts/spec/job_spec.coffee
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
describe 'on the "job" state', ->
|
||||||
|
beforeEach ->
|
||||||
|
app '!/travis-ci/travis-core/jobs/1'
|
||||||
|
waitFor jobRendered
|
||||||
|
waitFor hasText('#tab_build', 'Build #1')
|
||||||
|
|
||||||
|
it 'displays the expected stuff', ->
|
||||||
|
displaysReposList [
|
||||||
|
{ slug: 'travis-ci/travis-core', build: { number: 1, url: '#!/travis-ci/travis-core/builds/1', duration: '30 sec', finishedAt: '3 minutes ago' } }
|
||||||
|
{ slug: 'travis-ci/travis-assets', build: { number: 3, url: '#!/travis-ci/travis-assets/builds/3', duration: '30 sec', finishedAt: 'a day ago' } }
|
||||||
|
{ slug: 'travis-ci/travis-hub', build: { number: 4, url: '#!/travis-ci/travis-hub/builds/4', duration: '1 min', finishedAt: '-' } }
|
||||||
|
]
|
||||||
|
|
||||||
|
displaysRepository
|
||||||
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
|
||||||
|
displaysSummary
|
||||||
|
id: 1
|
||||||
|
type: 'job'
|
||||||
|
repo: 'travis-ci/travis-core'
|
||||||
|
commit: '1234567'
|
||||||
|
branch: 'master'
|
||||||
|
compare: '0123456..1234567'
|
||||||
|
finishedAt: '3 minutes ago'
|
||||||
|
duration: '30 sec'
|
||||||
|
message: 'commit message 1'
|
||||||
|
|
||||||
|
displaysTabs
|
||||||
|
current: { href: '#!/travis-ci/travis-core' }
|
||||||
|
builds: { href: '#!/travis-ci/travis-core/builds' }
|
||||||
|
build: { href: '#!/travis-ci/travis-core/builds/1' }
|
||||||
|
job: { href: '#!/travis-ci/travis-core/jobs/1', active: true }
|
||||||
|
|
||||||
|
displaysLog [
|
||||||
|
'log 1'
|
||||||
|
]
|
|
@ -1,7 +1,9 @@
|
||||||
minispade.require 'app'
|
minispade.require 'app'
|
||||||
|
|
||||||
@reset = ->
|
@reset = ->
|
||||||
Travis.app.destroy() if Travis.app
|
Em.run ->
|
||||||
|
Travis.app.destroy() if Travis.app
|
||||||
|
waits(500) # TODO not sure what we need to wait for here
|
||||||
$('#content').remove()
|
$('#content').remove()
|
||||||
$('body').append('<div id="content"></div>')
|
$('body').append('<div id="content"></div>')
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
@repositoriesRendered = ->
|
@notEmpty = (selector) ->
|
||||||
$('#repositories li a.current').text() != ''
|
-> $(selector).text().trim() != ''
|
||||||
|
|
||||||
@buildRendered = ->
|
@hasText = (selector, text) ->
|
||||||
$('#summary .number').text() != ''
|
-> $(selector).text().trim() == text
|
||||||
|
|
||||||
@matrixRendered = ->
|
|
||||||
$('#jobs').text() != ''
|
|
||||||
|
|
||||||
|
@reposRendered = notEmpty('#repositories li a.current')
|
||||||
|
@buildRendered = notEmpty('#summary .number')
|
||||||
|
@buildsRendered = notEmpty('#builds .number')
|
||||||
|
@matrixRendered = notEmpty('#jobs')
|
||||||
|
@jobRendered = notEmpty('#summary .number')
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@displaysRepoList = (repos) ->
|
@displaysReposList = (repos) ->
|
||||||
elements = $('#repositories li').toArray()
|
elements = $('#repositories li').toArray()
|
||||||
ix = 0
|
ix = 0
|
||||||
for repo in repos
|
for repo in repos
|
||||||
|
@ -13,12 +13,18 @@
|
||||||
expect($('#repository h3 a').attr('href')).toEqual (repo.href)
|
expect($('#repository h3 a').attr('href')).toEqual (repo.href)
|
||||||
|
|
||||||
@displaysTabs = (tabs) ->
|
@displaysTabs = (tabs) ->
|
||||||
for tab, url in tabs
|
for name, tab of tabs
|
||||||
expect($("#tab_#{tab} a").attr('href')).toEqual url
|
expect($("#tab_#{name} a").attr('href')).toEqual tab.href unless tab.hidden
|
||||||
|
expect($("#tab_#{name}").hasClass('active')).toEqual !!tab.active
|
||||||
|
expect($("#tab_#{name}").hasClass('display')).toEqual !tab.hidden if name in ['build', 'job']
|
||||||
|
|
||||||
|
|
||||||
|
@displaysSummary = (data) ->
|
||||||
|
element = $('#summary .left:first-child dt:first-child')
|
||||||
|
expect(element.text()).toEqual $.camelize(data.type)
|
||||||
|
|
||||||
@displaysBuildSummary = (data) ->
|
|
||||||
element = $('#summary .number a')
|
element = $('#summary .number a')
|
||||||
expect(element.attr('href')).toEqual "#!/#{data.repo}/builds/#{data.id}"
|
expect(element.attr('href')).toEqual "#!/#{data.repo}/#{data.type}s/#{data.id}"
|
||||||
|
|
||||||
element = $('#summary .finished_at')
|
element = $('#summary .finished_at')
|
||||||
expect(element.text()).toEqual data.finishedAt
|
expect(element.text()).toEqual data.finishedAt
|
||||||
|
@ -63,5 +69,22 @@
|
||||||
element = $("#{data.element} tr:nth-child(#{ix}) td:nth-child(6)")
|
element = $("#{data.element} tr:nth-child(#{ix}) td:nth-child(6)")
|
||||||
expect(element.text()).toEqual job.rvm
|
expect(element.text()).toEqual job.rvm
|
||||||
|
|
||||||
|
@displaysBuildsList = (builds) ->
|
||||||
|
rows = $('#builds tbody tr').toArray()
|
||||||
|
ix = 0
|
||||||
|
for build in builds
|
||||||
|
row = rows[ix]
|
||||||
|
expect($('.number a', row).attr('href')).toEqual "#!/#{build.slug}/builds/#{build.id}"
|
||||||
|
expect($('.number a', row).text()).toEqual build.number
|
||||||
|
expect($('.message', row).text()).toEqual build.message
|
||||||
|
expect($('.duration', row).text()).toEqual build.duration
|
||||||
|
expect($('.finished_at', row).text()).toEqual build.finishedAt
|
||||||
|
ix += 1
|
||||||
|
|
||||||
|
@displaysLog = (lines) ->
|
||||||
|
ix = 0
|
||||||
|
log = $.map(lines, (line) -> ix += 1; "#{ix}#{line}").join("\n")
|
||||||
|
expect($('#log').text().trim()).toEqual log
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,141 +1,12 @@
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
describe('on the "current" state', function() {
|
describe('on the "build" state', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
app('!/travis-ci/travis-core');
|
app('!/travis-ci/travis-core/builds/1');
|
||||||
waitFor(repositoriesRendered);
|
|
||||||
return waitFor(buildRendered);
|
return waitFor(buildRendered);
|
||||||
});
|
});
|
||||||
return it('displays the expected stuff', function() {
|
return it('displays the expected stuff', function() {
|
||||||
displaysRepoList([
|
displaysReposList([
|
||||||
{
|
|
||||||
slug: 'travis-ci/travis-core',
|
|
||||||
build: {
|
|
||||||
number: 1,
|
|
||||||
url: '#!/travis-ci/travis-core/builds/1',
|
|
||||||
duration: '30 sec',
|
|
||||||
finishedAt: '3 minutes ago'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
slug: 'travis-ci/travis-assets',
|
|
||||||
build: {
|
|
||||||
number: 3,
|
|
||||||
url: '#!/travis-ci/travis-assets/builds/3',
|
|
||||||
duration: '30 sec',
|
|
||||||
finishedAt: 'a day ago'
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
slug: 'travis-ci/travis-hub',
|
|
||||||
build: {
|
|
||||||
number: 4,
|
|
||||||
url: '#!/travis-ci/travis-hub/builds/4',
|
|
||||||
duration: '1 min',
|
|
||||||
finishedAt: '-'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
displaysBuildSummary({
|
|
||||||
id: 1,
|
|
||||||
repo: 'travis-ci/travis-core',
|
|
||||||
commit: '1234567',
|
|
||||||
branch: 'master',
|
|
||||||
compare: '0123456..1234567',
|
|
||||||
finishedAt: '3 minutes ago',
|
|
||||||
duration: '30 sec',
|
|
||||||
message: 'commit message 1'
|
|
||||||
});
|
|
||||||
displaysTabs({
|
|
||||||
current: '#!/travis-ci/travis-core',
|
|
||||||
builds: '#!/travis-ci/travis-core/builds'
|
|
||||||
});
|
|
||||||
displaysJobMatrix({
|
|
||||||
element: '#jobs',
|
|
||||||
headers: ['Job', 'Duration', 'Finished', 'Rvm'],
|
|
||||||
jobs: [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
number: '1.1',
|
|
||||||
repo: 'travis-ci/travis-core',
|
|
||||||
finishedAt: '3 minutes ago',
|
|
||||||
duration: '30 sec',
|
|
||||||
rvm: 'rbx'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
return displaysJobMatrix({
|
|
||||||
element: '#allowed_failure_jobs',
|
|
||||||
headers: ['Job', 'Duration', 'Finished', 'Rvm'],
|
|
||||||
jobs: [
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
number: '1.2',
|
|
||||||
repo: 'travis-ci/travis-core',
|
|
||||||
finishedAt: '-',
|
|
||||||
duration: '-',
|
|
||||||
rvm: '1.9.3'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}).call(this);
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
describe('events', function() {
|
|
||||||
beforeEach(function() {
|
|
||||||
app;
|
|
||||||
return waitFor(buildRendered);
|
|
||||||
});
|
|
||||||
return it('foo', function() {
|
|
||||||
return Travis.app.receive('build:started', {
|
|
||||||
repository: {
|
|
||||||
id: 10,
|
|
||||||
owner: 'travis-ci',
|
|
||||||
name: 'travis-support',
|
|
||||||
slug: 'travis-ci/travis-support',
|
|
||||||
build_ids: [10],
|
|
||||||
last_build_id: 10,
|
|
||||||
last_build_number: 10,
|
|
||||||
last_build_started_at: '2012-07-02T00:02:00Z',
|
|
||||||
description: 'Description of travis-hub'
|
|
||||||
},
|
|
||||||
build: {
|
|
||||||
id: 10,
|
|
||||||
repository_id: 1,
|
|
||||||
commit_id: 10,
|
|
||||||
job_ids: [10],
|
|
||||||
number: 10,
|
|
||||||
event_type: 'push',
|
|
||||||
config: {
|
|
||||||
rvm: ['rbx']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
commit: {
|
|
||||||
id: 10,
|
|
||||||
sha: '1234567',
|
|
||||||
branch: 'master',
|
|
||||||
message: 'commit message 1',
|
|
||||||
author_name: 'author name',
|
|
||||||
author_email: 'author@email.com',
|
|
||||||
committer_name: 'committer name',
|
|
||||||
committer_email: 'committer@email.com',
|
|
||||||
compare_url: 'http://github.com/compare/0123456..1234567'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}).call(this);
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
describe('on the "index" state', function() {
|
|
||||||
beforeEach(function() {
|
|
||||||
app('');
|
|
||||||
return waitFor(buildRendered);
|
|
||||||
});
|
|
||||||
return it('displays the expected stuff', function() {
|
|
||||||
displaysRepoList([
|
|
||||||
{
|
{
|
||||||
slug: 'travis-ci/travis-core',
|
slug: 'travis-ci/travis-core',
|
||||||
build: {
|
build: {
|
||||||
|
@ -165,7 +36,8 @@
|
||||||
displaysRepository({
|
displaysRepository({
|
||||||
href: 'http://github.com/travis-ci/travis-core'
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
});
|
});
|
||||||
displaysBuildSummary({
|
displaysSummary({
|
||||||
|
type: 'build',
|
||||||
id: 1,
|
id: 1,
|
||||||
repo: 'travis-ci/travis-core',
|
repo: 'travis-ci/travis-core',
|
||||||
commit: '1234567',
|
commit: '1234567',
|
||||||
|
@ -176,8 +48,19 @@
|
||||||
message: 'commit message 1'
|
message: 'commit message 1'
|
||||||
});
|
});
|
||||||
displaysTabs({
|
displaysTabs({
|
||||||
current: '#!/travis-ci/travis-core',
|
current: {
|
||||||
builds: '#!/travis-ci/travis-core/builds'
|
href: '#!/travis-ci/travis-core'
|
||||||
|
},
|
||||||
|
builds: {
|
||||||
|
href: '#!/travis-ci/travis-core/builds'
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
href: '#!/travis-ci/travis-core/builds/1',
|
||||||
|
active: true
|
||||||
|
},
|
||||||
|
job: {
|
||||||
|
hidden: true
|
||||||
|
}
|
||||||
});
|
});
|
||||||
displaysJobMatrix({
|
displaysJobMatrix({
|
||||||
element: '#jobs',
|
element: '#jobs',
|
||||||
|
@ -190,6 +73,13 @@
|
||||||
finishedAt: '3 minutes ago',
|
finishedAt: '3 minutes ago',
|
||||||
duration: '30 sec',
|
duration: '30 sec',
|
||||||
rvm: 'rbx'
|
rvm: 'rbx'
|
||||||
|
}, {
|
||||||
|
id: 2,
|
||||||
|
number: '1.2',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
finishedAt: '2 minutes ago',
|
||||||
|
duration: '40 sec',
|
||||||
|
rvm: '1.9.3'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -198,15 +88,301 @@
|
||||||
headers: ['Job', 'Duration', 'Finished', 'Rvm'],
|
headers: ['Job', 'Duration', 'Finished', 'Rvm'],
|
||||||
jobs: [
|
jobs: [
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 3,
|
||||||
number: '1.2',
|
number: '1.3',
|
||||||
repo: 'travis-ci/travis-core',
|
repo: 'travis-ci/travis-core',
|
||||||
finishedAt: '-',
|
finishedAt: '-',
|
||||||
duration: '-',
|
duration: '-',
|
||||||
|
rvm: 'jruby'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
describe('on the "current" state', function() {
|
||||||
|
beforeEach(function() {
|
||||||
|
app('!/travis-ci/travis-core');
|
||||||
|
return waitFor(buildRendered);
|
||||||
|
});
|
||||||
|
return it('displays the expected stuff', function() {
|
||||||
|
displaysReposList([
|
||||||
|
{
|
||||||
|
slug: 'travis-ci/travis-core',
|
||||||
|
build: {
|
||||||
|
number: 1,
|
||||||
|
url: '#!/travis-ci/travis-core/builds/1',
|
||||||
|
duration: '30 sec',
|
||||||
|
finishedAt: '3 minutes ago'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
slug: 'travis-ci/travis-assets',
|
||||||
|
build: {
|
||||||
|
number: 3,
|
||||||
|
url: '#!/travis-ci/travis-assets/builds/3',
|
||||||
|
duration: '30 sec',
|
||||||
|
finishedAt: 'a day ago'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
slug: 'travis-ci/travis-hub',
|
||||||
|
build: {
|
||||||
|
number: 4,
|
||||||
|
url: '#!/travis-ci/travis-hub/builds/4',
|
||||||
|
duration: '1 min',
|
||||||
|
finishedAt: '-'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
displaysRepository({
|
||||||
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
});
|
||||||
|
displaysSummary({
|
||||||
|
type: 'build',
|
||||||
|
id: 1,
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
commit: '1234567',
|
||||||
|
branch: 'master',
|
||||||
|
compare: '0123456..1234567',
|
||||||
|
finishedAt: '3 minutes ago',
|
||||||
|
duration: '30 sec',
|
||||||
|
message: 'commit message 1'
|
||||||
|
});
|
||||||
|
displaysTabs({
|
||||||
|
current: {
|
||||||
|
href: '#!/travis-ci/travis-core',
|
||||||
|
active: true
|
||||||
|
},
|
||||||
|
builds: {
|
||||||
|
href: '#!/travis-ci/travis-core/builds'
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
job: {
|
||||||
|
hidden: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
displaysJobMatrix({
|
||||||
|
element: '#jobs',
|
||||||
|
headers: ['Job', 'Duration', 'Finished', 'Rvm'],
|
||||||
|
jobs: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
number: '1.1',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
finishedAt: '3 minutes ago',
|
||||||
|
duration: '30 sec',
|
||||||
|
rvm: 'rbx'
|
||||||
|
}, {
|
||||||
|
id: 2,
|
||||||
|
number: '1.2',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
finishedAt: '2 minutes ago',
|
||||||
|
duration: '40 sec',
|
||||||
rvm: '1.9.3'
|
rvm: '1.9.3'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
return displaysJobMatrix({
|
||||||
|
element: '#allowed_failure_jobs',
|
||||||
|
headers: ['Job', 'Duration', 'Finished', 'Rvm'],
|
||||||
|
jobs: [
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
number: '1.3',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
finishedAt: '-',
|
||||||
|
duration: '-',
|
||||||
|
rvm: 'jruby'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
describe('on the "index" state', function() {
|
||||||
|
beforeEach(function() {
|
||||||
|
app('');
|
||||||
|
return waitFor(buildRendered);
|
||||||
|
});
|
||||||
|
return it('displays the expected stuff', function() {
|
||||||
|
displaysReposList([
|
||||||
|
{
|
||||||
|
slug: 'travis-ci/travis-core',
|
||||||
|
build: {
|
||||||
|
number: 1,
|
||||||
|
url: '#!/travis-ci/travis-core/builds/1',
|
||||||
|
duration: '30 sec',
|
||||||
|
finishedAt: '3 minutes ago'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
slug: 'travis-ci/travis-assets',
|
||||||
|
build: {
|
||||||
|
number: 3,
|
||||||
|
url: '#!/travis-ci/travis-assets/builds/3',
|
||||||
|
duration: '30 sec',
|
||||||
|
finishedAt: 'a day ago'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
slug: 'travis-ci/travis-hub',
|
||||||
|
build: {
|
||||||
|
number: 4,
|
||||||
|
url: '#!/travis-ci/travis-hub/builds/4',
|
||||||
|
duration: '1 min',
|
||||||
|
finishedAt: '-'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
displaysRepository({
|
||||||
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
});
|
||||||
|
displaysSummary({
|
||||||
|
type: 'build',
|
||||||
|
id: 1,
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
commit: '1234567',
|
||||||
|
branch: 'master',
|
||||||
|
compare: '0123456..1234567',
|
||||||
|
finishedAt: '3 minutes ago',
|
||||||
|
duration: '30 sec',
|
||||||
|
message: 'commit message 1'
|
||||||
|
});
|
||||||
|
displaysTabs({
|
||||||
|
current: {
|
||||||
|
href: '#!/travis-ci/travis-core',
|
||||||
|
active: true
|
||||||
|
},
|
||||||
|
builds: {
|
||||||
|
href: '#!/travis-ci/travis-core/builds'
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
job: {
|
||||||
|
hidden: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
displaysJobMatrix({
|
||||||
|
element: '#jobs',
|
||||||
|
headers: ['Job', 'Duration', 'Finished', 'Rvm'],
|
||||||
|
jobs: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
number: '1.1',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
finishedAt: '3 minutes ago',
|
||||||
|
duration: '30 sec',
|
||||||
|
rvm: 'rbx'
|
||||||
|
}, {
|
||||||
|
id: 2,
|
||||||
|
number: '1.2',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
finishedAt: '2 minutes ago',
|
||||||
|
duration: '40 sec',
|
||||||
|
rvm: '1.9.3'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
return displaysJobMatrix({
|
||||||
|
element: '#allowed_failure_jobs',
|
||||||
|
headers: ['Job', 'Duration', 'Finished', 'Rvm'],
|
||||||
|
jobs: [
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
number: '1.3',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
finishedAt: '-',
|
||||||
|
duration: '-',
|
||||||
|
rvm: 'jruby'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}).call(this);
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
describe('on the "job" state', function() {
|
||||||
|
beforeEach(function() {
|
||||||
|
app('!/travis-ci/travis-core/jobs/1');
|
||||||
|
waitFor(jobRendered);
|
||||||
|
return waitFor(hasText('#tab_build', 'Build #1'));
|
||||||
|
});
|
||||||
|
return it('displays the expected stuff', function() {
|
||||||
|
displaysReposList([
|
||||||
|
{
|
||||||
|
slug: 'travis-ci/travis-core',
|
||||||
|
build: {
|
||||||
|
number: 1,
|
||||||
|
url: '#!/travis-ci/travis-core/builds/1',
|
||||||
|
duration: '30 sec',
|
||||||
|
finishedAt: '3 minutes ago'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
slug: 'travis-ci/travis-assets',
|
||||||
|
build: {
|
||||||
|
number: 3,
|
||||||
|
url: '#!/travis-ci/travis-assets/builds/3',
|
||||||
|
duration: '30 sec',
|
||||||
|
finishedAt: 'a day ago'
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
slug: 'travis-ci/travis-hub',
|
||||||
|
build: {
|
||||||
|
number: 4,
|
||||||
|
url: '#!/travis-ci/travis-hub/builds/4',
|
||||||
|
duration: '1 min',
|
||||||
|
finishedAt: '-'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
displaysRepository({
|
||||||
|
href: 'http://github.com/travis-ci/travis-core'
|
||||||
|
});
|
||||||
|
displaysSummary({
|
||||||
|
id: 1,
|
||||||
|
type: 'job',
|
||||||
|
repo: 'travis-ci/travis-core',
|
||||||
|
commit: '1234567',
|
||||||
|
branch: 'master',
|
||||||
|
compare: '0123456..1234567',
|
||||||
|
finishedAt: '3 minutes ago',
|
||||||
|
duration: '30 sec',
|
||||||
|
message: 'commit message 1'
|
||||||
|
});
|
||||||
|
displaysTabs({
|
||||||
|
current: {
|
||||||
|
href: '#!/travis-ci/travis-core'
|
||||||
|
},
|
||||||
|
builds: {
|
||||||
|
href: '#!/travis-ci/travis-core/builds'
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
href: '#!/travis-ci/travis-core/builds/1'
|
||||||
|
},
|
||||||
|
job: {
|
||||||
|
href: '#!/travis-ci/travis-core/jobs/1',
|
||||||
|
active: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return displaysLog(['log 1']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -217,9 +393,12 @@
|
||||||
minispade.require('app');
|
minispade.require('app');
|
||||||
|
|
||||||
this.reset = function() {
|
this.reset = function() {
|
||||||
if (Travis.app) {
|
Em.run(function() {
|
||||||
Travis.app.destroy();
|
if (Travis.app) {
|
||||||
}
|
return Travis.app.destroy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
waits(500);
|
||||||
$('#content').remove();
|
$('#content').remove();
|
||||||
return $('body').append('<div id="content"></div>');
|
return $('body').append('<div id="content"></div>');
|
||||||
};
|
};
|
||||||
|
@ -245,22 +424,32 @@
|
||||||
}).call(this);
|
}).call(this);
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
this.repositoriesRendered = function() {
|
this.notEmpty = function(selector) {
|
||||||
return $('#repositories li a.current').text() !== '';
|
return function() {
|
||||||
|
return $(selector).text().trim() !== '';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
this.buildRendered = function() {
|
this.hasText = function(selector, text) {
|
||||||
return $('#summary .number').text() !== '';
|
return function() {
|
||||||
|
return $(selector).text().trim() === text;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
this.matrixRendered = function() {
|
this.reposRendered = notEmpty('#repositories li a.current');
|
||||||
return $('#jobs').text() !== '';
|
|
||||||
};
|
this.buildRendered = notEmpty('#summary .number');
|
||||||
|
|
||||||
|
this.buildsRendered = notEmpty('#builds .number');
|
||||||
|
|
||||||
|
this.matrixRendered = notEmpty('#jobs');
|
||||||
|
|
||||||
|
this.jobRendered = notEmpty('#summary .number');
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
this.displaysRepoList = function(repos) {
|
this.displaysReposList = function(repos) {
|
||||||
var element, elements, ix, repo, _i, _len, _results;
|
var element, elements, ix, repo, _i, _len, _results;
|
||||||
elements = $('#repositories li').toArray();
|
elements = $('#repositories li').toArray();
|
||||||
ix = 0;
|
ix = 0;
|
||||||
|
@ -282,19 +471,29 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.displaysTabs = function(tabs) {
|
this.displaysTabs = function(tabs) {
|
||||||
var tab, url, _i, _len, _results;
|
var name, tab, _results;
|
||||||
_results = [];
|
_results = [];
|
||||||
for (url = _i = 0, _len = tabs.length; _i < _len; url = ++_i) {
|
for (name in tabs) {
|
||||||
tab = tabs[url];
|
tab = tabs[name];
|
||||||
_results.push(expect($("#tab_" + tab + " a").attr('href')).toEqual(url));
|
if (!tab.hidden) {
|
||||||
|
expect($("#tab_" + name + " a").attr('href')).toEqual(tab.href);
|
||||||
|
}
|
||||||
|
expect($("#tab_" + name).hasClass('active')).toEqual(!!tab.active);
|
||||||
|
if (name === 'build' || name === 'job') {
|
||||||
|
_results.push(expect($("#tab_" + name).hasClass('display')).toEqual(!tab.hidden));
|
||||||
|
} else {
|
||||||
|
_results.push(void 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return _results;
|
return _results;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.displaysBuildSummary = function(data) {
|
this.displaysSummary = function(data) {
|
||||||
var element;
|
var element;
|
||||||
|
element = $('#summary .left:first-child dt:first-child');
|
||||||
|
expect(element.text()).toEqual($.camelize(data.type));
|
||||||
element = $('#summary .number a');
|
element = $('#summary .number a');
|
||||||
expect(element.attr('href')).toEqual("#!/" + data.repo + "/builds/" + data.id);
|
expect(element.attr('href')).toEqual("#!/" + data.repo + "/" + data.type + "s/" + data.id);
|
||||||
element = $('#summary .finished_at');
|
element = $('#summary .finished_at');
|
||||||
expect(element.text()).toEqual(data.finishedAt);
|
expect(element.text()).toEqual(data.finishedAt);
|
||||||
element = $('#summary .duration');
|
element = $('#summary .duration');
|
||||||
|
@ -339,6 +538,34 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.displaysBuildsList = function(builds) {
|
||||||
|
var build, ix, row, rows, _i, _len, _results;
|
||||||
|
rows = $('#builds tbody tr').toArray();
|
||||||
|
ix = 0;
|
||||||
|
_results = [];
|
||||||
|
for (_i = 0, _len = builds.length; _i < _len; _i++) {
|
||||||
|
build = builds[_i];
|
||||||
|
row = rows[ix];
|
||||||
|
expect($('.number a', row).attr('href')).toEqual("#!/" + build.slug + "/builds/" + build.id);
|
||||||
|
expect($('.number a', row).text()).toEqual(build.number);
|
||||||
|
expect($('.message', row).text()).toEqual(build.message);
|
||||||
|
expect($('.duration', row).text()).toEqual(build.duration);
|
||||||
|
expect($('.finished_at', row).text()).toEqual(build.finishedAt);
|
||||||
|
_results.push(ix += 1);
|
||||||
|
}
|
||||||
|
return _results;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.displaysLog = function(lines) {
|
||||||
|
var ix, log;
|
||||||
|
ix = 0;
|
||||||
|
log = $.map(lines, function(line) {
|
||||||
|
ix += 1;
|
||||||
|
return "" + ix + line;
|
||||||
|
}).join("\n");
|
||||||
|
return expect($('#log').text().trim()).toEqual(log);
|
||||||
|
};
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
var console_reporter = new jasmine.ConsoleReporter()
|
var console_reporter = new jasmine.ConsoleReporter()
|
||||||
jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
|
jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
|
||||||
jasmine.getEnv().addReporter(console_reporter);
|
/* jasmine.getEnv().addReporter(console_reporter); */
|
||||||
jasmine.getEnv().execute();
|
jasmine.getEnv().execute();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user