From 92e07c3b5d9dbf2febedb1b5b87ec676eb6d1ac8 Mon Sep 17 00:00:00 2001 From: buoyantair Date: Fri, 16 Nov 2018 02:51:26 +0530 Subject: [PATCH] Fix dependency errors between modules --- server/lib/activitypub/process/process-create.ts | 2 +- server/lib/activitypub/process/process-like.ts | 2 +- server/tests/api/activitypub/client.ts | 2 +- server/tests/api/activitypub/fetch.ts | 4 ++-- server/tests/api/activitypub/helpers.ts | 2 +- server/tests/api/activitypub/security.ts | 11 ++++++++++- server/tests/api/server/no-client.ts | 4 ++-- shared/utils/index.ts | 2 -- 8 files changed, 18 insertions(+), 11 deletions(-) diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index 214e14546..9a72cb899 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts @@ -12,7 +12,7 @@ import { getOrCreateVideoAndAccountAndChannel } from '../videos' import { forwardVideoRelatedActivity } from '../send/utils' import { Redis } from '../../redis' import { createOrUpdateCacheFile } from '../cache-file' -import { immutableAssign } from '../../../tests/utils' +import { immutableAssign } from '../../../../shared/utils' import { getVideoDislikeActivityPubUrl } from '../url' import { VideoModel } from '../../../models/video/video' diff --git a/server/lib/activitypub/process/process-like.ts b/server/lib/activitypub/process/process-like.ts index 0dca17551..be86665e9 100644 --- a/server/lib/activitypub/process/process-like.ts +++ b/server/lib/activitypub/process/process-like.ts @@ -5,7 +5,7 @@ import { AccountVideoRateModel } from '../../../models/account/account-video-rat import { ActorModel } from '../../../models/activitypub/actor' import { forwardVideoRelatedActivity } from '../send/utils' import { getOrCreateVideoAndAccountAndChannel } from '../videos' -import { immutableAssign } from '../../../tests/utils' +import { immutableAssign } from '../../../../shared/utils' import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from '../url' async function processLikeActivity (activity: ActivityLike, byActor: ActorModel) { diff --git a/server/tests/api/activitypub/client.ts b/server/tests/api/activitypub/client.ts index 334cd4e5c..d45232c8d 100644 --- a/server/tests/api/activitypub/client.ts +++ b/server/tests/api/activitypub/client.ts @@ -9,7 +9,7 @@ import { runServer, ServerInfo, setAccessTokensToServers -} from '../../shared/utils' +} from '../../../../shared/utils' const expect = chai.expect diff --git a/server/tests/api/activitypub/fetch.ts b/server/tests/api/activitypub/fetch.ts index a42c606c6..e84eb18bb 100644 --- a/server/tests/api/activitypub/fetch.ts +++ b/server/tests/api/activitypub/fetch.ts @@ -13,10 +13,10 @@ import { setAccessTokensToServers, uploadVideo, userLogin -} from '../../utils' +} from '../../../../shared/utils' import * as chai from 'chai' import { setActorField, setVideoField } from '../../utils/miscs/sql' -import { waitJobs } from '../../utils/server/jobs' +import { waitJobs } from '../../../../shared/utils/server/jobs' import { Video } from '../../../../shared/models/videos' const expect = chai.expect diff --git a/server/tests/api/activitypub/helpers.ts b/server/tests/api/activitypub/helpers.ts index 610846247..4c42f3d67 100644 --- a/server/tests/api/activitypub/helpers.ts +++ b/server/tests/api/activitypub/helpers.ts @@ -2,7 +2,7 @@ import 'mocha' import { expect } from 'chai' -import { buildRequestStub } from '../../utils' +import { buildRequestStub } from '../../utils/miscs/stubs' import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../../../helpers/peertube-crypto' import { cloneDeep } from 'lodash' import { buildSignedActivity } from '../../../helpers/activitypub' diff --git a/server/tests/api/activitypub/security.ts b/server/tests/api/activitypub/security.ts index e7899bb14..69b7c0148 100644 --- a/server/tests/api/activitypub/security.ts +++ b/server/tests/api/activitypub/security.ts @@ -2,7 +2,16 @@ import 'mocha' -import { flushAndRunMultipleServers, flushTests, killallServers, makePOSTAPRequest, makeFollowRequest, ServerInfo } from '../../utils' +import { + flushAndRunMultipleServers, + flushTests, + killallServers, + ServerInfo +} from '../../../../shared/utils' +import { + makePOSTAPRequest, + makeFollowRequest, +} from '../../utils/requests/activitypub' import { HTTP_SIGNATURE } from '../../../initializers' import { buildDigest, buildGlobalHeaders } from '../../../lib/job-queue/handlers/utils/activitypub-http-utils' import * as chai from 'chai' diff --git a/server/tests/api/server/no-client.ts b/server/tests/api/server/no-client.ts index 6d6ce8532..3b95ce945 100644 --- a/server/tests/api/server/no-client.ts +++ b/server/tests/api/server/no-client.ts @@ -4,8 +4,8 @@ import { flushTests, killallServers, ServerInfo -} from '../../utils/index' -import { runServer } from '../../utils/server/servers' +} from '../../../../shared/utils' +import { runServer } from '../../../../shared/utils/server/servers' describe('Start and stop server without web client routes', function () { let server: ServerInfo diff --git a/shared/utils/index.ts b/shared/utils/index.ts index 905d93823..897389824 100644 --- a/shared/utils/index.ts +++ b/shared/utils/index.ts @@ -4,10 +4,8 @@ export * from './server/clients' export * from './server/config' export * from './users/login' export * from './miscs/miscs' -export * from './miscs/stubs' export * from './server/follows' export * from './requests/requests' -export * from './requests/activitypub' export * from './server/servers' export * from './videos/services' export * from './users/users' -- 2.41.0