Skip to content

Commit

Permalink
[atest] Specify path to dev_appserver datastore file via APPENGINE_DE…
Browse files Browse the repository at this point in the history
…V_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")`
  • Loading branch information
jubishop committed Feb 25, 2021
1 parent 07f9b08 commit b48684e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion aetest/instance_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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")
Expand Down

0 comments on commit b48684e

Please sign in to comment.