Skip to content

Make impl/memory compatible with appengine.APICallFunc hooks to allow existing codebases to use it. #37

@jongillham

Description

@jongillham

A few months ago a google.golang.org/appengine commit exposed functionality for intercepting API calls. It would be great if luci/gaes memory backend could plug into this for others to use who are just using the google.golang.org/appengine APIs.

The functionality would go something like this:

    import (
        "testing"

        "golang.org/x/net/context"
        "google.golang.org/appengine"

        "github.com/luci/gae/impl/memory"
    )

    func TestCode(t *testing.T) {
        ctx := context.Background()
        ctx = appengine.WithAPICallFunc(ctx, memory.APICallFunc)

        // User test code for example:
        if _, err := datastore.Put(ctx, key, entity); err != nil {
            t.Fatal(err)
        }
    }

I thought I would just put it out there – even though I understand it will probably never be on the roadmap. Too many open files errors are driving me crazy so I thought I would do something vaguely positive to try and get off dev_appserver.py for unit testing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions