Skip to content

Commit 4379843

Browse files
Merge pull request #4716 from linuxfoundation/unicron-update-test-coverage
Update test coverage
2 parents 622bfd1 + 0611598 commit 4379843

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

tests/py2go/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
- `` DEBUG='' USER_UUID=b817eb57-045a-4fe0-8473-fbb416a01d70 PY_API_URL=https://api.lfcla.dev.platform.linuxfoundation.org go test -v -run '^TestUserActiveSignatureAPI$' ``.
2525
- `` REPO_ID=466156917 PR_ID=3 DEBUG=1 go test -v -run '^TestUserActiveSignatureAPI$' ``.
2626
- `` MAX_PARALLEL=2 DEBUG='' go test -v -run '^TestAllUserActiveSignatureAPI$' ``.
27+
- `` [STAGE=prod PROD=1] REMOTE=1 make ``.

tests/py2go/api_test.go

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"math/rand"
88
"net/http"
99
"os"
10+
"runtime"
1011
"sort"
1112
"strconv"
1213
"strings"
@@ -29,6 +30,8 @@ var (
2930
PY_API_URL string
3031
GO_API_URL string
3132
DEBUG bool
33+
REMOTE bool
34+
PROD bool
3235
MAX_PARALLEL int
3336
PROJECT_UUID string
3437
USER_UUID string
@@ -99,19 +102,34 @@ var (
99102
func init() {
100103
TOKEN = os.Getenv("TOKEN")
101104
XACL = os.Getenv("XACL")
105+
REMOTE = os.Getenv("REMOTE") != ""
106+
PROD = os.Getenv("PROD") != ""
102107
PY_API_URL = os.Getenv("PY_API_URL")
103108
if PY_API_URL == "" {
104-
PY_API_URL = "http://127.0.0.1:5000"
109+
if REMOTE {
110+
if PROD {
111+
PY_API_URL = "https://api.easycla.lfx.linuxfoundation.org"
112+
} else {
113+
PY_API_URL = "https://api.lfcla.dev.platform.linuxfoundation.org"
114+
}
115+
} else {
116+
PY_API_URL = "http://127.0.0.1:5000"
117+
}
105118
}
106119
GO_API_URL = os.Getenv("GO_API_URL")
107120
if GO_API_URL == "" {
108-
GO_API_URL = "http://127.0.0.1:5001"
109-
}
110-
dbg := os.Getenv("DEBUG")
111-
if dbg != "" {
112-
DEBUG = true
121+
if REMOTE {
122+
if PROD {
123+
GO_API_URL = "https://api-gw.platform.linuxfoundation.org/cla-service"
124+
} else {
125+
GO_API_URL = "https://api-gw.dev.platform.linuxfoundation.org/cla-service"
126+
}
127+
} else {
128+
GO_API_URL = "http://127.0.0.1:5001"
129+
}
113130
}
114-
MAX_PARALLEL = 1
131+
DEBUG = os.Getenv("DEBUG") != ""
132+
MAX_PARALLEL = runtime.NumCPU()
115133
par := os.Getenv("MAX_PARALLEL")
116134
if par != "" {
117135
iPar, err := strconv.Atoi(par)

0 commit comments

Comments
 (0)