add SupportDatastoreEmulator field to aetest Options (#173)
Pass through --support_datastore_emulator. https://issuetracker.google.com/issues/119212211
diff --git a/aetest/instance.go b/aetest/instance.go
index 38c1d4e..f580467 100644
--- a/aetest/instance.go
+++ b/aetest/instance.go
@@ -25,6 +25,9 @@
// StronglyConsistentDatastore is whether the local datastore should be
// strongly consistent. This will diverge from production behaviour.
StronglyConsistentDatastore bool
+ // SupportDatastoreEmulator is whether use Cloud Datastore Emulator or
+ // use old SQLite based Datastore backend or use default settings.
+ SupportDatastoreEmulator *bool
// SuppressDevAppServerLog is whether the dev_appserver running in tests
// should output logs.
SuppressDevAppServerLog bool
diff --git a/aetest/instance_vm.go b/aetest/instance_vm.go
index dcb87d5..820e1ef 100644
--- a/aetest/instance_vm.go
+++ b/aetest/instance_vm.go
@@ -201,6 +201,9 @@
if i.opts != nil && i.opts.StronglyConsistentDatastore {
appserverArgs = append(appserverArgs, "--datastore_consistency_policy=consistent")
}
+ if i.opts != nil && i.opts.SupportDatastoreEmulator != nil {
+ appserverArgs = append(appserverArgs, fmt.Sprintf("--support_datastore_emulator=%t", *i.opts.SupportDatastoreEmulator))
+ }
appserverArgs = append(appserverArgs, filepath.Join(i.appDir, "app"))
i.child = exec.Command(python,