Giter VIP home page Giter VIP logo

stacktest's Introduction

stacktest.el - in buffer testing of projects in OpenStack

OpenStack projects have a relatively well defined testing interface that uses tox and testrepository.

This is a mode to make testing using those be easily available inside of emacs. This reuses the compile infrastructure in emacs and is based upon nosemacs that does this same functionality for nose.

Installation

Add the following to your .emacs configuration:

(require 'stacktest)
;; optionally enable for all python files
(add-hook 'python-mode-hook 'stacktest-mode)

Usage

From within a python file you can run any of the following:

  • M-x stacktest-one : runs the current test function your cursor is in
  • M-x stacktest-debug-one : runs the current test function your cursor is in with OS_DEBUG=True (turns on debug logging)
  • M-x stacktest-pdb-one : runs the current test function your cursor is in pdb
  • M-x stacktest-module : runs all the tests in the current file
  • M-x stacktest-all : runs a full tox run in an emacs buffer
  • M-x stacktest-target : prompts for and runs a specific tox environment
  • M-x stacktest-again : rerun the last test run

You can bind these to more convenient keys. The various modes are extremely useful when iterating on test development. The compilation buffer is annotated so that failure points are clickable back into the code in question.

This also works over tramp if you are using ssh as your transport, through the magic of awesomeness.

Screenshots

A successful stacktest-one run (M-x stacktest-one from the shown cursor possition)

stacktest successful

A failed stacktest-one run. The filenames listed in the traceback are linked elements that will open those files at those lines.

stacktest failing

Assumptions

When running in -one or -module mode the testing skips tox / testr entirely and just uses subunit.run (if subunit-trace is available) or testtools.run from the .tox/py27 directory. This means we assume you've run tox -e py27 at least once before running this.

Futures

Things that would be nice to have (PRs welcomed)

  • further enhance the compilation buffer regexp to make it easier to understand at a glance
  • menu available when stacktest-mode enable

stacktest's People

Contributors

sdague avatar

Stargazers

Augustina avatar Olivier Verdier avatar Grzegorz Grasza avatar Jian Wen avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

ionrock kk7ds

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.