| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package logs | 5 package logs |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "bytes" | 8 "bytes" |
| 9 "errors" | 9 "errors" |
| 10 "fmt" | 10 "fmt" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 IndexWriter: &ibuf, | 276 IndexWriter: &ibuf, |
| 277 StreamIndexRange: 2, | 277 StreamIndexRange: 2, |
| 278 } | 278 } |
| 279 if err := archive.Archive(m); err != nil
{ | 279 if err := archive.Archive(m); err != nil
{ |
| 280 panic(err) | 280 panic(err) |
| 281 } | 281 } |
| 282 | 282 |
| 283 gsc.put("testbucket", "stream", lbuf.Byt
es()) | 283 gsc.put("testbucket", "stream", lbuf.Byt
es()) |
| 284 gsc.put("testbucket", "index", ibuf.Byte
s()) | 284 gsc.put("testbucket", "index", ibuf.Byte
s()) |
| 285 ls.State = coordinator.LSArchived | 285 ls.State = coordinator.LSArchived |
| 286 ls.ArchiveState = coordinator.Archived |
| 286 ls.ArchiveStreamURL = "gs://testbucket/s
tream" | 287 ls.ArchiveStreamURL = "gs://testbucket/s
tream" |
| 287 ls.ArchiveIndexURL = "gs://testbucket/in
dex" | 288 ls.ArchiveIndexURL = "gs://testbucket/in
dex" |
| 288 } | 289 } |
| 289 if err := ls.Put(ds.Get(c)); err != nil { | 290 if err := ls.Put(ds.Get(c)); err != nil { |
| 290 panic(err) | 291 panic(err) |
| 291 } | 292 } |
| 292 | 293 |
| 293 Convey(`Testing Get requests`, func() { | 294 Convey(`Testing Get requests`, func() { |
| 294 req := logdog.GetRequest{ | 295 req := logdog.GetRequest{ |
| 295 Path: string(ls.Path()), | 296 Path: string(ls.Path()), |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 resp, err := s.Tail(c, &req) | 570 resp, err := s.Tail(c, &req) |
| 570 So(err, ShouldBeRPCOK) | 571 So(err, ShouldBeRPCOK) |
| 571 So(resp, shouldHaveLogs, 7) | 572 So(resp, shouldHaveLogs, 7) |
| 572 So(resp.State, ShouldResemble, l
oadLogStreamState(ls)) | 573 So(resp.State, ShouldResemble, l
oadLogStreamState(ls)) |
| 573 }) | 574 }) |
| 574 }) | 575 }) |
| 575 }) | 576 }) |
| 576 } | 577 } |
| 577 }) | 578 }) |
| 578 } | 579 } |
| OLD | NEW |