Skip to content

Commit

Permalink
move seeds to dev-env
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Dec 22, 2023
1 parent 54b1710 commit 929bd63
Show file tree
Hide file tree
Showing 65 changed files with 82 additions and 757 deletions.
3 changes: 1 addition & 2 deletions packages/bsky/tests/admin/moderation.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ImageRef, SeedClient, TestNetwork } from '@atproto/dev-env'
import { ImageRef, SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
import AtpAgent from '@atproto/api'
import basicSeed from '../seeds/basic'
import {
RepoBlobRef,
RepoRef,
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/admin/repo-search.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { SeedClient, TestNetwork } from '@atproto/dev-env'
import { SeedClient, TestNetwork, usersBulkSeed } from '@atproto/dev-env'
import AtpAgent from '@atproto/api'
import { paginateAll } from '../_util'
import usersBulkSeed from '../seeds/users-bulk'

describe.skip('admin repo search view', () => {
let network: TestNetwork
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/algos/hot-classic.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import AtpAgent, { AtUri } from '@atproto/api'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import basicSeed from '../seeds/basic'
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
import { makeAlgos } from '../../src'

describe('algo hot-classic', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/auth.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import AtpAgent from '@atproto/api'
import { SeedClient, TestNetwork } from '@atproto/dev-env'
import usersSeed from './seeds/users'
import { SeedClient, TestNetwork, usersSeed } from '@atproto/dev-env'
import { createServiceJwt } from '@atproto/xrpc-server'
import { Keypair, Secp256k1Keypair } from '@atproto/crypto'

Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/auto-moderator/fuzzy-matcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
import { FuzzyMatcher, encode } from '../../src/auto-moderator/fuzzy-matcher'
import basicSeed from '../seeds/basic'
import { AtpAgent } from '@atproto/api'
import { ImageInvalidator } from '../../src/image/invalidator'

Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/auto-moderator/labeler.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { TestNetwork } from '@atproto/dev-env'
import { TestNetwork, usersSeed } from '@atproto/dev-env'
import { AtUri, BlobRef } from '@atproto/api'
import { Readable } from 'stream'
import { AutoModerator } from '../../src/auto-moderator'
import IndexerContext from '../../src/indexer/context'
import { cidForRecord } from '@atproto/repo'
import { TID } from '@atproto/common'
import usersSeed from '../seeds/users'
import { CID } from 'multiformats/cid'
import { ImgLabeler } from '../../src/auto-moderator/hive'
import { TestOzone } from '@atproto/dev-env/src/ozone'
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/auto-moderator/takedowns.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import fs from 'fs/promises'
import { TestNetwork, SeedClient, ImageRef } from '@atproto/dev-env'
import { TestNetwork, SeedClient, ImageRef, usersSeed } from '@atproto/dev-env'
import { AtpAgent } from '@atproto/api'
import { AutoModerator } from '../../src/auto-moderator'
import { sha256RawToCid } from '@atproto/common'
import usersSeed from '../seeds/users'
import { CID } from 'multiformats/cid'
import { AtUri } from '@atproto/syntax'
import { ImageFlagger } from '../../src/auto-moderator/abyss'
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/blob-resolver.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios, { AxiosInstance } from 'axios'
import { CID } from 'multiformats/cid'
import { verifyCidForBytes } from '@atproto/common'
import { TestNetwork } from '@atproto/dev-env'
import basicSeed from './seeds/basic'
import { TestNetwork, basicSeed } from '@atproto/dev-env'
import { randomBytes } from '@atproto/crypto'

describe('blob resolver', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/daemon.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import assert from 'assert'
import { AtUri } from '@atproto/api'
import { TestNetwork } from '@atproto/dev-env'
import { TestNetwork, usersSeed } from '@atproto/dev-env'
import { BskyDaemon, DaemonConfig, PrimaryDatabase } from '../src'
import usersSeed from './seeds/users'
import { countAll, excluded } from '../src/db/util'
import { NotificationsDaemon } from '../src/daemon/notifications'
import {
Expand Down
5 changes: 2 additions & 3 deletions packages/bsky/tests/did-cache.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import userSeed from './seeds/users'
import { TestNetwork, SeedClient, usersSeed } from '@atproto/dev-env'
import { IdResolver } from '@atproto/identity'
import DidRedisCache from '../src/did-cache'
import { wait } from '@atproto/common'
Expand All @@ -25,7 +24,7 @@ describe('did cache', () => {
redis = network.bsky.indexer.ctx.redis
didCache = network.bsky.indexer.ctx.didCache
sc = network.getSeedClient()
await userSeed(sc)
await usersSeed(sc)
await network.processAll()
alice = sc.dids.alice
bob = sc.dids.bob
Expand Down
2 changes: 1 addition & 1 deletion packages/bsky/tests/feed-generation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
TestFeedGen,
SeedClient,
RecordRef,
basicSeed,
} from '@atproto/dev-env'
import { Handler as SkeletonHandler } from '../src/lexicon/types/app/bsky/feed/getFeedSkeleton'
import { GeneratorView } from '@atproto/api/src/client/types/app/bsky/feed/defs'
Expand All @@ -14,7 +15,6 @@ import {
FeedViewPost,
SkeletonFeedPost,
} from '../src/lexicon/types/app/bsky/feed/defs'
import basicSeed from './seeds/basic'
import { forSnapshot, paginateAll } from './_util'
import { AuthRequiredError } from '@atproto/xrpc-server'
import assert from 'assert'
Expand Down
5 changes: 2 additions & 3 deletions packages/bsky/tests/handle-invalidation.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { DAY } from '@atproto/common'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import { TestNetwork, SeedClient, usersSeed } from '@atproto/dev-env'
import { AtpAgent } from '@atproto/api'
import userSeed from './seeds/users'

describe('handle invalidation', () => {
let network: TestNetwork
Expand All @@ -20,7 +19,7 @@ describe('handle invalidation', () => {
agent = network.bsky.getClient()
pdsAgent = network.pds.getClient()
sc = network.getSeedClient()
await userSeed(sc)
await usersSeed(sc)
await network.processAll()

alice = sc.dids.alice
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/image/server.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import axios, { AxiosInstance } from 'axios'
import { CID } from 'multiformats/cid'
import { cidForCbor } from '@atproto/common'
import { TestNetwork } from '@atproto/dev-env'
import { TestNetwork, basicSeed } from '@atproto/dev-env'
import { getInfo } from '../../src/image/sharp'
import basicSeed from '../seeds/basic'
import { ImageUriBuilder } from '../../src/image/uri'

describe('image processing server', () => {
Expand Down
4 changes: 1 addition & 3 deletions packages/bsky/tests/indexing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ import AtpAgent, {
AppBskyFeedRepost,
AppBskyGraphFollow,
} from '@atproto/api'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import { TestNetwork, SeedClient, usersSeed, basicSeed } from '@atproto/dev-env'
import { forSnapshot } from './_util'
import usersSeed from './seeds/users'
import basicSeed from './seeds/basic'
import { ids } from '../src/lexicon/lexicons'
import { Database } from '../src/db'

Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/notification-server.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import AtpAgent, { AtUri } from '@atproto/api'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import basicSeed from './seeds/basic'
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
import { NotificationServer } from '../src/notifications'
import { Database } from '../src'

Expand Down
2 changes: 1 addition & 1 deletion packages/bsky/tests/pipeline/backpressure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
getIngester,
processAll,
SeedClient,
basicSeed,
} from '@atproto/dev-env'
import basicSeed from '../seeds/basic'
import { BskyIngester } from '../../src'

const TEST_NAME = 'pipeline_backpressure'
Expand Down
2 changes: 1 addition & 1 deletion packages/bsky/tests/pipeline/reingest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {
SeedClient,
getIngester,
ingestAll,
basicSeed,
} from '@atproto/dev-env'
import basicSeed from '../seeds/basic'
import { BskyIngester } from '../../src'

const TEST_NAME = 'pipeline_reingest'
Expand Down
2 changes: 1 addition & 1 deletion packages/bsky/tests/pipeline/repartition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
getIngester,
ingestAll,
processAll,
usersSeed,
} from '@atproto/dev-env'
import usersSeed from '../seeds/users'
import { BskyIngester } from '../../src'
import { countAll } from '../../src/db/util'

Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/reprocessing.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import axios from 'axios'
import { AtUri } from '@atproto/syntax'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import basicSeed from './seeds/basic'
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
import { Database } from '../src/db'

describe('reprocessing', () => {
Expand Down
57 changes: 0 additions & 57 deletions packages/bsky/tests/seeds/follows.ts

This file was deleted.

43 changes: 0 additions & 43 deletions packages/bsky/tests/seeds/likes.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/bsky/tests/server.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { AddressInfo } from 'net'
import express from 'express'
import axios, { AxiosError } from 'axios'
import { TestNetwork } from '@atproto/dev-env'
import { TestNetwork, basicSeed } from '@atproto/dev-env'
import { handler as errorHandler } from '../src/error'
import { Database } from '../src'
import basicSeed from './seeds/basic'

describe('server', () => {
let network: TestNetwork
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/subscription/repo.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AtpAgent from '@atproto/api'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'
import { CommitData } from '@atproto/repo'
import { PreparedWrite } from '@atproto/pds/src/repo'
import * as sequencer from '@atproto/pds/src/sequencer'
Expand All @@ -8,7 +8,6 @@ import { DatabaseSchemaType } from '../../src/db/database-schema'
import { ids } from '../../src/lexicon/lexicons'
import { forSnapshot } from '../_util'
import { AppContext, Database } from '../../src'
import basicSeed from '../seeds/basic'

describe('sync', () => {
let network: TestNetwork
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/views/actor-likes.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import AtpAgent, { AtUri } from '@atproto/api'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import basicSeed from '../seeds/basic'
import { TestNetwork, SeedClient, basicSeed } from '@atproto/dev-env'

describe('bsky actor likes feed views', () => {
let network: TestNetwork
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/views/actor-search.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import AtpAgent from '@atproto/api'
import { wait } from '@atproto/common'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import { TestNetwork, SeedClient, usersBulkSeed } from '@atproto/dev-env'
import { forSnapshot, paginateAll, stripViewer } from '../_util'
import usersBulkSeed from '../seeds/users-bulk'

// @NOTE skipped to help with CI failures
// The search code is not used in production & we should switch it out for tests on the search proxy interface
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/views/admin/repo-search.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import AtpAgent, { ComAtprotoAdminSearchRepos } from '@atproto/api'
import { wait } from '@atproto/common'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import usersBulkSeed from '../../seeds/users-bulk'
import { TestNetwork, SeedClient, usersBulkSeed } from '@atproto/dev-env'

describe('pds admin repo search views', () => {
let network: TestNetwork
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/views/author-feed.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import AtpAgent from '@atproto/api'
import { TestNetwork, SeedClient } from '@atproto/dev-env'
import { TestNetwork, SeedClient, authorFeedSeed } from '@atproto/dev-env'
import { forSnapshot, paginateAll, stripViewerFromPost } from '../_util'
import authorFeedSeed from '../seeds/author-feed'
import { isRecord } from '../../src/lexicon/types/app/bsky/feed/post'
import { isView as isEmbedRecordWithMedia } from '../../src/lexicon/types/app/bsky/embed/recordWithMedia'
import { isView as isImageEmbed } from '../../src/lexicon/types/app/bsky/embed/images'
Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/views/block-lists.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import AtpAgent from '@atproto/api'
import { TestNetwork, SeedClient, RecordRef } from '@atproto/dev-env'
import { TestNetwork, SeedClient, RecordRef, basicSeed } from '@atproto/dev-env'
import { forSnapshot } from '../_util'
import basicSeed from '../seeds/basic'
import { BlockedActorError } from '@atproto/api/src/client/types/app/bsky/feed/getAuthorFeed'
import { BlockedByActorError } from '@atproto/api/src/client/types/app/bsky/feed/getAuthorFeed'

Expand Down
3 changes: 1 addition & 2 deletions packages/bsky/tests/views/blocks.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'assert'
import { TestNetwork, RecordRef, SeedClient } from '@atproto/dev-env'
import { TestNetwork, RecordRef, SeedClient, basicSeed } from '@atproto/dev-env'
import AtpAgent, { AtUri } from '@atproto/api'
import { BlockedActorError } from '@atproto/api/src/client/types/app/bsky/feed/getAuthorFeed'
import { BlockedByActorError } from '@atproto/api/src/client/types/app/bsky/feed/getAuthorFeed'
Expand All @@ -9,7 +9,6 @@ import {
isViewBlocked as isEmbedViewBlocked,
} from '@atproto/api/src/client/types/app/bsky/embed/record'
import { forSnapshot } from '../_util'
import basicSeed from '../seeds/basic'

describe('pds views with blocking', () => {
let network: TestNetwork
Expand Down
Loading

0 comments on commit 929bd63

Please sign in to comment.