Coder Social home page Coder Social logo

anhtnt90 / otp-travelsearch-qa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from entur/otp-travelsearch-qa

0.0 1.0 0.0 366 KB

Simple test tool for OTP travel searches

License: European Union Public License 1.2

Python 95.01% Shell 2.48% Dockerfile 2.52%

otp-travelsearch-qa's Introduction

otp-travelsearch-qa CircleCI

Simple test tool for OTP travel searches

Reads endpoints.csv and runs OTP travelsearches sequentially using the graphql endpoint. It produces json reports.

Optional features

  • Upload reports to gcp (Google cloud storage)
  • Send stats to Graphite

Prepare:

  • Install python
  • pip install datetime google.cloud graphitesend

Run

python graphql_test.py endpoints.csv

Run and upload to gcp

BUCKET_NAME=<bucket_name> DESTINATION_BLOB_NAME="<destination_blob_name" python ./graphql_test.py endpoints.csv True

Run and send metrics to Graphite

GRAPHITE_REPORT_HOST="<graphite>" python ./graphql_test.py endpoints.csv

Viewing reports

See https://github.com/entur/otp-travelsearch-ui

Why not use a test framework?

This python script is run as a kubernetes job. Why not use a test framework or SaaS solution? Because: we had specific requirements for travel search testing, and could not at the time find a faster solution than writing and maintaining this ourself. Some of these requirements:

Test report format

The test reports does have a very specific format, that allows us to control the view in https://github.com/entur/otp-travelsearch-ui

  • It makes it easy to group reports by location or time usage
  • Show the metrics we actually want
  • Link straight to shamash (GraphiQL) with the query that failed or was slow

Control our headers

Send ET-Client-Name to identify calls from this script.

Sending metrics to Graphite/Grafana

This script updates graphite Grafana Grafana test execution time

Postman Collection and Monitor

We have spent quite some time trying to migrate this test suite to Postman Collection and Monitor. To make it work with Postman, quite some workarounds had to be made because of GraphQL and reading and iterating from csv files. And when it finally was set up and running with monitor, it turned out extremely expensive because of the number of requests per month. So we had to turn it off. It could have been executed with Newman, but then the impression was that a kubernetes pod was required, so it would not have been a Saas solution anyway

TODO

  • Separate folder for py files
  • Verify syntax of python scripts with CI
  • Do some testing to increase quality
  • Use a document database to store reports? Must be a suitable solution for otp-travelsearch-ui
  • Do more checks on the results from OpenTripPlanner

otp-travelsearch-qa's People

Contributors

csolem avatar nostra avatar recet avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.