"collection": map[string]interface{}{
"manifest_text": mtxt}})
c.Assert(err, check.IsNil)
- c.Assert(mtxt, check.Equals, coll.ManifestText)
+ // In order for the rest of the test to work as intended, the API server
+ // needs to retain the file ordering we set manually. We check that here.
+ // We can't check `mtxt == coll.ManifestText` because the API server
+ // might've returned new block signatures if the GET and POST happened in
+ // different seconds.
+ expectPattern := `\./dir1 \S+ 0:3:foo 3:3:bar\n`
+ c.Assert(coll.ManifestText, check.Matches, expectPattern)
fs, err := coll.FileSystem(s.client, s.kc)
c.Assert(err, check.IsNil)
var saved Collection
err = s.client.RequestAndDecode(&saved, "GET", "arvados/v1/collections/"+coll.UUID, nil, nil)
c.Assert(err, check.IsNil)
- c.Check(saved.ManifestText, check.Equals, mtxt)
+ c.Check(saved.ManifestText, check.Matches, expectPattern)
}
func (s *CollectionFSSuite) TestHttpFileSystemInterface(c *check.C) {
runtime.ReadMemStats(&memstats)
c.Logf("%s Alloc=%d Sys=%d", time.Now(), memstats.Alloc, memstats.Sys)
- f, err := coll.FileSystem(nil, nil)
+ f, err := coll.FileSystem(NewClientFromEnv(), &keepClientStub{})
c.Check(err, check.IsNil)
c.Logf("%s loaded", time.Now())
c.Check(f.Size(), check.Equals, int64(42*dirCount*fileCount))