Compare commits
12 Commits
master
...
develop-ap
| Author | SHA1 | Date |
|---|---|---|
|
|
ab7079c30a | 3 months ago |
|
|
ad13cf19f9 | 4 months ago |
|
|
fecfb02071 | 4 months ago |
|
|
24562704c5 | 4 months ago |
|
|
b0e64ccc98 | 4 months ago |
|
|
4e4dcdd7c0 | 4 months ago |
|
|
d0e3299f67 | 4 months ago |
|
|
a5489495f4 | 4 months ago |
|
|
911a9a0256 | 4 months ago |
|
|
ea48899627 | 4 months ago |
|
|
846008de8e | 4 months ago |
|
|
1d67dab036 | 4 months ago |
14 changed files with 45 additions and 190 deletions
@ -1,20 +1,13 @@ |
|||||||
#!/usr/bin/env bash |
#!/usr/bin/env bash |
||||||
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) |
|
||||||
cd "$SCRIPT_DIR" |
|
||||||
|
|
||||||
if [ -z "$TEST_SERVER_ADDRESS" ]; then |
if [ -z "$TEST_SERVER_ADDRESS" ]; then |
||||||
source export.sh |
source export.sh |
||||||
fi |
fi |
||||||
|
|
||||||
tavern-ci --alluredir=reports test_plans/version_test.tavern.yaml |
tavern-ci --alluredir=reports test_plans/info_test.tavern.yaml |
||||||
# tavern-ci --alluredir=reports test_plans/auth_test.tavern.yaml |
|
||||||
tavern-ci --alluredir=reports test_plans/decode_test.tavern.yaml |
|
||||||
tavern-ci --alluredir=reports test_plans/dictionary_test.tavern.yaml |
|
||||||
tavern-ci --alluredir=reports test_plans/encode_test.tavern.yaml |
|
||||||
|
|
||||||
# if command -v allure > /dev/null; then |
if command -v allure > /dev/null; then |
||||||
# allure generate --clean --single-file --output /tmp/vm-allure-report --name index.html reports |
allure generate --clean --single-file --output /tmp/vm-allure-report --name index.html reports |
||||||
# fi |
fi |
||||||
|
|
||||||
# allure package: https://github.com/allure-framework/allure2/releases/download/2.34.0/allure_2.34.0-1_all.deb |
# allure package: https://github.com/allure-framework/allure2/releases/download/2.34.0/allure_2.34.0-1_all.deb |
||||||
|
|||||||
@ -1,29 +0,0 @@ |
|||||||
test_name: "Test major decode endpoint" |
|
||||||
|
|
||||||
includes: |
|
||||||
- !include includes.yaml |
|
||||||
|
|
||||||
stages: |
|
||||||
|
|
||||||
- name: "Successful decode with valid encoded input" |
|
||||||
request: |
|
||||||
url: "http://{server_address}/{api_base}/major/decode/pl/test" |
|
||||||
method: GET |
|
||||||
headers: |
|
||||||
X-API-Key: "{api_key}" |
|
||||||
response: |
|
||||||
strict: True |
|
||||||
status_code: 200 |
|
||||||
json: |
|
||||||
input: "test" |
|
||||||
result: "101" |
|
||||||
|
|
||||||
- name: "Missing authentication returns 401 error" |
|
||||||
request: |
|
||||||
url: "http://{server_address}/{api_base}/major/decode/pl/hello" |
|
||||||
method: GET |
|
||||||
response: |
|
||||||
strict: False |
|
||||||
status_code: 401 |
|
||||||
json: |
|
||||||
error: !anystr |
|
||||||
@ -1,30 +0,0 @@ |
|||||||
test_name: "Test dictionary API endpoint" |
|
||||||
|
|
||||||
includes: |
|
||||||
- !include includes.yaml |
|
||||||
|
|
||||||
stages: |
|
||||||
|
|
||||||
- name: "Successful list dictionaries with valid authentication" |
|
||||||
request: |
|
||||||
url: "http://{server_address}/{api_base}/dicts" |
|
||||||
method: GET |
|
||||||
headers: |
|
||||||
X-API-Key: "{api_key}" |
|
||||||
response: |
|
||||||
strict: False |
|
||||||
status_code: 200 |
|
||||||
json: |
|
||||||
dictionaries: |
|
||||||
- name: !anystr |
|
||||||
entry_count: !anyint |
|
||||||
|
|
||||||
- name: "Missing authentication returns 401 error" |
|
||||||
request: |
|
||||||
url: "http://{server_address}/{api_base}/dicts" |
|
||||||
method: GET |
|
||||||
response: |
|
||||||
strict: True |
|
||||||
status_code: 401 |
|
||||||
json: |
|
||||||
error: !anystr |
|
||||||
@ -1,44 +0,0 @@ |
|||||||
test_name: "Test major encode endpoint" |
|
||||||
|
|
||||||
includes: |
|
||||||
- !include includes.yaml |
|
||||||
|
|
||||||
stages: |
|
||||||
|
|
||||||
- name: "Successful encode with default dictionary" |
|
||||||
request: |
|
||||||
url: "http://{server_address}/{api_base}/major/encode/pl/hello" |
|
||||||
method: GET |
|
||||||
headers: |
|
||||||
X-API-Key: "{api_key}" |
|
||||||
response: |
|
||||||
strict: False |
|
||||||
status_code: 200 |
|
||||||
json: |
|
||||||
input: "hello" |
|
||||||
dict: "demo_pl" |
|
||||||
result: !anylist |
|
||||||
|
|
||||||
- name: "Successful encode with custom dictionary" |
|
||||||
request: |
|
||||||
url: "http://{server_address}/{api_base}/major/encode/pl/test?dict=demo_pl" |
|
||||||
method: GET |
|
||||||
headers: |
|
||||||
X-API-Key: "{api_key}" |
|
||||||
response: |
|
||||||
strict: False |
|
||||||
status_code: 200 |
|
||||||
json: |
|
||||||
input: "test" |
|
||||||
dict: "demo_pl" |
|
||||||
result: !anylist |
|
||||||
|
|
||||||
- name: "Missing authentication returns 401 error" |
|
||||||
request: |
|
||||||
url: "http://{server_address}/{api_base}/major/encode/pl/hello" |
|
||||||
method: GET |
|
||||||
response: |
|
||||||
strict: False |
|
||||||
status_code: 401 |
|
||||||
json: |
|
||||||
error: !anystr |
|
||||||
@ -0,0 +1,19 @@ |
|||||||
|
test_name: "Test server API info endpoint" |
||||||
|
|
||||||
|
includes: |
||||||
|
- !include includes.yaml |
||||||
|
|
||||||
|
stages: |
||||||
|
- name: "Check version" |
||||||
|
request: |
||||||
|
url: "http://{server_address}/{api_base}/info/version" |
||||||
|
method: GET |
||||||
|
headers: |
||||||
|
X-API-Key: "{api_key}" |
||||||
|
response: |
||||||
|
strict: False |
||||||
|
status_code: 200 |
||||||
|
json: |
||||||
|
name: !anystr |
||||||
|
version: !anystr |
||||||
|
|
||||||
@ -1,20 +0,0 @@ |
|||||||
test_name: "Test version endpoint" |
|
||||||
|
|
||||||
includes: |
|
||||||
- !include includes.yaml |
|
||||||
|
|
||||||
stages: |
|
||||||
- name: "Successful version test - valid authentication returns version info" |
|
||||||
request: |
|
||||||
url: "http://{server_address}/api/v1/info/version" |
|
||||||
method: GET |
|
||||||
headers: |
|
||||||
X-API-Key: "{api_key}" |
|
||||||
response: |
|
||||||
strict: True |
|
||||||
status_code: 200 |
|
||||||
json: |
|
||||||
name: "phomnemic-server" |
|
||||||
version: !anystr |
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in new issue