1
0
forked from mirror/misskey

テスト用コンテナの調整 (#7838)

* Tune test container

* docs

* fix cp config

* doc

* a
This commit is contained in:
MeiMei 2021-10-16 17:12:20 +09:00 committed by GitHub
parent 345a9d3525
commit 03b04acb16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 5 deletions

View File

@ -16,16 +16,16 @@ jobs:
services: services:
postgres: postgres:
image: postgres:10-alpine image: postgres:12.2-alpine
ports: ports:
- 5432:5432 - 54312:5432
env: env:
POSTGRES_DB: test-misskey POSTGRES_DB: test-misskey
POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_HOST_AUTH_METHOD: trust
redis: redis:
image: redis:alpine image: redis:4.0-alpine
ports: ports:
- 6379:6379 - 56312:6379
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -40,7 +40,7 @@ jobs:
- name: Check yarn.lock - name: Check yarn.lock
run: git diff --exit-code yarn.lock run: git diff --exit-code yarn.lock
- name: Copy Configure - name: Copy Configure
run: cp .circleci/misskey/*.yml .config run: cp test/test.yml .config
- name: Build - name: Build
run: yarn build run: yarn build
- name: Test - name: Test

View File

@ -57,6 +57,17 @@ If your language is not listed in Crowdin, please open an issue.
- Test codes are located in [`/test`](/test). - Test codes are located in [`/test`](/test).
### Run test ### Run test
Create a config file.
```
cp test/test.yml .config/
```
Prepare DB/Redis for testing.
```
docker-compose -f test/docker-compose.yml up
```
Alternatively, prepare an empty (data can be erased) DB and edit `.config/test.yml`.
Run all test.
``` ```
npm run test npm run test
``` ```

15
test/docker-compose.yml Normal file
View File

@ -0,0 +1,15 @@
version: "3"
services:
redistest:
image: redis:4.0-alpine
ports:
- "127.0.0.1:56312:6379"
dbtest:
image: postgres:12.2-alpine
ports:
- "127.0.0.1:54312:5432"
environment:
POSTGRES_DB: "test-misskey"
POSTGRES_HOST_AUTH_METHOD: trust

12
test/test.yml Normal file
View File

@ -0,0 +1,12 @@
url: 'http://misskey.local'
port: 61812
db:
host: localhost
port: 54312
db: test-misskey
user: postgres
pass: ''
redis:
host: localhost
port: 56312
id: aid