Code Monkey home page Code Monkey logo

timings-demo's Introduction

timings-demo

Sample tests scripts to demonstrate the timings API. You can copy/reference the test scripts in this repo to build your own "timings-enabled" scripts. You can find both JavaScript and Python based scripts in the /js and /py folders.

The scripts are implementing two of the timings API clients that are available here:

Installation

You can also run the tests in this repo to test your timings API! See installation instructions below:

JavaScript based test scripts

clone repo with git clone and install dependencies with npm i (run this from inside the /js sub-folder!)

$ git clone https://github.com/Verkurkie/timings-demo.git
$ cd {rootFolder}/js
$ npm i

Configuration for JavaScript tests

Before running tests, you have to configure the default parameters by editing the config file {rootFolder}/js/.perfconfig.js. The most important settings to change are:

key description example
PERF_API_URL Full URL of the API "http://my_api_server/v2/api/cicd/"
api_params.flags.esCreate Save results to ElasticSearch true
api_params.log.test_info Information about the test(-step) My test
api_params.log.env_tester Environment of the test machine local
api_params.log.browser Browser being used for the test Chrome
api_params.log.env_target Environment of the target app/api prod
api_params.log.team The name of your team/product MY_PRODUCT

Running JavaScript tests (uses webdriverIO)

To run the all of the JS tests, run the following command:

$ cd {rootFolder}/js
$ npm run test

Or, to run indivisual JS tests, you can run this command:

$ cd {rootFolder}/js
$ ./node_modules/.bin/wdio ./wdio.conf.js --spec ./specs/{spec file}.js

Python based test scripts

clone repo with git clone and install dependencies with pip:

$ git clone https://github.com/Verkurkie/timings-demo.git
$ cd {rootFolder}/py
$ pip install timingsclient selenium

Configuration for Python tests

Before running tests, you have to configure the default parameters by editing the config file {rootFolder}/py/config.yaml. The most important settings to change are:

key description example
PERF_API_URL Full URL of the API "http://my_api_server/v2/api/cicd/"
api_params.flags.esCreate Save results to ElasticSearch true
api_params.log.test_info Information about the test My test
api_params.log.env_tester Environment of the test machine local
api_params.log.browser The browser being used for the test Chrome
api_params.log.env_target Environment of the target (usually dev test
api_params.log.team The name of your team/product MY_PRODUCT

Running Python test

Then, to run the Python tests, simply run:

$ cd {rootFolder}/py
$ python demo_2_perf.py

timings-demo's People

Contributors

mverkerk-godaddy avatar

Watchers

 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.