Skip to content
This repository was archived by the owner on Jul 21, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
68a7f1a
Added APIs
losete Feb 11, 2020
e5e35e8
Added wso2 install
losete Feb 11, 2020
bef8450
Added -y option
losete Feb 11, 2020
549c466
Changed wso2 installation process
losete Feb 11, 2020
cf21aee
Changed wso2 installation process
losete Feb 11, 2020
c538345
Added & for not getting stucked
losete Feb 11, 2020
21da810
Added installation of apictl
losete Feb 11, 2020
c80d2de
Added import of banos api
losete Feb 11, 2020
6ce85d3
Added &
losete Feb 11, 2020
65509a4
Changed directories
losete Feb 11, 2020
74731ca
Added all APIs + app
losete Feb 11, 2020
eab01ca
Added login
losete Feb 11, 2020
bcb03ae
Changing order
losete Feb 11, 2020
0f4acf5
Test
losete Feb 11, 2020
0a724d0
Test
losete Feb 11, 2020
17b1c9f
Test 2
losete Feb 11, 2020
09ea846
Test 3
losete Feb 11, 2020
61f6ce5
Test
losete Feb 11, 2020
ea7a7c9
Test
losete Feb 11, 2020
e10961a
Changed gasolineras API due to some errors
losete Feb 12, 2020
7e59883
Test
losete Feb 12, 2020
22bcce1
Test
losete Feb 12, 2020
7c97f30
Test
losete Feb 12, 2020
594ee43
Changed app
losete Feb 12, 2020
3f6001c
Test
losete Feb 12, 2020
a83ee5f
Test
losete Feb 12, 2020
d9d5c41
Deleted &s
losete Feb 12, 2020
45edeab
Deleted apictl
losete Feb 12, 2020
383a6a1
Added curl for testing
losete Feb 12, 2020
197d816
Added get-keys
losete Feb 12, 2020
17cd951
Changed admin.zip + added curl
losete Feb 12, 2020
22dd89b
Added token
losete Feb 13, 2020
cf0a16a
Deleted test file
losete Feb 13, 2020
945cd6f
Deleted test commands
losete Feb 13, 2020
54cd2cf
Test
losete Feb 13, 2020
2133a3d
Test
losete Feb 13, 2020
cbacfeb
Test
losete Feb 13, 2020
042a961
Changed banos tests
losete Feb 13, 2020
d29c6bd
--insecure flag
losete Feb 13, 2020
8d4be40
Added cd ..
losete Feb 13, 2020
b60fe6d
Test
losete Feb 13, 2020
0a17d6b
Test
losete Feb 13, 2020
d0f9e50
Test
losete Feb 13, 2020
c0e54c7
Solved banos tests problems
losete Feb 13, 2020
96c7374
Three tests have been edited
losete Feb 13, 2020
87c40cb
Three tests have been edited
losete Feb 13, 2020
638a0b6
Changed caching tests
losete Feb 13, 2020
7eff796
Changed apikey tests
losete Feb 13, 2020
87a1ee1
Added siege tests
losete Feb 13, 2020
56cf499
Modified siege tests
losete Feb 13, 2020
a1c65d3
Tests escaping doubles
losete Feb 13, 2020
71bffe3
Tests escaping doubles
losete Feb 13, 2020
f1fce51
Substitute token in command
losete Feb 13, 2020
c62938c
Added token line
losete Feb 13, 2020
a21bb63
Added inverse accent
losete Feb 13, 2020
4a6e678
Added inverse accent
losete Feb 13, 2020
8603e57
Test with 1 user
losete Feb 13, 2020
8db28e5
Test with 1 user
losete Feb 13, 2020
f70a797
Testing travis sintax
losete Feb 13, 2020
2f6a555
Testing siege
losete Feb 13, 2020
248da1f
Deleted WSO2 benchmarks
losete Feb 13, 2020
1891885
Added newman basic tests
losete Mar 7, 2020
9943cc5
Modified newman basic tests
losete Mar 7, 2020
babcb05
Modified apikey tests
losete Mar 7, 2020
1459222
Modified caching tests
losete Mar 7, 2020
8316a9d
Added siege test
losete Mar 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 52 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ install:
- sudo apt-key add bintray.key
- sudo apt-get update
- sudo apt-get install -y kong
# Install WSO2 3.0
- sudo wget https://product-dist.wso2.com/downloads/api-manager/3.0.0/downloader/wso2am-linux-installer-x64-3.0.0.deb
- sudo apt install ./wso2am-linux-installer-x64-3.0.0.deb
- sudo wso2am-3.0.0 &
# Install kongverge
- wget -q https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
- sudo dpkg -i packages-microsoft-prod.deb
Expand All @@ -30,6 +34,9 @@ install:
- sudo apt-get update
- sudo apt-get install -y dotnet-sdk-2.2
- sudo dotnet tool install kongverge --global
# Download apictl binary
- sudo wget https://product-dist.wso2.com/downloads/api-manager/cli/3.0.1/apictl-3.0.1-linux-x64.tar.gz
- tar -xvzf apictl-3.0.1-linux-x64.tar.gz
# Install siege
- wget http://download.joedog.org/siege/siege-3.1.4.tar.gz
- tar -zxvf siege-3.1.4.tar.gz
Expand Down Expand Up @@ -63,31 +70,50 @@ script:
- curl -o kong.sh https://gist.githubusercontent.com/losete/29663bd6966fd693df7540fc619f9c15/raw/2561cbe995b39af5e745366faaeaa623ed77ee27/kong.sh
- chmod +x kong.sh
- ./kong.sh
- mv wso2/apis apictl/apis
- mv wso2/apps apictl/apps
- cd apictl
- ./apictl add-env -e production --registration https://localhost:9443/client-registration/v0.15/register --apim https://localhost:9443 --token https://localhost:8243/token --admin https://localhost:9443/api/am/admin/v0.15 --api_list https://localhost:9443/api/am/publisher/v1.0/apis --app_list https://localhost:9443/api/am/store/v1.0/applications
- ./apictl login production -u admin -p admin -k
- ./apictl import-api --file apis/Banos_1.0.0.zip --environment production -k
- ./apictl import-api --file apis/Gasolineras_1.0.0.zip --environment production -k
- ./apictl import-api --file apis/Farmacias_1.0.0.zip --environment production -k
- ./apictl import-api --file apis/Fuentes_1.0.0.zip --environment production -k
- ./apictl import-api --file apis/Cajeros_1.0.0.zip --environment production -k
- ./apictl import-api --file apis/Hospitales_1.0.0.zip --environment production -k
- ./apictl import-api --file apis/Supermercados_1.0.0.zip --environment production -k
- ./apictl import-app --file apps/admin.zip --environment production -k
- cd ..
- "curl -k -X POST https://localhost:8243/token -d 'grant_type=password&username=admin&password=admin' -H 'Authorization: Basic cVhCNXQ4OXpoRl9FdV9DRm1YckZBWDRaZFlrYTpQODdCVzNEYndTeU1oUzUxOVlWYkkxZngyTkFh0' > token.txt"
- token=`cat token.txt | jq -r '.access_token'`


after_success:
- token=`cat token.txt | jq -r '.access_token'`
# Unit API tests with newman
- newman run tests/newman/gasolineras.postman_collection.json
- newman run tests/newman/cajeros.postman_collection.json
- newman run tests/newman/banos.postman_collection.json
- newman run tests/newman/farmacias.postman_collection.json
- newman run tests/newman/hospitales.postman_collection.json
- newman run tests/newman/puntosAgua.postman_collection.json
- newman run tests/newman/supermercados.postman_collection.json
- newman run tests/newman/banos.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/gasolineras.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/cajeros.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/farmacias.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/hospitales.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/puntosAgua.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/supermercados.postman_collection.json --insecure --global-var "token=$token"
# Plugin tests
- newman run tests/newman/metrics.postman_collection.json
- newman run tests/newman/bodyTests.postman_collection.json
- newman run tests/newman/cachePlugin.postman_collection.json
- newman run tests/newman/caching.postman_collection.json
- newman run tests/newman/metrics.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/bodyTests.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/cachePlugin.postman_collection.json --insecure --global-var "token=$token"
- newman run tests/newman/caching.postman_collection.json --insecure --global-var "token=$token"
- curl -X POST http://localhost:8001/consumers/corunapi/key-auth -d '13rue13a12345'
- curl -X POST http://localhost:8001/plugins --data "name=key-auth"
- newman run tests/newman/apikey.postman_collection.json
- newman run tests/newman/apikey.postman_collection.json --insecure --global-var "token=$token"
# Creating the configuration file
- cd $HOME/.dotnet/tools
- sudo ./kongverge --host:localhost export kongfiles
- cd ../..

before_deploy:
# Benchmarking
# Kong + Node
- siege -t 60S -c 250 -iqf tests/benchmarks/urls.txt
- siege -t 60S -c 250 -q http://127.0.0.1:3013/
- siege -t 60S -c 200 -iqf tests/benchmarks/urls.txt
Expand All @@ -104,7 +130,20 @@ before_deploy:
- siege -t 60S -c 25 -q http://127.0.0.1:3013/
- siege -t 60S -c 10 -iqf tests/benchmarks/urls.txt
- siege -t 60S -c 10 -q http://127.0.0.1:3013/
- siege -t 60S -c 250 -q "http://www.mapabase.es/arcgis/rest/services/Otros/Gasolineras/FeatureServer/0/query?where=localidad+%3D+%27CORUÑA+%28A%29%27&outFields=latitud,longitud,horario,dirección,rótulo&f=json"
# WSO2
# Not possible because WSO2 can't handle the concurrency
# Apigee
# - siege -t 60S -c 250 -iqf tests/benchmarks/urls.txt
# - siege -t 60S -c 200 -iqf tests/benchmarks/urls.txt
# - siege -t 60S -c 150 -iqf tests/benchmarks/urls.txt
# - siege -t 60S -c 100 -iqf tests/benchmarks/urls.txt
# - siege -t 60S -c 75 -iqf tests/benchmarks/urls.txt
# - siege -t 60S -c 50 -iqf tests/benchmarks/urls.txt
# - siege -t 60S -c 25 -iqf tests/benchmarks/urls.txt
- siege -t 5S -c 10 -iqf https://cmiguel-eval-test.apigee.net/gasolineras?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT
# Directly
- siege -t 10S -c 250 -q "http://www.mapabase.es/arcgis/rest/services/Otros/Gasolineras/FeatureServer/0/query?where=localidad+%3D+%27CORUÑA+%28A%29%27&outFields=latitud,longitud,horario,dirección,rótulo&f=json"
- siege -t 10S -c 10 -q "http://www.mapabase.es/arcgis/rest/services/Otros/Gasolineras/FeatureServer/0/query?where=localidad+%3D+%27CORUÑA+%28A%29%27&outFields=latitud,longitud,horario,dirección,rótulo&f=json"

deploy:
provider: releases
Expand Down
117 changes: 116 additions & 1 deletion tests/newman/apikey.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,126 @@
"item": [
{
"name": "apikey",
"event": [
{
"listen": "prerequest",
"script": {
"id": "923e11ce-3063-48b3-aa80-17bf314124ba",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "63f5c572-65ad-4d0b-9203-7046489210c3",
"exec": [
"pm.test(\"Your test name\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData[\"message\"]).to.eql(\"No API key found in request\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:8000/gasolineras",
"protocol": "http",
"host": [
"localhost"
],
"port": "8000",
"path": [
"gasolineras"
]
}
},
"response": []
},
{
"name": "WSO2_auth",
"event": [
{
"listen": "test",
"script": {
"id": "13461367-51fe-49c7-a108-6dce5f335a84",
"exec": [
"pm.test(\"Body matches string\", function () {",
" pm.expect(pm.response.text()).to.include(\"Invalid Credentials.\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://localhost:8243/gasolineras/1.0.0/",
"protocol": "https",
"host": [
"localhost"
],
"port": "8243",
"path": [
"gasolineras",
"1.0.0",
""
],
"query": [
{
"key": "",
"value": "",
"disabled": true
}
]
}
},
"response": []
},
{
"name": "apigee",
"event": [
{
"listen": "test",
"script": {
"id": "e9173a53-13d7-49fb-acf1-66d6b3fe62e7",
"exec": [
"pm.test(\"Body matches string\", function () {",
" pm.expect(pm.response.text()).to.include(\"Failed to resolve API Key variable\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": ""
"raw": "https://cmiguel-eval-test.apigee.net/gasolineras",
"protocol": "https",
"host": [
"cmiguel-eval-test",
"apigee",
"net"
],
"path": [
"gasolineras"
]
}
},
"response": []
Expand Down
143 changes: 142 additions & 1 deletion tests/newman/banos.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,152 @@
"item": [
{
"name": "Banos",
"event": [
{
"listen": "test",
"script": {
"id": "a1e6ad73-9831-420a-b761-07ac78bbeaf6",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Body matches string\", function () {",
" pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");",
"});",
"",
"pm.test(\"Body matches string\", function () {",
" pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:8000/banos",
"protocol": "http",
"host": [
"localhost"
],
"port": "8000",
"path": [
"banos"
]
}
},
"response": []
},
{
"name": "WSO2_banos",
"event": [
{
"listen": "test",
"script": {
"id": "691fbecf-4112-4b7c-9d30-a8f553cea899",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Body matches string\", function () {",
" pm.expect(pm.response.text()).to.include(\"\\\"x\\\": -8.\");",
"});",
"",
"pm.test(\"Body matches string\", function () {",
" pm.expect(pm.response.text()).to.include(\"\\\"y\\\": 43.\");",
"});"
],
"type": "text/javascript"
}
},
{
"listen": "prerequest",
"script": {
"id": "9b4b3ef8-b69f-4346-9885-52e928b95957",
"exec": [
"pm.globals.get(\"token\");"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{token}}",
"type": "text"
}
],
"url": {
"raw": "https://localhost:8243/banos/1.0.0/",
"protocol": "https",
"host": [
"localhost"
],
"port": "8243",
"path": [
"banos",
"1.0.0",
""
]
},
"description": "Same request to WSO2"
},
"response": []
},
{
"name": "apigee",
"event": [
{
"listen": "test",
"script": {
"id": "37f386fe-7753-493c-80e9-5f0cf8a749cf",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Body matches string\", function () {",
" pm.expect(pm.response.text()).to.include(\"\\\"x\\\":-8.\");",
"});",
"",
"pm.test(\"Body matches string\", function () {",
" pm.expect(pm.response.text()).to.include(\"\\\"y\\\":43.\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": ""
"raw": "https://cmiguel-eval-test.apigee.net/banos?apikey=sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT",
"protocol": "https",
"host": [
"cmiguel-eval-test",
"apigee",
"net"
],
"path": [
"banos"
],
"query": [
{
"key": "apikey",
"value": "sKFn6fhjFdSdPGszeCyzonNpeP5ndlyT"
}
]
}
},
"response": []
Expand Down
Loading