cargo-pando 0.2.0

Perform tasks concurrently over multiple copies of your repo, over multiple toolchains and/or git revisions.
cargo-pando-0.2.0 is not a library.

cargo-pando   Latest Version Rustc Version 1.31+ Build Status

Perform tasks concurrently over multiple copies of your repo.

Example use cases:

  • test your code against multiple rust releases in parallel
  • test the index / stage of your repo to validate incremental changes
  • test all commits in a given range in parallel to bisect a bug (TODO)
  • do both of the above at the same time (TODO)
  • run some other custom command across any of the above checkouts (TODO)

The name pando comes from the clonal colony of "multiple" trees that are actually one single organism. It is latin for "I spread out".

Stability

HERE BE DRAGONS. This extension is in the early stages of development and may cause data loss or worse. Only use if you're very comfortable with git and have backups.

There may also be backwards incompatible changes for each version.

Installation

Will be easily installable from crates.io once it's more mature.

git clone (repo url here)
cd cargo-pando
cargo install --path .

Upgrading

git pull origin master
cargo install --path . --force

How it Works

  1. Figure out what toolchains to run against, either from the CLI, .travis.yml, or just using all the installed ones.
  2. Create a copy of the repo's code in target/pando per toolchain, e.g. target/pando/1.31.0. Note that this is destructive.
  3. Run cargo +TOOLCHAIN_HERE test or some other action in each copy of the repo. For example, cargo +1.31.0 test in target/pando/1.31.0/working_dir.

Output is logged to target/pando/TOOLCHAIN_HERE/output.

Examples

See cargo pando help for more details.

Test the working directory against the toolchains listed in .travis.yml:

cargo pando test

Test against every installed toolchain except the default, limiting it to 2 cargo tests at any given time:

cargo pando --all test -j 2 

Test each specified toolchain, but only doc tests:

cargo pando -t stable -t beta test -- --doc

Git

Test the given toolchain against the index (stage) of your repo. Useful if you're incrementally adding changes to a commit and you want to check that your work in progress still works.

cargo pando --index -t stable test

TODO

  • add support for indicatif
  • read from travis CI config to determine toolchains to run against
  • support working directory copy
  • get target from cargo metadata instead of assuming
  • refactor checkout source to hide git impls (keep index for now)
  • toolchain selection flags
    • fancier ones?
  • invoke subtasks with --message-format=json for better output information?
  • determine number of steps for task from dependency list? (means actions will have to run before fully setting up the bars?)
  • tree selection
  • support allowing failures from travis.yml
  • add support for other exec targets
    • print
    • cargo
    • build
    • cmdeach / cmdall
    • shelleach / shellall
  • document using cargo aliases to help with common sub-commands
  • document helpful env vars
  • consider do subsubcommand to make multiple actions easier (use square brackets for separation?)
  • tmux integration (might have to refactor when output is created, etc.)
  • blog post
  • colorize / emojify output