1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-27 22:38:34 +09:00
cherrypick/packages/backend/test-federation/compose.yml
2024-11-05 20:06:30 +09:00

134 lines
3.7 KiB
YAML

include:
- ./compose.a.yml
- ./compose.b.yml
services:
setup:
extends:
file: ./compose.tpl.yml
service: cherrypick
command: >
bash -c "
corepack enable && corepack prepare
pnpm -F backend i
pnpm -F cherrypick-js i
pnpm -F misskey-reversi i
"
tester:
image: node:20
depends_on:
a.test:
condition: service_healthy
b.test:
condition: service_healthy
environment:
- NODE_ENV=development
- NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/rootCA.crt
volumes:
- type: bind
source: ../package.json
target: /cherrypick/packages/backend/package.json
read_only: true
- type: bind
source: ../test/resources
target: /cherrypick/packages/backend/test/resources
read_only: true
- type: bind
source: ./test
target: /cherrypick/packages/backend/test-federation/test
read_only: true
- type: bind
source: ../jest.config.cjs
target: /cherrypick/packages/backend/jest.config.cjs
read_only: true
- type: bind
source: ../jest.config.fed.cjs
target: /cherrypick/packages/backend/jest.config.fed.cjs
read_only: true
- type: bind
source: ../../cherrypick-js/built
target: /cherrypick/packages/cherrypick-js/built
read_only: true
- type: bind
source: ../../cherrypick-js/package.json
target: /cherrypick/packages/cherrypick-js/package.json
read_only: true
- type: bind
source: ../../../package.json
target: /cherrypick/package.json
read_only: true
- type: bind
source: ../../../pnpm-lock.yaml
target: /cherrypick/pnpm-lock.yaml
read_only: true
- type: bind
source: ../../../pnpm-workspace.yaml
target: /cherrypick/pnpm-workspace.yaml
read_only: true
- type: bind
source: ./certificates/rootCA.crt
target: /usr/local/share/ca-certificates/rootCA.crt
read_only: true
working_dir: /cherrypick
entrypoint: >
bash -c '
corepack enable && corepack prepare
pnpm -F cherrypick-js i --frozen-lockfile
pnpm -F backend i --frozen-lockfile
exec "$0" "$@"
'
command: pnpm -F backend test:fed
daemon:
image: node:20
depends_on:
redis.test:
condition: service_healthy
volumes:
- type: bind
source: ../package.json
target: /cherrypick/packages/backend/package.json
read_only: true
- type: bind
source: ./daemon.ts
target: /cherrypick/packages/backend/test-federation/daemon.ts
read_only: true
- type: bind
source: ./tsconfig.json
target: /cherrypick/packages/backend/test-federation/tsconfig.json
read_only: true
- type: bind
source: ../../../package.json
target: /cherrypick/package.json
read_only: true
- type: bind
source: ../../../pnpm-lock.yaml
target: /cherrypick/pnpm-lock.yaml
read_only: true
- type: bind
source: ../../../pnpm-workspace.yaml
target: /cherrypick/pnpm-workspace.yaml
read_only: true
working_dir: /cherrypick
command: >
bash -c "
corepack enable && corepack prepare
pnpm -F backend i --frozen-lockfile
pnpm exec tsc -p ./packages/backend/test-federation
node ./packages/backend/test-federation/built/daemon.js
"
redis.test:
image: redis:7-alpine
volumes:
- type: bind
source: ./volumes/redis
target: /data
bind:
create_host_path: true
healthcheck:
test: redis-cli ping
interval: 5s
retries: 20