From 17094f32f0fe5fe6e098c3a81f68da8d82710611 Mon Sep 17 00:00:00 2001 From: Leigh MacDonald Date: Fri, 27 Dec 2024 17:13:58 -0700 Subject: [PATCH] Skip test when no parser --- frontend/src/routeTree.gen.ts | 72 +++++------------------------------ internal/test/demos_test.go | 20 ++++++---- 2 files changed, 23 insertions(+), 69 deletions(-) diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts index 198956c5..13655828 100644 --- a/frontend/src/routeTree.gen.ts +++ b/frontend/src/routeTree.gen.ts @@ -1,12 +1,12 @@ +/* prettier-ignore-start */ + /* eslint-disable */ // @ts-nocheck // noinspection JSUnusedGlobalSymbols -// This file was automatically generated by TanStack Router. -// You should NOT make any changes in this file as it will be overwritten. -// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. +// This file is auto-generated by TanStack Router // Import Routes @@ -91,316 +91,264 @@ const AdminRoute = AdminImport.update({ } as any) const GuestIndexRoute = GuestIndexImport.update({ - id: '/', path: '/', getParentRoute: () => GuestRoute, } as any) const GuestWikiRoute = GuestWikiImport.update({ - id: '/wiki', path: '/wiki', getParentRoute: () => GuestRoute, } as any) const GuestStvRoute = GuestStvImport.update({ - id: '/stv', path: '/stv', getParentRoute: () => GuestRoute, } as any) const GuestServersRoute = GuestServersImport.update({ - id: '/servers', path: '/servers', getParentRoute: () => GuestRoute, } as any) const GuestPrivacyPolicyRoute = GuestPrivacyPolicyImport.update({ - id: '/privacy-policy', path: '/privacy-policy', getParentRoute: () => GuestRoute, } as any) const GuestPatreonRoute = GuestPatreonImport.update({ - id: '/patreon', path: '/patreon', getParentRoute: () => GuestRoute, } as any) const GuestContestsRoute = GuestContestsImport.update({ - id: '/contests', path: '/contests', getParentRoute: () => GuestRoute, } as any) const GuestChangelogRoute = GuestChangelogImport.update({ - id: '/changelog', path: '/changelog', getParentRoute: () => GuestRoute, } as any) const AuthStatsRoute = AuthStatsImport.update({ - id: '/stats', path: '/stats', getParentRoute: () => AuthRoute, } as any) const AuthSettingsRoute = AuthSettingsImport.update({ - id: '/settings', path: '/settings', getParentRoute: () => AuthRoute, } as any) const AuthReportRoute = AuthReportImport.update({ - id: '/report', path: '/report', getParentRoute: () => AuthRoute, } as any) const AuthPermissionRoute = AuthPermissionImport.update({ - id: '/permission', path: '/permission', getParentRoute: () => AuthRoute, } as any) const AuthPageNotFoundRoute = AuthPageNotFoundImport.update({ - id: '/page-not-found', path: '/page-not-found', getParentRoute: () => AuthRoute, } as any) const AuthNotificationsRoute = AuthNotificationsImport.update({ - id: '/notifications', path: '/notifications', getParentRoute: () => AuthRoute, } as any) const AuthLogoutRoute = AuthLogoutImport.update({ - id: '/logout', path: '/logout', getParentRoute: () => AuthRoute, } as any) const AuthForumsRoute = AuthForumsImport.update({ - id: '/forums', path: '/forums', getParentRoute: () => AuthRoute, } as any) const AuthChatlogsRoute = AuthChatlogsImport.update({ - id: '/chatlogs', path: '/chatlogs', getParentRoute: () => AuthRoute, } as any) const GuestWikiIndexRoute = GuestWikiIndexImport.update({ - id: '/', path: '/', getParentRoute: () => GuestWikiRoute, } as any) const GuestLoginIndexRoute = GuestLoginIndexImport.update({ - id: '/login/', path: '/login/', getParentRoute: () => GuestRoute, } as any) const AuthStatsIndexRoute = AuthStatsIndexImport.update({ - id: '/', path: '/', getParentRoute: () => AuthStatsRoute, } as any) const AuthReportIndexRoute = AuthReportIndexImport.update({ - id: '/', path: '/', getParentRoute: () => AuthReportRoute, } as any) const AuthForumsIndexRoute = AuthForumsIndexImport.update({ - id: '/', path: '/', getParentRoute: () => AuthForumsRoute, } as any) const ModAdminVotesRoute = ModAdminVotesImport.update({ - id: '/admin/votes', path: '/admin/votes', getParentRoute: () => ModRoute, } as any) const ModAdminReportsRoute = ModAdminReportsImport.update({ - id: '/admin/reports', path: '/admin/reports', getParentRoute: () => ModRoute, } as any) const ModAdminPeopleRoute = ModAdminPeopleImport.update({ - id: '/admin/people', path: '/admin/people', getParentRoute: () => ModRoute, } as any) const ModAdminNewsRoute = ModAdminNewsImport.update({ - id: '/admin/news', path: '/admin/news', getParentRoute: () => ModRoute, } as any) const ModAdminFiltersRoute = ModAdminFiltersImport.update({ - id: '/admin/filters', path: '/admin/filters', getParentRoute: () => ModRoute, } as any) const ModAdminContestsRoute = ModAdminContestsImport.update({ - id: '/admin/contests', path: '/admin/contests', getParentRoute: () => ModRoute, } as any) const ModAdminAppealsRoute = ModAdminAppealsImport.update({ - id: '/admin/appeals', path: '/admin/appeals', getParentRoute: () => ModRoute, } as any) const GuestWikiSlugRoute = GuestWikiSlugImport.update({ - id: '/$slug', path: '/$slug', getParentRoute: () => GuestWikiRoute, } as any) const GuestProfileSteamIdRoute = GuestProfileSteamIdImport.update({ - id: '/profile/$steamId', path: '/profile/$steamId', getParentRoute: () => GuestRoute, } as any) const GuestLoginSuccessRoute = GuestLoginSuccessImport.update({ - id: '/login/success', path: '/login/success', getParentRoute: () => GuestRoute, } as any) const AuthReportReportIdRoute = AuthReportReportIdImport.update({ - id: '/$reportId', path: '/$reportId', getParentRoute: () => AuthReportRoute, } as any) const AuthMatchMatchIdRoute = AuthMatchMatchIdImport.update({ - id: '/match/$matchId', path: '/match/$matchId', getParentRoute: () => AuthRoute, } as any) const AuthForumsForumidRoute = AuthForumsForumidImport.update({ - id: '/$forum_id', path: '/$forum_id', getParentRoute: () => AuthForumsRoute, } as any) const AuthContestsContestidRoute = AuthContestsContestidImport.update({ - id: '/contests/$contest_id', path: '/contests/$contest_id', getParentRoute: () => AuthRoute, } as any) const AuthBanBanidRoute = AuthBanBanidImport.update({ - id: '/ban/$ban_id', path: '/ban/$ban_id', getParentRoute: () => AuthRoute, } as any) const AdminAdminSettingsRoute = AdminAdminSettingsImport.update({ - id: '/admin/settings', path: '/admin/settings', getParentRoute: () => AdminRoute, } as any) const AdminAdminServersRoute = AdminAdminServersImport.update({ - id: '/admin/servers', path: '/admin/servers', getParentRoute: () => AdminRoute, } as any) const AdminAdminGameAdminsRoute = AdminAdminGameAdminsImport.update({ - id: '/admin/game-admins', path: '/admin/game-admins', getParentRoute: () => AdminRoute, } as any) const ModAdminNetworkIndexRoute = ModAdminNetworkIndexImport.update({ - id: '/admin/network/', path: '/admin/network/', getParentRoute: () => ModRoute, } as any) const ModAdminNetworkPlayersbyipRoute = ModAdminNetworkPlayersbyipImport.update( { - id: '/admin/network/playersbyip', path: '/admin/network/playersbyip', getParentRoute: () => ModRoute, } as any, ) const ModAdminNetworkIphistRoute = ModAdminNetworkIphistImport.update({ - id: '/admin/network/iphist', path: '/admin/network/iphist', getParentRoute: () => ModRoute, } as any) const ModAdminNetworkIpInfoRoute = ModAdminNetworkIpInfoImport.update({ - id: '/admin/network/ipInfo', path: '/admin/network/ipInfo', getParentRoute: () => ModRoute, } as any) const ModAdminNetworkCidrblocksRoute = ModAdminNetworkCidrblocksImport.update({ - id: '/admin/network/cidrblocks', path: '/admin/network/cidrblocks', getParentRoute: () => ModRoute, } as any) const ModAdminBanSteamRoute = ModAdminBanSteamImport.update({ - id: '/admin/ban/steam', path: '/admin/ban/steam', getParentRoute: () => ModRoute, } as any) const ModAdminBanGroupRoute = ModAdminBanGroupImport.update({ - id: '/admin/ban/group', path: '/admin/ban/group', getParentRoute: () => ModRoute, } as any) const ModAdminBanCidrRoute = ModAdminBanCidrImport.update({ - id: '/admin/ban/cidr', path: '/admin/ban/cidr', getParentRoute: () => ModRoute, } as any) const ModAdminBanAsnRoute = ModAdminBanAsnImport.update({ - id: '/admin/ban/asn', path: '/admin/ban/asn', getParentRoute: () => ModRoute, } as any) const AuthStatsWeaponWeaponidRoute = AuthStatsWeaponWeaponidImport.update({ - id: '/weapon/$weapon_id', path: '/weapon/$weapon_id', getParentRoute: () => AuthStatsRoute, } as any) const AuthForumsThreadForumthreadidRoute = AuthForumsThreadForumthreadidImport.update({ - id: '/thread/$forum_thread_id', path: '/thread/$forum_thread_id', getParentRoute: () => AuthForumsRoute, } as any) const AuthLogsSteamIdRoute = AuthLogsSteamIdImport.update({ - id: '/logs/$steamId/', path: '/logs/$steamId/', getParentRoute: () => AuthRoute, } as any) @@ -982,7 +930,7 @@ const ModRouteChildren: ModRouteChildren = { const ModRouteWithChildren = ModRoute._addFileChildren(ModRouteChildren) -export interface FileRoutesByFullPath { +interface FileRoutesByFullPath { '': typeof ModRouteWithChildren '/chatlogs': typeof AuthChatlogsRoute '/forums': typeof AuthForumsRouteWithChildren @@ -1038,7 +986,7 @@ export interface FileRoutesByFullPath { '/admin/network': typeof ModAdminNetworkIndexRoute } -export interface FileRoutesByTo { +interface FileRoutesByTo { '': typeof ModRouteWithChildren '/chatlogs': typeof AuthChatlogsRoute '/logout': typeof AuthLogoutRoute @@ -1090,8 +1038,7 @@ export interface FileRoutesByTo { '/admin/network': typeof ModAdminNetworkIndexRoute } -export interface FileRoutesById { - __root__: typeof rootRoute +interface FileRoutesById { '/_admin': typeof AdminRouteWithChildren '/_auth': typeof AuthRouteWithChildren '/_guest': typeof GuestRouteWithChildren @@ -1150,7 +1097,7 @@ export interface FileRoutesById { '/_mod/admin/network/': typeof ModAdminNetworkIndexRoute } -export interface FileRouteTypes { +interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath fullPaths: | '' @@ -1258,7 +1205,6 @@ export interface FileRouteTypes { | '/admin/network/playersbyip' | '/admin/network' id: - | '__root__' | '/_admin' | '/_auth' | '/_guest' @@ -1318,7 +1264,7 @@ export interface FileRouteTypes { fileRoutesById: FileRoutesById } -export interface RootRouteChildren { +interface RootRouteChildren { AdminRoute: typeof AdminRouteWithChildren AuthRoute: typeof AuthRouteWithChildren GuestRoute: typeof GuestRouteWithChildren @@ -1336,6 +1282,8 @@ export const routeTree = rootRoute ._addFileChildren(rootRouteChildren) ._addFileTypes() +/* prettier-ignore-end */ + /* ROUTE_MANIFEST_START { "routes": { diff --git a/internal/test/demos_test.go b/internal/test/demos_test.go index 1a5137a2..bfa616b0 100644 --- a/internal/test/demos_test.go +++ b/internal/test/demos_test.go @@ -34,12 +34,13 @@ func TestDemosCleanup(t *testing.T) { content := make([]byte, 100000) _, err := rand.Read(content) require.NoError(t, err) - - require.NoError(t, fetcher.OnDemoReceived(ctx, demo.UploadedDemo{ - Name: fmt.Sprintf("2023111%d-063943-koth_harvest_final.dem", demoNum), - Server: testServer, - Content: content, - })) + if configUC.Config().Demo.DemoParserURL != "" { + require.NoError(t, fetcher.OnDemoReceived(ctx, demo.UploadedDemo{ + Name: fmt.Sprintf("2023111%d-063943-koth_harvest_final.dem", demoNum), + Server: testServer, + Content: content, + })) + } } expired, errExpired := demoRepository.ExpiredDemos(ctx, 5) @@ -52,10 +53,15 @@ func TestDemosCleanup(t *testing.T) { allDemos, err := demoUC.GetDemos(ctx) require.NoError(t, err) - require.Len(t, allDemos, 5) + if configUC.Config().Demo.DemoParserURL != "" { + require.Len(t, allDemos, 5) + } } func TestDemoUpload(t *testing.T) { + if configUC.Config().Demo.DemoParserURL == "" { + t.Skip("Parser url undefined") + } demoPath := fs.FindFile(path.Join("testdata", "test.dem"), "gbans") detail, err := demoUC.SendAndParseDemo(context.Background(), demoPath) require.NoError(t, err)