Skip to content

Commit

Permalink
Upgrade python version being used by the ci workflow. (#315)
Browse files Browse the repository at this point in the history
* Upgrade python version being used by the ci workflow.

* Update the python version in instance_vm.go.

* Try to fix the v1 gomod test.

* Add export python3 back.

* Stop trying to find python2.7.

* Seems like we still need to install python3.

* There seems to be a mismatch between APPENGINE_DEV_APPSERVER_BINARY and APPENGINE_DEV_APPSERVER.

* Apply the same change to v2 ci.
  • Loading branch information
jinglundong committed Jul 11, 2023
1 parent 93c9fa1 commit f96845d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
16 changes: 11 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ 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, 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
export CLOUDSDK_PYTHON="python3"
- name: Set up Go
uses: actions/setup-go@v2
with:
Expand Down Expand Up @@ -47,10 +49,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:
Expand All @@ -60,10 +63,12 @@ jobs:
go-version: [ '1.11.x', '1.12.x']

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
export CLOUDSDK_PYTHON="python3"
- name: Set up Go
uses: actions/setup-go@v2
with:
Expand Down Expand Up @@ -91,6 +96,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
2 changes: 1 addition & 1 deletion aetest/instance_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion v2/aetest/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f96845d

Please sign in to comment.