テスト用コンテナの調整 (#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:
postgres:
image: postgres:10-alpine
image: postgres:12.2-alpine
ports:
- 5432:5432
- 54312:5432
env:
POSTGRES_DB: test-misskey
POSTGRES_HOST_AUTH_METHOD: trust
redis:
image: redis:alpine
image: redis:4.0-alpine
ports:
- 6379:6379
- 56312:6379
steps:
- uses: actions/checkout@v2
@ -40,7 +40,7 @@ jobs:
- name: Check yarn.lock
run: git diff --exit-code yarn.lock
- name: Copy Configure
run: cp .circleci/misskey/*.yml .config
run: cp test/test.yml .config
- name: Build
run: yarn build
- 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).
### 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
```

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