diff --git a/assets/javascripts/app/templates/jobs/list.hbs b/assets/javascripts/app/templates/jobs/list.hbs index 105d7bee..02d3e87d 100644 --- a/assets/javascripts/app/templates/jobs/list.hbs +++ b/assets/javascripts/app/templates/jobs/list.hbs @@ -1,13 +1,16 @@ {{#if view.jobs.length}} - - + {{#if view.required}} +
- {{#if view.required}} - {{t jobs.build_matrix}} - {{else}} - {{t jobs.allowed_failures}} - - {{/if}} -
+ + {{else}} +
+ {{t jobs.build_matrix}} +
+ + {{/if}} {{#each configKeys}} diff --git a/assets/javascripts/spec/current_spec.coffee b/assets/javascripts/spec/current_spec.coffee index 63276302..71b26f14 100644 --- a/assets/javascripts/spec/current_spec.coffee +++ b/assets/javascripts/spec/current_spec.coffee @@ -1,4 +1,4 @@ -xdescribe 'The current build tab', -> +describe 'The current build tab', -> describe 'on the "index" state', -> beforeEach -> app '' @@ -15,12 +15,20 @@ xdescribe 'The current build tab', -> message: 'commit message 1' describe 'given the current build has a job matrix', -> - it 'displays the build matrix table', -> - displaysBuildMatrix + it 'displays the jobs matrix table', -> + displaysJobMatrix + element: '#jobs' headers: ['Job', 'Duration', 'Finished', 'Rvm'] jobs: [ - { id: 1, number: '#1.1', repo: 'travis-ci/travis-core', finishedAt: /\d+ (\w+) ago/, duration: '35 sec', rvm: 'rbx' }, - { id: 2, number: '#1.2', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: '1.9.3' } + { id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: /\d+ (\w+) ago/, duration: '35 sec', rvm: 'rbx' }, + ] + + it 'displays the allowed failure jobs matrix table', -> + 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' } ] describe 'on the "current" state', -> @@ -40,10 +48,18 @@ xdescribe 'The current build tab', -> message: 'commit message 1' describe 'given the current build has a job matrix', -> - it 'displays the build matrix table', -> - displaysBuildMatrix + it 'displays the jobs matrix table', -> + displaysJobMatrix + element: '#jobs' headers: ['Job', 'Duration', 'Finished', 'Rvm'] jobs: [ - { id: 1, number: '#1.1', repo: 'travis-ci/travis-core', finishedAt: /\d+ (\w+) ago/, duration: '35 sec', rvm: 'rbx' }, - { id: 2, number: '#1.2', repo: 'travis-ci/travis-core', finishedAt: '-', duration: '-', rvm: '1.9.3' } + { id: 1, number: '1.1', repo: 'travis-ci/travis-core', finishedAt: /\d+ (\w+) ago/, duration: '35 sec', rvm: 'rbx' }, + ] + + it 'displays the allowed failure jobs matrix table', -> + 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' } ] diff --git a/assets/javascripts/spec/repositories_spec.coffee b/assets/javascripts/spec/repositories_spec.coffee index bd6e308d..07624edc 100644 --- a/assets/javascripts/spec/repositories_spec.coffee +++ b/assets/javascripts/spec/repositories_spec.coffee @@ -1,4 +1,4 @@ -xdescribe 'The repositories list', -> +describe 'The repositories list', -> beforeEach -> app '' waitFor repositoriesRendered @@ -7,7 +7,7 @@ xdescribe 'The repositories list', -> href = $('#repositories a.current').attr('href') expect(href).toEqual '#!/travis-ci/travis-core' - xit "links to the repository's last build action", -> + it "links to the repository's last build action", -> href = $('#repositories a.last_build').attr('href') expect(href).toEqual '#!/travis-ci/travis-core/builds/1' diff --git a/assets/javascripts/spec/repository_spec.coffee b/assets/javascripts/spec/repository_spec.coffee index e1f9db89..fc8b3f40 100644 --- a/assets/javascripts/spec/repository_spec.coffee +++ b/assets/javascripts/spec/repository_spec.coffee @@ -1,4 +1,4 @@ -xdescribe 'The repository view', -> +describe 'The repository view', -> beforeEach -> app '' waitFor repositoriesRendered diff --git a/assets/javascripts/spec/support/expectations.coffee b/assets/javascripts/spec/support/expectations.coffee index 0a13a4fa..972e0826 100644 --- a/assets/javascripts/spec/support/expectations.coffee +++ b/assets/javascripts/spec/support/expectations.coffee @@ -1,51 +1,51 @@ @displaysBuildSummary = (data) -> - element = $('#build .summary .number a') + element = $('#summary .number a') expect(element.attr('href')).toEqual "#!/#{data.repo}/builds/#{data.id}" - element = $('#build .summary .finished_at') + element = $('#summary .finished_at') expect(element.text()).toMatch /\d+ (\w+) ago/ - element = $('#build .summary .duration') + element = $('#summary .duration') expect(element.text()).toEqual data.duration - element = $('#build .summary .commit a') + element = $('#summary .commit a') expect(element.attr('href')).toEqual "http://github.com/#{data.repo}/commit/#{data.commit}" - element = $('#build .summary .commit a') + element = $('#summary .commit a') expect(element.text()).toEqual "#{data.commit} (#{data.branch})" - element = $('#build .summary .compare a') + element = $('#summary .compare a') expect(element.attr('href')).toEqual "http://github.com/compare/#{data.compare}" - element = $('#build .summary .compare a') + element = $('#summary .compare a') expect(element.text()).toEqual data.compare - element = $('#build .summary .message') + element = $('#summary .message') expect(element.text()).toEqual data.message -@displaysBuildMatrix = (data) -> - headers = ($(element).text() for element in $('#jobs thead th')) +@displaysJobMatrix = (data) -> + headers = ($(element).text() for element in $("#{data.element} thead th")) expect(headers).toEqual(data.headers) $.each data.jobs, (ix, job) -> ix = (ix + 1) * 3 # cuz metamorph is adding two script elements - element = $("#jobs tr:nth-child(#{ix}) td.number") + element = $("#{data.element} tr:nth-child(#{ix}) td.number") expect(element.text()).toEqual job.number - element = $("#jobs tr:nth-child(#{ix}) td.number a") + element = $("#{data.element} tr:nth-child(#{ix}) td.number a") expect(element.attr('href')).toEqual "#!/#{job.repo}/jobs/#{job.id}" - element = $("#jobs tr:nth-child(#{ix}) td.duration") + element = $("#{data.element} tr:nth-child(#{ix}) td.duration") expect(element.text()).toEqual job.duration - element = $("#jobs tr:nth-child(#{ix}) td.finished_at") + element = $("#{data.element} tr:nth-child(#{ix}) td.finished_at") if job.finishedAt == '-' expect(element.text()).toEqual '-' else expect(element.text()).toMatch job.finishedAt - element = $("#jobs 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 diff --git a/assets/javascripts/spec/tabs_spec.coffee b/assets/javascripts/spec/tabs_spec.coffee index d4c1ec9b..30a18746 100644 --- a/assets/javascripts/spec/tabs_spec.coffee +++ b/assets/javascripts/spec/tabs_spec.coffee @@ -1,4 +1,4 @@ -xdescribe 'The tabs view', -> +describe 'The tabs view', -> describe 'on the "index" state', -> beforeEach -> app '' diff --git a/public/javascripts/application.js b/public/javascripts/application.js index d7f058b7..ffd947f9 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1 +1 @@ -minispade.register('templates', "(function() {Ember.TEMPLATES['builds/list']=Ember.Handlebars.compile(\"
+ {{t jobs.allowed_failures}} + +
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\n \\n {{#each build in content}}\\n {{#view Travis.Views.BuildsItemView contextBinding=\\\"build\\\"}}\\n \\n \\n \\n \\n \\n \\n \\n {{/view}}\\n {{/each}}\\n \\n
{{t builds.name}}{{t builds.commit}}{{t builds.message}}{{t builds.duration}}{{t builds.finished_at}}
{{number}}{{formatCommit commit}}{{{formatMessage commit.message short=\\\"true\\\"}}}{{formatDuration duration}}{{formatTime finished_at}}
\\n\\n

\\n \\n

\\n\");Ember.TEMPLATES['builds/show']=Ember.Handlebars.compile(\"{{#unless isLoaded}}\\n Loading ...\\n{{else}}\\n
\\n
\\n
\\n
{{t builds.name}}
\\n
{{number}}
\\n
{{t builds.finished_at}}
\\n
{{formatTime finished_at}}
\\n
{{t builds.duration}}
\\n
{{formatDuration duration}}
\\n
\\n\\n
\\n
{{t builds.commit}}
\\n
{{formatCommit commit}}
\\n {{#if commit.compareUrl}}\\n
{{t builds.compare}}
\\n
{{pathFrom commit.compareUrl}}
\\n {{/if}}\\n {{#if commit.authorName}}\\n
{{t builds.author}}
\\n
{{commit.authorName}}
\\n {{/if}}\\n {{#if commit.committerName}}\\n
{{t builds.committer}}
\\n
{{commit.committerName}}
\\n {{/if}}\\n
\\n\\n
{{t builds.message}}
\\n
{{{formatMessage commit.message}}}
\\n\\n {{#unless isMatrix}}\\n
{{t builds.config}}
\\n
{{formatConfig config}}
\\n {{/unless}}\\n
\\n\\n {{#if isMatrix}}\\n {{view Travis.Views.JobsView jobsBinding=\\\"view.requiredJobs\\\" required=\\\"true\\\"}}\\n {{view Travis.Views.JobsView jobsBinding=\\\"view.allowedFailureJobs\\\"}}\\n {{else}}\\n {{view Travis.Views.LogView contextBinding=\\\"jobs.firstObject\\\"}}\\n {{/if}}\\n
\\n{{/unless}}\\n\");Ember.TEMPLATES['jobs/list']=Ember.Handlebars.compile(\"{{#if view.jobs.length}}\\n \\n \\n \\n \\n {{#each configKeys}}\\n \\n {{/each}}\\n \\n \\n \\n {{#each job in view.jobs}}\\n {{#view Travis.Views.JobsItemView contextBinding=\\\"job\\\"}}\\n \\n \\n \\n \\n {{#each configValues}}\\n \\n {{/each}}\\n \\n {{/view}}\\n {{/each}}\\n \\n
\\n {{#if view.required}}\\n {{t jobs.build_matrix}}\\n {{else}}\\n {{t jobs.allowed_failures}}\\n \\n {{/if}}\\n
{{this}}
{{number}}{{formatDuration duration}}{{formatTime finished_at}}{{this}}
\\n\\n {{#unless view.required}}\\n
\\n
{{t \\\"jobs.allowed_failures\\\"}}
\\n
\\n

\\n Allowed Failures are items in your build matrix that are allowed to\\n fail without causing the entire build to be shown as failed. This lets you add\\n in experimental and preparatory builds to test against versions or\\n configurations that you are not ready to officially support.\\n

\\n

\\n You can define allowed failures in the build matrix as follows:\\n

\\n
 matrix:\\n  allow_failures:\\n    - rvm: ruby-head 
\\n
\\n
\\n {{/unless}}\\n{{/if}}\\n\");Ember.TEMPLATES['jobs/log']=Ember.Handlebars.compile(\"
{{{formatLog log.body}}}
\\n\\n{{#if sponsor.name}}\\n

\\n {{t builds.messages.sponsored_by}}\\n {{sponsor.name}}\\n

\\n{{/if}}\\n\");Ember.TEMPLATES['jobs/show']=Ember.Handlebars.compile(\"
\\n
\\n
\\n
Job
\\n
{{number}}
\\n
{{t jobs.finished_at}}
\\n
{{formatTime finished_at}}
\\n
{{t jobs.duration}}
\\n
{{formatDuration duration}}
\\n
\\n\\n
\\n
{{t jobs.commit}}
\\n
{{formatCommit commit}}
\\n {{#if commit.compareUrl}}\\n
{{t jobs.compare}}
\\n
{{pathFrom commit.compareUrl}}
\\n {{/if}}\\n {{#if commit.authorName}}\\n
{{t jobs.author}}
\\n
{{commit.authorName}}
\\n {{/if}}\\n {{#if commit.committerName}}\\n
{{t jobs.committer}}
\\n
{{commit.committerName}}
\\n {{/if}}\\n
\\n\\n
{{t jobs.message}}
\\n
{{formatMessage commit.message}}
\\n
{{t jobs.config}}
\\n
{{formatConfig config}}
\\n
\\n\\n {{view Travis.Views.LogView}}\\n
\\n\\n\");Ember.TEMPLATES['layouts/home']=Ember.Handlebars.compile(\"
\\n {{outlet top}}\\n
\\n\\n
\\n
\\n \\n
\\n\\n \\n\\n
\\n {{outlet left}}\\n
\\n
\\n\\n
\\n {{outlet main}}\\n\\n {{outlet tabs}}\\n\\n
\\n {{outlet tab}}\\n
\\n\\n
\\n {{outlet right}}\\n
\\n
\\n\\n\");Ember.TEMPLATES['layouts/sidebar']=Ember.Handlebars.compile(\"\\n {{t layouts.application.fork_me}}\\n\\n\\n
\\n
 \\n
\\n\\n{{view templateName=\\\"sponsors/decks\\\"}}\\n{{view templateName=\\\"workers/list\\\" id=\\\"workers\\\"}}\\n{{view templateName=\\\"queues/list\\\" id=\\\"queues\\\"}}\\n{{view templateName=\\\"sponsors/links\\\"}}\\n\\n
\\n

{{t layouts.about.alpha}}

\\n

{{{t layouts.about.messages.alpha}}}

\\n
\\n\\n
\\n

{{t layouts.about.join}}

\\n \\n
\\n\");Ember.TEMPLATES['layouts/simple']=Ember.Handlebars.compile(\"
\\n {{outlet top}}\\n
\\n\\n
\\n {{outlet main}}\\n
\\n\\n\");Ember.TEMPLATES['layouts/top']=Ember.Handlebars.compile(\"\\n

Travis

\\n
\\n\\n\\n\");Ember.TEMPLATES['profile/hooks']=Ember.Handlebars.compile(\"{{#if content.length}}\\n \\n{{else}}\\n

Please wait while we sync with GitHub

\\n{{/if}}\\n\\n\");Ember.TEMPLATES['profile/show']=Ember.Handlebars.compile(\"

{{name}}

\\n\\n\\n
\\n
\\n {{t profiles.show.github}}:\\n
\\n
\\n {{login}}\\n
\\n
\\n {{t profiles.show.email}}:\\n
\\n
\\n {{email}}\\n
\\n
\\n {{t profiles.show.token}}:\\n
\\n
\\n {{token}}\\n
\\n
\\n\\n

\\n {{{t profiles.show.messages.notice}}}\\n

\\n\\n

{{t profiles.show.your_locale}}

\\n
\\n \\n \\n
\\n\\n

{{t profiles.show.your_repos}}

\\n

\\n {{{t profiles.show.message.your_repos}}}\\n \\n {{{t profiles.show.message.config}}}\\n \\n

\\n\\n{{outlet hooks}}\\n\");Ember.TEMPLATES['queues/list']=Ember.Handlebars.compile(\"{{#each queue in queues}}\\n

{{t queue}}: {{queue.name}}

\\n \\n{{/each}}\\n\");Ember.TEMPLATES['repositories/list']=Ember.Handlebars.compile(\"