Giter Club home page Giter Club logo

testdeck's Introduction

Testdeck

Testdeck is an E2E test harness for Rundeck and the popular Rundeck community docker image jordan/rundeck.

Testdeck utilizes two test runners:

  • bitscript for executable scripts/programs
  • jest for an amazing experience

Getting started

Installing dependencies

Follow the dependency name links to navigate to installation instructions.

Node.js
It is highly recommended that node.js be installed and managed by nvm. Project was developed with node >=8.11.0.

nvm install 8

Rundeck CLI
Java-based CLI required for some tests to complete.

Docker / Docker-Compose
Docker compose

Chrome
Required for selenium tests. Travis-CI is configured to include the latest stable. When the envar CI=true the example will run Chrome in headless mode.

Install node modules:

npm install
npm install -g ts-node typescript

Quick Start

./src/main.ts -h
Options:
  --version       Show version number                                  [boolean]
  -f, --filter    Regexp pattern to filter full test path against[default: ".*"]
  -j, --jest      Options to pass to Jest                 [string] [default: ""]
  -r, --runner    Select test runner              [choices: "bitscript", "jest"]
  -t, --teardown  Tear down environment after run     [boolean] [default: false]
  -h              Show help                                            [boolean]

Pick a runner and go:

./src/main.ts -r bitscript

Enter watch mode with jest:

./src/main.ts -r jest -j='--watch'

Add BitScript runner tests to ./tests/

Ensure these are executable via chmod u+x ./tests/my_awesome_contribution.bash

Add Jest runner tests to ./__tests__/

Tests must have spec or test as the sub-extension

Usage

Bit.Script Runner

Do your tests hashbang? If so this is the runner for you!
This runner will discover and exec tests in the ./tests folder.

Sucess ✔️
The script exits with a return code that is 0.

Failure
The script exits with a return code that is not 0.

Output
Any stdout or stderr output from the script will be printed in the test results.

Groups
Tests can be grouped into folders of one depth. This will reflect in the test output.

Filter
Provide -f [regex] to filter tests on full file name.

Jest

Jest is the premiere in luxury running. Premium features include:

  • "Immersive" watch mode
  • Interactively filter tests with regex on test name or file name
  • Run only tests changed since last commit by default
  • Test files can be run in parallel(even works with selenium!)

Success ✔️
An error is not thrown out of the test method.

Failure
An error escapes and Jest has to catch it for you. The commit log will preserve your failure for all eternity.

Output
Jest will print console output as well as error contents.

Groups
Each file is a test suite. Within files it's can be placed inside describe's.

Shims
It is simple to create a TS or JS test that is a shim on an external script/executable. See an example here

testdeck's People

Contributors

protip avatar

Watchers

 avatar James Cloos avatar  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.