Commit 4989dbf889
Verified · cmc
Layout: unified · split
internal/httpd/buildpages_test.go +14
| @@ -317,3 +317,17 @@ func TestBuildPageStepSummaryIsFirstLine(t *testing.T) { | ||
| 317 | 317 | t.Errorf("summary shows the whole multi-line step") |
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | ||
| 321 | // The Live note says the page updates itself, in plain words, rather | |
| 322 | // than the more technical "streams here" (#271). | |
| 323 | func TestBuildPageLiveNoteSaysItUpdatesItself(t *testing.T) { | |
| 324 | var sb strings.Builder | |
| 325 | if err := web.Render(&sb, "build.html", buildView{ | |
| 326 | repoPage: testRepoPage(), Live: true, | |
| 327 | }); err != nil { | |
| 328 | t.Fatalf("render: %v", err) | |
| 329 | } | |
| 330 | if !strings.Contains(sb.String(), "This page updates itself") { | |
| 331 | t.Error(`Live note does not say the page updates itself`) | |
| 332 | } | |
| 333 | } | |
internal/web/templates/build.html +1 −1
| @@ -12,7 +12,7 @@ | ||
| 12 | 12 | {{end}} |
| 13 | 13 | </div> |
| 14 | 14 | <p class="meta">{{.Build.Job}} on {{.Build.Ref}} · <code><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/commit/{{.Build.SHA}}">{{printf "%.10s" .Build.SHA}}</a></code> · queued {{when .Build.CreatedAt}}{{if .Build.FinishedAt}} · finished {{when .Build.FinishedAt}}{{with .Duration}} · ran {{.}}{{end}}{{end}}{{if .Failed}} · <a href="#failed">Jump to failure</a>{{end}}</p> |
| 15 | {{if .Live}}<p class="meta">Live: the log streams here until the build ends. If it stops without a “build finished” line, reload to pick it up again. <a href="?follow=0">Show it without updates</a></p> | |
| 15 | {{if .Live}}<p class="meta">This page updates itself until the build ends. If it stops without a “build finished” line, reload to pick it up again. <a href="?follow=0">Show it without updates</a></p> | |
| 16 | 16 | <pre class="code buildlog" tabindex="0">{{.Log}}</pre> |
| 17 | 17 | {{else if .Steps}}{{$total := len .Build.Steps}}{{range .Steps}} |
| 18 | 18 | <details class="difffold buildstep"{{if .Failed}} id="failed" open{{end}}> |