Nagoya
Quality Assurance system for Hopper services
Why do we need a QA system?
- Integrations with providers need to be tested
- There are a lot of integrations so the testing should be automated
- Public Helpers is changing and so should the integrations
- Testing wouldn't take a lot of time
- It would be nice to have a continuous integration system to test the services
How do we solve these problems?
Make a system that can:
- Make calls to the services (Brno, Atlanta, Miami ...)
- Test the responses from the services
- Have a way of describing tests that doesn't require programming knowledge
- Have a useful UX for making it easier to work with
- Have an API so it will be easier to integrate with a continuous integration system (Travis, Shippable ...)
Nagoya
QA system
Nagoya
- Project that saves data for Tests and Services
- CRUD APIs to change them
- API endpoints to run selected tests on a single service
- Decoupled Single page application made with Angular to consume the API and make it easier to work with
- Nagoya uses Project Helpers' tools
- Slick 3.1.1
- Finatra 2.1.6
Nagoya
Ok, but how do we save/edit the tests in the DataBase?
{
"query": {
"alternate_destinations": [],
"alternate_origins": [],
"origin": "LON",
"filters": {
"exclude_carriers": []
},
"departure_date": "2016-09-20",
"destination": "PRG"
},
"timestamp": 1472719555730,
"took": 1389,
"results": [
{
"id": "O7dxPabyulfikvBs5WTIBWyefwcV7z",
"timestamp": 1472719555713,
"base_amount": 32,
"tax_amount": 0,
"currency_code": "USD",
"segments": [
{
"origin": "LTN",
"destination": "PRG",
"departure_time": 1474401900000,
"departure_tz_offset": 60,
"arrival_time": 1474408500000,
"arrival_tz_offset": 120,
"duration": 110,
"outgoing": true,
"flight_number": "2602",
"marketing_carrier_code": "W6",
"fare_code": "",
"stops": 0,
"available_seats": 9,
"booking_code": ""
}
],
"source": "Kiwi",
"conversation_id": "...",
"pax_type": "ADT",
"exchange_rate": 1,
"provider": {
"pcc": "BRNO",
"Provider": "Kiwi"
}
}
}
List
Integer
String
Value inside an Object inside a List
Boolean
{
...
"took": 1389,
"results": [
{
...
"base_amount": 32,
...
}
]
}
Nagoya
{
...
"took": {"min": 100, "max": 10000},
"results": [
{
...
"base_amount":
{
"min":20,
"max":231
},
...
}
]
}
We want to have a way we can say
{
...
"took": 1389,
"results": [
{
...
"base_amount": 32,
...
}
]
}
Nagoya
{
"took":
{
"min": 100,
"max": 10000
},
"results":
{
"minLength": 1,
"maxLength": 200
},
"seq_results":
{
"base_amount":
{
"max":2000
}
}
}
Nagoya
- IntegerValidator
- ListValidator
- StringValidator
- DateValidator
- CustomValidator
- ...
This gives us the ability to describe various validators for different fields in a single JSON
Nagoya
Benefits
- Easy to use
- Easy to maintain
- Flexible - Can be used by sending requests to an API or by a UX
- Saves a lot of time
- Can be used by a non programmer
Nagoya
Demo
Documentation can be found at:
Nagoya
TODOs
- Add method to the Tests so we can send various requests (only GET supported at the moment)
- Add support for booking requests as well as shopping ones
- Add StringValidator, BooleanValidator, DateValidator and others
- Resolve the problems with having no migrations for the database
- Keep History of tests ran/passed/failed and tests/services/bundles of tests
- Make the shopping tests run queries according to the current date (+10 days, +20 days)
- Make the frontend pretty
Nagoya
By Kamen Kotsev
Nagoya
- 252