| Index: filter/count/count_test.go
 | 
| diff --git a/filter/count/count_test.go b/filter/count/count_test.go
 | 
| index 1fe7c9b2eae489bb956c9c75c4f9ef9a7f2ddaf0..59cc3cafa16bd15df92d08b8055f092b1dc08e9e 100644
 | 
| --- a/filter/count/count_test.go
 | 
| +++ b/filter/count/count_test.go
 | 
| @@ -10,7 +10,7 @@ import (
 | 
|  
 | 
|  	"github.com/luci/gae/filter/featureBreaker"
 | 
|  	"github.com/luci/gae/impl/memory"
 | 
| -	"github.com/luci/gae/service/datastore"
 | 
| +	ds "github.com/luci/gae/service/datastore"
 | 
|  	"github.com/luci/gae/service/info"
 | 
|  	"github.com/luci/gae/service/mail"
 | 
|  	"github.com/luci/gae/service/memcache"
 | 
| @@ -53,24 +53,22 @@ func TestCount(t *testing.T) {
 | 
|  		So(c, ShouldNotBeNil)
 | 
|  		So(ctr, ShouldNotBeNil)
 | 
|  
 | 
| -		ds := datastore.Get(c)
 | 
| -		vals := []datastore.PropertyMap{{
 | 
| -			"Val":  datastore.MkProperty(100),
 | 
| -			"$key": datastore.MkPropertyNI(ds.NewKey("Kind", "", 1, nil)),
 | 
| +		vals := []ds.PropertyMap{{
 | 
| +			"Val":  ds.MkProperty(100),
 | 
| +			"$key": ds.MkPropertyNI(ds.NewKey(c, "Kind", "", 1, nil)),
 | 
|  		}}
 | 
|  
 | 
|  		Convey("Calling a ds function should reflect in counter", func() {
 | 
| -			So(ds.PutMulti(vals), ShouldBeNil)
 | 
| +			So(ds.Put(c, vals), ShouldBeNil)
 | 
|  			So(ctr.PutMulti.Successes(), ShouldEqual, 1)
 | 
|  
 | 
|  			Convey("effects are cumulative", func() {
 | 
| -				So(ds.PutMulti(vals), ShouldBeNil)
 | 
| +				So(ds.Put(c, vals), ShouldBeNil)
 | 
|  				So(ctr.PutMulti.Successes(), ShouldEqual, 2)
 | 
|  
 | 
|  				Convey("even within transactions", func() {
 | 
| -					die(ds.RunInTransaction(func(c context.Context) error {
 | 
| -						ds := datastore.Get(c)
 | 
| -						So(ds.PutMulti(append(vals, vals[0])), ShouldBeNil)
 | 
| +					die(ds.RunInTransaction(c, func(c context.Context) error {
 | 
| +						So(ds.Put(c, append(vals, vals[0])), ShouldBeNil)
 | 
|  						return nil
 | 
|  					}, nil))
 | 
|  				})
 | 
| @@ -80,23 +78,23 @@ func TestCount(t *testing.T) {
 | 
|  		Convey("errors count against errors", func() {
 | 
|  			fb.BreakFeatures(nil, "GetMulti")
 | 
|  
 | 
| -			So(ds.GetMulti(vals), ShouldErrLike, `"GetMulti" is broken`)
 | 
| +			So(ds.Get(c, vals), ShouldErrLike, `"GetMulti" is broken`)
 | 
|  			So(ctr.GetMulti.Errors(), ShouldEqual, 1)
 | 
|  
 | 
|  			fb.UnbreakFeatures("GetMulti")
 | 
|  
 | 
| -			So(ds.PutMulti(vals), ShouldBeNil)
 | 
| +			So(ds.Put(c, vals), ShouldBeNil)
 | 
|  
 | 
| -			die(ds.GetMulti(vals))
 | 
| +			die(ds.Get(c, vals))
 | 
|  			So(ctr.GetMulti.Errors(), ShouldEqual, 1)
 | 
|  			So(ctr.GetMulti.Successes(), ShouldEqual, 1)
 | 
|  			So(ctr.GetMulti.Total(), ShouldEqual, 2)
 | 
|  		})
 | 
|  
 | 
|  		Convey(`datastore.Stop does not count as an error`, func() {
 | 
| -			fb.BreakFeatures(datastore.Stop, "GetMulti")
 | 
| +			fb.BreakFeatures(ds.Stop, "GetMulti")
 | 
|  
 | 
| -			So(ds.GetMulti(vals), ShouldBeNil)
 | 
| +			So(ds.Get(c, vals), ShouldBeNil)
 | 
|  			So(ctr.GetMulti.Successes(), ShouldEqual, 1)
 | 
|  			So(ctr.GetMulti.Errors(), ShouldEqual, 0)
 | 
|  			So(ctr.GetMulti.Total(), ShouldEqual, 1)
 | 
| @@ -107,14 +105,13 @@ func TestCount(t *testing.T) {
 | 
|  		c, ctr := FilterMC(memory.Use(context.Background()))
 | 
|  		So(c, ShouldNotBeNil)
 | 
|  		So(ctr, ShouldNotBeNil)
 | 
| -		mc := memcache.Get(c)
 | 
|  
 | 
| -		die(mc.Set(mc.NewItem("hello").SetValue([]byte("sup"))))
 | 
| +		die(memcache.Set(c, memcache.NewItem(c, "hello").SetValue([]byte("sup"))))
 | 
|  
 | 
| -		_, err := mc.Get("Wat")
 | 
| +		_, err := memcache.GetKey(c, "Wat")
 | 
|  		So(err, ShouldNotBeNil)
 | 
|  
 | 
| -		_, err = mc.Get("hello")
 | 
| +		_, err = memcache.GetKey(c, "hello")
 | 
|  		die(err)
 | 
|  
 | 
|  		So(ctr.SetMulti, shouldHaveSuccessesAndErrors, 1, 0)
 | 
| @@ -126,10 +123,9 @@ func TestCount(t *testing.T) {
 | 
|  		c, ctr := FilterTQ(memory.Use(context.Background()))
 | 
|  		So(c, ShouldNotBeNil)
 | 
|  		So(ctr, ShouldNotBeNil)
 | 
| -		tq := taskqueue.Get(c)
 | 
|  
 | 
| -		die(tq.Add(&taskqueue.Task{Name: "wat"}, ""))
 | 
| -		So(tq.Add(&taskqueue.Task{Name: "wat"}, "DNE_QUEUE"),
 | 
| +		die(taskqueue.Add(c, "", &taskqueue.Task{Name: "wat"}))
 | 
| +		So(taskqueue.Add(c, "DNE_QUEUE", &taskqueue.Task{Name: "wat"}),
 | 
|  			ShouldErrLike, "UNKNOWN_QUEUE")
 | 
|  
 | 
|  		So(ctr.AddMulti, shouldHaveSuccessesAndErrors, 1, 1)
 | 
| @@ -141,12 +137,10 @@ func TestCount(t *testing.T) {
 | 
|  		So(c, ShouldNotBeNil)
 | 
|  		So(ctr, ShouldNotBeNil)
 | 
|  
 | 
| -		gi := info.Get(c)
 | 
| -
 | 
| -		_, err := gi.Namespace("foo")
 | 
| +		_, err := info.Namespace(c, "foo")
 | 
|  		die(err)
 | 
|  		fb.BreakFeatures(nil, "Namespace")
 | 
| -		_, err = gi.Namespace("boom")
 | 
| +		_, err = info.Namespace(c, "boom")
 | 
|  		So(err, ShouldErrLike, `"Namespace" is broken`)
 | 
|  
 | 
|  		So(ctr.Namespace, shouldHaveSuccessesAndErrors, 1, 1)
 | 
| @@ -158,12 +152,10 @@ func TestCount(t *testing.T) {
 | 
|  		So(c, ShouldNotBeNil)
 | 
|  		So(ctr, ShouldNotBeNil)
 | 
|  
 | 
| -		u := user.Get(c)
 | 
| -
 | 
| -		_, err := u.CurrentOAuth("foo")
 | 
| +		_, err := user.CurrentOAuth(c, "foo")
 | 
|  		die(err)
 | 
|  		fb.BreakFeatures(nil, "CurrentOAuth")
 | 
| -		_, err = u.CurrentOAuth("foo")
 | 
| +		_, err = user.CurrentOAuth(c, "foo")
 | 
|  		So(err, ShouldErrLike, `"CurrentOAuth" is broken`)
 | 
|  
 | 
|  		So(ctr.CurrentOAuth, shouldHaveSuccessesAndErrors, 1, 1)
 | 
| @@ -175,9 +167,7 @@ func TestCount(t *testing.T) {
 | 
|  		So(c, ShouldNotBeNil)
 | 
|  		So(ctr, ShouldNotBeNil)
 | 
|  
 | 
| -		m := mail.Get(c)
 | 
| -
 | 
| -		err := m.Send(&mail.Message{
 | 
| +		err := mail.Send(c, &mail.Message{
 | 
|  			Sender: "admin@example.com",
 | 
|  			To:     []string{"coolDood@example.com"},
 | 
|  			Body:   "hi",
 | 
| @@ -185,7 +175,7 @@ func TestCount(t *testing.T) {
 | 
|  		die(err)
 | 
|  
 | 
|  		fb.BreakFeatures(nil, "Send")
 | 
| -		err = m.Send(&mail.Message{
 | 
| +		err = mail.Send(c, &mail.Message{
 | 
|  			Sender: "admin@example.com",
 | 
|  			To:     []string{"coolDood@example.com"},
 | 
|  			Body:   "hi",
 | 
| @@ -206,12 +196,11 @@ func ExampleFilterRDS() {
 | 
|  	// functions use ds from the context like normal... they don't need to know
 | 
|  	// that there are any filters at all.
 | 
|  	someCalledFunc := func(c context.Context) {
 | 
| -		ds := datastore.Get(c)
 | 
| -		vals := []datastore.PropertyMap{{
 | 
| -			"FieldName": datastore.MkProperty(100),
 | 
| -			"$key":      datastore.MkProperty(ds.NewKey("Kind", "", 1, nil))},
 | 
| +		vals := []ds.PropertyMap{{
 | 
| +			"FieldName": ds.MkProperty(100),
 | 
| +			"$key":      ds.MkProperty(ds.NewKey(c, "Kind", "", 1, nil))},
 | 
|  		}
 | 
| -		if err := ds.PutMulti(vals); err != nil {
 | 
| +		if err := ds.Put(c, vals); err != nil {
 | 
|  			panic(err)
 | 
|  		}
 | 
|  	}
 | 
| 
 |