update
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
services:
|
||||
dev:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.dev
|
||||
working_dir: /workspace
|
||||
command: air -c .air.toml
|
||||
tty: true
|
||||
stdin_open: true
|
||||
env_file:
|
||||
- dev.env
|
||||
volumes:
|
||||
- ./:/workspace
|
||||
- go_mod_cache:/go/pkg/mod
|
||||
- go_build_cache:/root/.cache/go-build
|
||||
ports:
|
||||
- "${ADDR:-8080}:8080"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
flaresolverr:
|
||||
condition: service_started
|
||||
networks:
|
||||
- goyomi_dev
|
||||
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- dev.env
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
volumes:
|
||||
- postgres_dev_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
networks:
|
||||
- goyomi_dev
|
||||
|
||||
flaresolverr:
|
||||
image: ghcr.io/flaresolverr/flaresolverr:latest
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- dev.env
|
||||
environment:
|
||||
LOG_LEVEL: ${FLARESOLVERR_LOG_LEVEL}
|
||||
networks:
|
||||
- goyomi_dev
|
||||
|
||||
networks:
|
||||
goyomi_dev:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
go_mod_cache:
|
||||
go_build_cache:
|
||||
postgres_dev_data:
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/cookiejar"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -37,7 +38,8 @@ func SetVerboseLog(enabled bool) {
|
||||
}
|
||||
|
||||
func ProxyEnabled() bool {
|
||||
if globalProxy {
|
||||
envProxy := os.Getenv("FLARESOLVERR_PROXY") == "1"
|
||||
if globalProxy || envProxy {
|
||||
return true
|
||||
}
|
||||
if config.IsFlareSolverrProxyEnabled() {
|
||||
@@ -90,6 +92,7 @@ func WithVerboseLog(enabled bool) Option {
|
||||
|
||||
func NewClient(opts ...Option) *Client {
|
||||
jar, _ := cookiejar.New(nil)
|
||||
vLog := os.Getenv("VERBOSE_LOG") == "1"
|
||||
c := &Client{
|
||||
http: &http.Client{Timeout: 30 * time.Second, Jar: jar},
|
||||
fsClient: globalFSClient,
|
||||
@@ -97,7 +100,7 @@ func NewClient(opts ...Option) *Client {
|
||||
rateLimit: 1,
|
||||
burst: 1,
|
||||
limiters: map[string]*rate.Limiter{},
|
||||
verboseLog: verboseLog,
|
||||
verboseLog: verboseLog || vLog,
|
||||
}
|
||||
for _, o := range opts {
|
||||
o(c)
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
package sources_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"goyomi/internal/source"
|
||||
"goyomi/sources/en/kaizenscan"
|
||||
"goyomi/sources/en/kewnscans"
|
||||
"goyomi/sources/en/lunatoons"
|
||||
"goyomi/sources/en/mistscans"
|
||||
"goyomi/sources/en/necroscans"
|
||||
"goyomi/sources/en/nyanukafe"
|
||||
"goyomi/sources/en/sirenscans"
|
||||
)
|
||||
|
||||
type smokeCase struct {
|
||||
name string
|
||||
mode string
|
||||
kotlinRef string
|
||||
newSource func() source.CatalogueSource
|
||||
}
|
||||
|
||||
func TestStandaloneKeyoappSmoke(t *testing.T) {
|
||||
if os.Getenv("GOYOMI_SMOKE") != "1" {
|
||||
t.Skip("set GOYOMI_SMOKE=1 to run live source smoke tests")
|
||||
}
|
||||
|
||||
tests := []smokeCase{
|
||||
{
|
||||
name: "en/kaizenscan",
|
||||
mode: "plain_http",
|
||||
kotlinRef: "extensions-source/src/en/kaizenscan/.../KaizenScan.kt",
|
||||
newSource: func() source.CatalogueSource { return kaizenscan.New() },
|
||||
},
|
||||
{
|
||||
name: "en/kewnscans",
|
||||
mode: "plain_http",
|
||||
kotlinRef: "extensions-source/src/en/kewnscans/.../KewnScans.kt",
|
||||
newSource: func() source.CatalogueSource { return kewnscans.New() },
|
||||
},
|
||||
{
|
||||
name: "en/lunatoons",
|
||||
mode: "plain_http",
|
||||
kotlinRef: "extensions-source/src/en/lunatoons/.../LunaToons.kt",
|
||||
newSource: func() source.CatalogueSource { return lunatoons.New() },
|
||||
},
|
||||
{
|
||||
name: "en/mistscans",
|
||||
mode: "plain_http",
|
||||
kotlinRef: "extensions-source/src/en/mistscans/.../MistScans.kt",
|
||||
newSource: func() source.CatalogueSource { return mistscans.New() },
|
||||
},
|
||||
{
|
||||
name: "en/necroscans",
|
||||
mode: "plain_http",
|
||||
kotlinRef: "extensions-source/src/en/necroscans/.../NecroScans.kt",
|
||||
newSource: func() source.CatalogueSource { return necroscans.New() },
|
||||
},
|
||||
{
|
||||
name: "en/nyanukafe",
|
||||
mode: "plain_http",
|
||||
kotlinRef: "extensions-source/src/en/nyanukafe/.../NyanuKafe.kt",
|
||||
newSource: func() source.CatalogueSource { return nyanukafe.New() },
|
||||
},
|
||||
{
|
||||
name: "en/sirenscans",
|
||||
mode: "plain_http",
|
||||
kotlinRef: "extensions-source/src/en/sirenscans/.../SirenScans.kt",
|
||||
newSource: func() source.CatalogueSource { return sirenscans.New() },
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
s := tc.newSource()
|
||||
mp, err := s.GetPopularManga(1)
|
||||
if err != nil {
|
||||
t.Fatalf("mode=%s kotlin=%s popular failed: %v", tc.mode, tc.kotlinRef, err)
|
||||
}
|
||||
if len(mp.Mangas) == 0 {
|
||||
t.Fatalf("mode=%s kotlin=%s popular returned 0 mangas", tc.mode, tc.kotlinRef)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user