From 03b04acb1628e710dec1d768d74aedfc0a4f1ccd Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sat, 16 Oct 2021 17:12:20 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E7=94=A8=E3=82=B3?= =?UTF-8?q?=E3=83=B3=E3=83=86=E3=83=8A=E3=81=AE=E8=AA=BF=E6=95=B4=20(#7838?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Tune test container * docs * fix cp config * doc * a --- .github/workflows/nodejs.yml | 10 +++++----- CONTRIBUTING.md | 11 +++++++++++ test/docker-compose.yml | 15 +++++++++++++++ test/test.yml | 12 ++++++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 test/docker-compose.yml create mode 100644 test/test.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 9a32dac94e..a91572ad78 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06154f1f44..f5e0eece1f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 ``` diff --git a/test/docker-compose.yml b/test/docker-compose.yml new file mode 100644 index 0000000000..c045e7c6c4 --- /dev/null +++ b/test/docker-compose.yml @@ -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 diff --git a/test/test.yml b/test/test.yml new file mode 100644 index 0000000000..2d3094653e --- /dev/null +++ b/test/test.yml @@ -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