Skip to content

Information and instructions for trying TCR workflow (test && commit || revert)

Notifications You must be signed in to change notification settings

islomar/tcr-workshop

Repository files navigation

TCR workshop

Information and instructions for trying the TCR workflow (test && commit || revert) as first described here.

This repository contains scripts for Python, Java, NetCore, Elixir, Ruby and Rust examples, each of them in their own folders.

Here you can find the slides used for a workshop facilitated with Joe Bew in Stockholm.

There is also a generic folder with scripts that could be easily adapted to your specific language (/tcr-generic).

Prerequisites

  • You need Git installed.
  • A basic test running (see "How to set up a basic test" section if you're having problems).

How to set up a basic test

Here you can find lots of templates for different languages. Plus, you have tcr-python, tcr-java, tcr-csharp, tcr-elixir, tcr-rust, tcr-ruby and tcr-go folders ready in this repo.

IDE configuration

  • VERY IMPORTANT: Disable the "Auto-save".
  • Be sure the file is being automatically refreshed (to see the file reverted when the tests fail).
    • VS Studio Code. Several options:
      • enable "experimental file watcher" from File -> Settings. Unfortunately, it doesn't seem to work "too well".
      • Reload Window: Ctl + 5
      • Or configure a shortcut for "File revert" (e.g. "Alt + Shift + r")

How to configure your environment for TCR

There are several options for configuring your local environment so that you code gets automatically committed or reverted:

  • Option 1: IDE
  • Option 2: scripts
    • A more agnostic solution: use the scripts included under the folder /scripts of each java/python/generic folder of this repo (or create your own). The scripts are based on these.
    • You can either:
      • install inotifywait or something similar depending on your OS:
      • install the watch utility (it exists in both Linux and Mac OSX), and use the watch-generic.sh script included under the folder tcr-generic
    • To run the scripts, go to your specific folder (e.g. tcr-python), and run ./watch.sh or watch-generic.sh (if using the generic one with watch)

Proposed exercise

  • You can try the TCR workflow with the Fibonacci kata, included here
  • Another simple exercise to practice it is the substring kata

Bonus track

How to squash

Scripts examples for JavaScript

https://medium.com/@itortv/i-implemented-the-mars-rover-kata-through-tcr-test-commit-revert-and-these-are-my-7e11c40983a6

Interesting links

Screencasts

About

Information and instructions for trying TCR workflow (test && commit || revert)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published