Кое-какие тесты

This commit is contained in:
Lulzette 2021-10-19 00:53:17 +00:00
parent 32a2678170
commit 3aa77129ec
2 changed files with 16 additions and 0 deletions

View File

@ -10,3 +10,9 @@ services:
- db - db
db: db:
image: mongo image: mongo
tests:
build: .
command: bash ./test.sh
depends_on:
- db
- server

10
test.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
curl_cmd='curl -s -w "%{http_code}" -o /dev/null'
url='server:8080'
$curl_cmd -X POST $url/admin/post/test -F 'body=testpage' && echo ": Create success" || echo ': create fail'
$curl_cmd $url/post/test && echo ": get Success" || echo ': get fail'
$curl_cmd -X POST $url/admin/post/test -F 'body=testpage2' && echo ": Update success" || echo ': update fail'
$curl_cmd -X DELETE $url/admin/post/test && echo ": delete success" || echo ': delete fail'