From b48684e5a80c19f7fd76d297d25e97b6554fb77a Mon Sep 17 00:00:00 2001 From: Justin Bishop Date: Wed, 24 Feb 2021 16:02:10 -0800 Subject: [PATCH] [atest] Specify path to dev_appserver datastore file via APPENGINE_DEV_APPSERVER_DATASTORE_PATH (#232) If the environment variable `APPENGINE_DEV_APPSERVER_DATASTORE_PATH` is set, use it as the path to the dev_appserver datastore file, rather than the default of `filepath.Join(i.appDir, "datastore")` --- aetest/instance_vm.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aetest/instance_vm.go b/aetest/instance_vm.go index 89ff8b16..d2e5d298 100644 --- a/aetest/instance_vm.go +++ b/aetest/instance_vm.go @@ -192,6 +192,11 @@ func (i *instance) startChild() (err error) { return err } + datastorePath := os.Getenv("APPENGINE_DEV_APPSERVER_DATASTORE_PATH") + if len(datastorePath) == 0 { + datastorePath = filepath.Join(i.appDir, "datastore") + } + appserverArgs = append(appserverArgs, "--port=0", "--api_port=0", @@ -200,7 +205,7 @@ func (i *instance) startChild() (err error) { "--skip_sdk_update_check=true", "--clear_datastore=true", "--clear_search_indexes=true", - "--datastore_path", filepath.Join(i.appDir, "datastore"), + "--datastore_path", datastorePath, ) if i.opts != nil && i.opts.StronglyConsistentDatastore { appserverArgs = append(appserverArgs, "--datastore_consistency_policy=consistent")