Added more route tests

This commit is contained in:
Eduard Urbach 2018-04-25 20:23:35 +02:00
parent ba08b85267
commit a6fea3965c
7 changed files with 45 additions and 2 deletions

View File

@ -74,7 +74,7 @@ func logRequest(ctx *aero.Context, responseTime time.Duration) {
// Notify us about long requests.
// However ignore requests under /auth/ because those depend on 3rd party servers.
if responseTime >= 300*time.Millisecond && !strings.HasPrefix(ctx.URI(), "/auth/") {
if responseTime >= 300*time.Millisecond && !strings.HasPrefix(ctx.URI(), "/auth/") && !strings.HasPrefix(ctx.URI(), "/sitemap/") {
err.Error("Long response time", ip, hostName, responseTimeString, ctx.StatusCode, ctx.URI())
}
}

View File

@ -3,7 +3,7 @@ package animeroutes
import (
"github.com/aerogo/layout"
"github.com/animenotifier/notify.moe/pages/anime"
"github.com/animenotifier/notify.moe/pages/editanime"
"github.com/animenotifier/notify.moe/pages/anime/editanime"
"github.com/animenotifier/notify.moe/pages/episode"
"github.com/animenotifier/notify.moe/pages/genre"
"github.com/animenotifier/notify.moe/pages/genres"

View File

@ -123,6 +123,10 @@ var routeTests = map[string][]string{
"/anime/74y2cFiiR/tracks",
},
"/anime/:id/relations": []string{
"/anime/74y2cFiiR/relations",
},
"/thread/:id": []string{
"/thread/HJgS7c2K",
},
@ -147,6 +151,10 @@ var routeTests = map[string][]string{
"/quote/gUZugd6zR/edit",
},
"/quote/:id/history": []string{
"/quote/gUZugd6zR/history",
},
"/quotes/from/:index": []string{
"/quotes/from/2",
},
@ -159,6 +167,10 @@ var routeTests = map[string][]string{
"/soundtrack/h0ac8sKkg",
},
"/soundtrack/:id/lyrics": []string{
"/soundtrack/vS64GbpzR/lyrics",
},
"/soundtrack/:id/edit": []string{
"/soundtrack/h0ac8sKkg/edit",
},
@ -211,6 +223,28 @@ var routeTests = map[string][]string{
"/explore/anime/2011/any/finished/tv",
},
// AMV
"/amv/:id": []string{
"/amv/07scvSWmg",
},
"/amv/:id/edit": []string{
"/amv/07scvSWmg/edit",
},
"/amv/:id/history": []string{
"/amv/07scvSWmg/history",
},
// AMVs
"/amvs/from/:index": []string{
"/amvs/from/3",
},
"/amvs/best/from/:index": []string{
"/amvs/best/from/3",
},
// Redirects
"/mal/anime/:id": []string{
"/mal/anime/33352",
@ -289,6 +323,10 @@ var routeTests = map[string][]string{
"/anime/74y2cFiiR/episode/5",
},
"/api/amv/:id": []string{
"/api/amv/07scvSWmg",
},
"/api/character/:id": []string{
"/api/character/dfrNQrmmg-",
},
@ -380,6 +418,11 @@ var routeTests = map[string][]string{
"/paypal/success": nil,
"/paypal/cancel": nil,
"/anime/:id/edit": nil,
"/anime/:id/edit/images": nil,
"/anime/:id/edit/characters": nil,
"/anime/:id/edit/relations": nil,
"/anime/:id/edit/episodes": nil,
"/anime/:id/edit/history": nil,
"/new/thread": nil,
"/admin/purchases": nil,
"/admin/registrations": nil,