Skip to content
Information and instructions for trying TCR workflow (test && commit || revert)
Ruby Elixir Shell Java C# Python
Branch: master
Clone or download
islomar Merge pull request #2 from pmareke/patch-1
Update README.md with new tcr folder
Latest commit 3c5ef8f Jun 2, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tcr-csharp Add watcher Jun 1, 2019
tcr-elixir Provide a more simple test Mar 11, 2019
tcr-generic Add watch-mac.sh Mar 12, 2019
tcr-java Delete useless Java class Mar 11, 2019
tcr-python working Mar 11, 2019
tcr-ruby working Mar 11, 2019
.gitignore working Jun 1, 2019
Fibonacci-kata.md Update Fibonacci-kata.md Mar 12, 2019
README.md Update README.md Jun 1, 2019
Substring-kata.md Add substring kata explanation Mar 11, 2019

README.md

TCR workshop

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

This repository contains scripts for a Python, Java and a NetCore example, each of them in their own folders.

Here you can find the slides used for a worshop 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 and tcr-csharp 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

You can’t perform that action at this time.