テスト用コンテナの調整 (#7838)
* Tune test container * docs * fix cp config * doc * a
This commit is contained in:
		
							
								
								
									
										10
									
								
								.github/workflows/nodejs.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.github/workflows/nodejs.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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 | ||||
|   | ||||
| @@ -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
									
								
							
							
						
						
									
										15
									
								
								test/docker-compose.yml
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										12
									
								
								test/test.yml
									
									
									
									
									
										Normal 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 | ||||
		Reference in New Issue
	
	Block a user
	 MeiMei
					MeiMei