Update API mirror URL and fix test case
This commit is contained in:
parent
92a06bd5c2
commit
14a97da330
4 changed files with 10 additions and 5 deletions
2
.github/workflows/pr-test.yml
vendored
2
.github/workflows/pr-test.yml
vendored
|
|
@ -40,7 +40,7 @@ env:
|
||||||
|
|
||||||
OPENAI_TEST_KEY: ${{ secrets.OPENAI_TEST_KEY }}
|
OPENAI_TEST_KEY: ${{ secrets.OPENAI_TEST_KEY }}
|
||||||
TEST_MOAPI_SECRET: ${{ secrets.OPENAI_TEST_KEY }}
|
TEST_MOAPI_SECRET: ${{ secrets.OPENAI_TEST_KEY }}
|
||||||
TEST_MOAPI_MIRROR: https://api.openai.com/v1
|
TEST_MOAPI_MIRROR: https://api.openai.com
|
||||||
|
|
||||||
TAB_NAME: "::PET ADMIN"
|
TAB_NAME: "::PET ADMIN"
|
||||||
PAGE_SIZE: "20"
|
PAGE_SIZE: "20"
|
||||||
|
|
|
||||||
2
.github/workflows/unit-test.yml
vendored
2
.github/workflows/unit-test.yml
vendored
|
|
@ -44,7 +44,7 @@ env:
|
||||||
|
|
||||||
OPENAI_TEST_KEY: ${{ secrets.OPENAI_TEST_KEY }}
|
OPENAI_TEST_KEY: ${{ secrets.OPENAI_TEST_KEY }}
|
||||||
TEST_MOAPI_SECRET: ${{ secrets.OPENAI_TEST_KEY }}
|
TEST_MOAPI_SECRET: ${{ secrets.OPENAI_TEST_KEY }}
|
||||||
TEST_MOAPI_MIRROR: https://api.openai.com/v1
|
TEST_MOAPI_MIRROR: https://api.openai.com
|
||||||
|
|
||||||
TAB_NAME: "::PET ADMIN"
|
TAB_NAME: "::PET ADMIN"
|
||||||
PAGE_SIZE: "20"
|
PAGE_SIZE: "20"
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package pipe
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -51,6 +52,7 @@ func TestRun(t *testing.T) {
|
||||||
func prepare(t *testing.T) {
|
func prepare(t *testing.T) {
|
||||||
test.Prepare(t, config.Conf)
|
test.Prepare(t, config.Conf)
|
||||||
mirror := os.Getenv("TEST_MOAPI_MIRROR")
|
mirror := os.Getenv("TEST_MOAPI_MIRROR")
|
||||||
|
fmt.Println(mirror)
|
||||||
secret := os.Getenv("TEST_MOAPI_SECRET")
|
secret := os.Getenv("TEST_MOAPI_SECRET")
|
||||||
share.App = share.AppInfo{
|
share.App = share.AppInfo{
|
||||||
Moapi: share.Moapi{Channel: "stable", Mirrors: []string{mirror}, Secret: secret},
|
Moapi: share.Moapi{Channel: "stable", Mirrors: []string{mirror}, Secret: secret},
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,11 @@ import (
|
||||||
// **Warning** This process under developing, do not use it
|
// **Warning** This process under developing, do not use it
|
||||||
func ProcessValidate(process *process.Process) interface{} {
|
func ProcessValidate(process *process.Process) interface{} {
|
||||||
process.ValidateArgNums(2)
|
process.ValidateArgNums(2)
|
||||||
data := process.ArgsMap(0, map[string]interface{}{}).Dot()
|
if _, ok := process.Args[0].(map[string]interface{}); !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
data := process.ArgsMap(0, map[string]interface{}{}).Dot()
|
||||||
rules := process.ArgsRecords(1)
|
rules := process.ArgsRecords(1)
|
||||||
for _, rule := range rules {
|
for _, rule := range rules {
|
||||||
for method, value := range rule {
|
for method, value := range rule {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue