From 81fc7e1a20df4f64e13846fd03a27ee96427eabb Mon Sep 17 00:00:00 2001 From: Jinglun Dong <1683035+jinglundong@users.noreply.github.com> Date: Tue, 11 Jul 2023 00:54:12 +0000 Subject: [PATCH 1/8] Upgrade python version being used by the ci workflow. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d9e5c37..c04c66f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,10 +15,11 @@ jobs: go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x', '1.18.x', '1.19.x', '1.20.x'] steps: - - name: Update base image and intall Python2 + - name: Update base image and intall Python3 run: | sudo apt-get update - sudo apt-get install -y python2 + sudo apt-get install -y python3 + export CLOUDSDK_PYTHON="python3" - name: Set up Go uses: actions/setup-go@v2 with: From c33370a66437b3720d7d496ba617c8b31157d603 Mon Sep 17 00:00:00 2001 From: Jinglun Dong <1683035+jinglundong@users.noreply.github.com> Date: Tue, 11 Jul 2023 01:57:32 +0000 Subject: [PATCH 2/8] Update the python version in instance_vm.go. --- aetest/instance_vm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aetest/instance_vm.go b/aetest/instance_vm.go index e1647fdb..f950bb3e 100644 --- a/aetest/instance_vm.go +++ b/aetest/instance_vm.go @@ -117,7 +117,7 @@ func fileExists(path string) bool { } func findPython() (path string, err error) { - for _, name := range []string{"python2.7", "python"} { + for _, name := range []string{"python3", "python2.7", "python"} { path, err = exec.LookPath(name) if err == nil { return From 9502ba91ff2cd32d9d4bbd19b578e43883475045 Mon Sep 17 00:00:00 2001 From: Jinglun Dong <1683035+jinglundong@users.noreply.github.com> Date: Tue, 11 Jul 2023 02:19:20 +0000 Subject: [PATCH 3/8] Try to fix the v1 gomod test. --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c04c66f7..2fba48c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y python3 - export CLOUDSDK_PYTHON="python3" - name: Set up Go uses: actions/setup-go@v2 with: @@ -48,10 +47,11 @@ jobs: GO111MODULE: on run: | export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py) + export CLOUDSDK_PYTHON="python3" go test -v -cover -race google.golang.org/appengine/... # TestAPICallAllocations doesn't run under race detector. go test -v -cover google.golang.org/appengine/internal/... -run TestAPICallAllocations - + test-gopath: runs-on: ubuntu-latest strategy: @@ -61,10 +61,10 @@ jobs: go-version: [ '1.11.x', '1.12.x'] steps: - - name: Update base image and intall Python2 + - name: Update base image and intall Python3 run: | sudo apt-get update - sudo apt-get install -y python2 + sudo apt-get install -y python3 - name: Set up Go uses: actions/setup-go@v2 with: @@ -92,6 +92,7 @@ jobs: - name: Test gopath run: | export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py) + export CLOUDSDK_PYTHON="python3" go test -v -cover -race google.golang.org/appengine/... # TestAPICallAllocations doesn't run under race detector. go test -v -cover google.golang.org/appengine/internal/... -run TestAPICallAllocations From 87999f37f89edc8e01bd238ca51bdec8e4ddd2fc Mon Sep 17 00:00:00 2001 From: Jinglun Dong <1683035+jinglundong@users.noreply.github.com> Date: Tue, 11 Jul 2023 02:32:05 +0000 Subject: [PATCH 4/8] Add export python3 back. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fba48c3..b2577545 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y python3 + export CLOUDSDK_PYTHON="python3" - name: Set up Go uses: actions/setup-go@v2 with: @@ -65,6 +66,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y python3 + export CLOUDSDK_PYTHON="python3" - name: Set up Go uses: actions/setup-go@v2 with: From 014dc4e292c0b4ac5ea1b677ab60a5b5d3d61fad Mon Sep 17 00:00:00 2001 From: Jinglun Dong <1683035+jinglundong@users.noreply.github.com> Date: Tue, 11 Jul 2023 02:46:25 +0000 Subject: [PATCH 5/8] Stop trying to find python2.7. --- aetest/instance_vm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aetest/instance_vm.go b/aetest/instance_vm.go index f950bb3e..b59d2e9f 100644 --- a/aetest/instance_vm.go +++ b/aetest/instance_vm.go @@ -117,7 +117,7 @@ func fileExists(path string) bool { } func findPython() (path string, err error) { - for _, name := range []string{"python3", "python2.7", "python"} { + for _, name := range []string{"python3"} { path, err = exec.LookPath(name) if err == nil { return From 4a43a5e7bb3d35335ace36afda751061725bb8b6 Mon Sep 17 00:00:00 2001 From: Jinglun Dong <1683035+jinglundong@users.noreply.github.com> Date: Tue, 11 Jul 2023 03:09:56 +0000 Subject: [PATCH 6/8] Seems like we still need to install python3. --- .github/workflows/ci.yml | 6 ++++-- aetest/instance_vm.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b2577545..4b9f917c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,10 @@ jobs: go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x', '1.18.x', '1.19.x', '1.20.x'] steps: - - name: Update base image and intall Python3 + - name: Update base image, intall Python2 and Python3 run: | sudo apt-get update + sudo apt-get install -y python2 sudo apt-get install -y python3 export CLOUDSDK_PYTHON="python3" - name: Set up Go @@ -62,9 +63,10 @@ jobs: go-version: [ '1.11.x', '1.12.x'] steps: - - name: Update base image and intall Python3 + - name: Update base image, intall Python2 and Python3 run: | sudo apt-get update + sudo apt-get install -y python2 sudo apt-get install -y python3 export CLOUDSDK_PYTHON="python3" - name: Set up Go diff --git a/aetest/instance_vm.go b/aetest/instance_vm.go index b59d2e9f..e1647fdb 100644 --- a/aetest/instance_vm.go +++ b/aetest/instance_vm.go @@ -117,7 +117,7 @@ func fileExists(path string) bool { } func findPython() (path string, err error) { - for _, name := range []string{"python3"} { + for _, name := range []string{"python2.7", "python"} { path, err = exec.LookPath(name) if err == nil { return From 9317b2465c65cb0bd441d1d9921a8fcc32ee79b6 Mon Sep 17 00:00:00 2001 From: Jinglun Dong <1683035+jinglundong@users.noreply.github.com> Date: Tue, 11 Jul 2023 03:19:38 +0000 Subject: [PATCH 7/8] There seems to be a mismatch between APPENGINE_DEV_APPSERVER_BINARY and APPENGINE_DEV_APPSERVER. --- aetest/instance_vm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aetest/instance_vm.go b/aetest/instance_vm.go index e1647fdb..1f36bbe6 100644 --- a/aetest/instance_vm.go +++ b/aetest/instance_vm.go @@ -145,7 +145,7 @@ func (i *instance) startChild() (err error) { return err } } - executable := os.Getenv("APPENGINE_DEV_APPSERVER_BINARY") + executable := os.Getenv("APPENGINE_DEV_APPSERVER") var appserverArgs []string if len(executable) == 0 { executable, err = findPython() From 2182fec3b8cdad819366741d3fcbc73f71399ed7 Mon Sep 17 00:00:00 2001 From: Jinglun Dong <1683035+jinglundong@users.noreply.github.com> Date: Tue, 11 Jul 2023 03:29:26 +0000 Subject: [PATCH 8/8] Apply the same change to v2 ci. --- .github/workflows/ci-v2.yaml | 14 +++++++++----- v2/aetest/instance.go | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-v2.yaml b/.github/workflows/ci-v2.yaml index 35102e8a..28794e71 100644 --- a/.github/workflows/ci-v2.yaml +++ b/.github/workflows/ci-v2.yaml @@ -17,10 +17,11 @@ jobs: working-directory: ./v2 steps: - - name: Update base image and install Python2 + - name: Update base image, intall Python2 and Python3 run: | sudo apt-get update - sudo apt-get install -y python2 + sudo apt-get install -y python2 + sudo apt-get install -y python3 - name: Set up Go uses: actions/setup-go@v2 with: @@ -51,6 +52,7 @@ jobs: working-directory: ${{env.working-directory}} run: | export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py) + export CLOUDSDK_PYTHON="python3" go test -v -cover -race google.golang.org/appengine/v2/... # TestAPICallAllocations doesn't run under race detector. go test -v -cover google.golang.org/appengine/v2/internal/... -run TestAPICallAllocations @@ -64,12 +66,13 @@ jobs: go-version: [ '1.11.x', '1.12.x'] env: working-directory: ./v2 - + steps: - - name: Update base image and intall Python2 + - name: Update base image, intall Python2 and Python3 run: | sudo apt-get update - sudo apt-get install -y python2 + sudo apt-get install -y python2 + sudo apt-get install -y python3 - name: Set up Go uses: actions/setup-go@v2 with: @@ -99,6 +102,7 @@ jobs: working-directory: ${{env.working-directory}} run: | export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py) + export CLOUDSDK_PYTHON="python3" go test -v -cover -race google.golang.org/appengine/v2/... # TestAPICallAllocations doesn't run under race detector. go test -v -cover google.golang.org/appengine/v2/internal/... -run TestAPICallAllocations diff --git a/v2/aetest/instance.go b/v2/aetest/instance.go index 994bec64..5ca59f64 100644 --- a/v2/aetest/instance.go +++ b/v2/aetest/instance.go @@ -167,7 +167,7 @@ func fileExists(path string) bool { } func findPython() (path string, err error) { - for _, name := range []string{"python2.7", "python"} { + for _, name := range []string{"python3"} { path, err = exec.LookPath(name) if err == nil { return