Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ There are several options for configuring your local environment so that you cod
- For example, in IntelliJ you have "Limited WIP": https://github.com/dkandalov/limited-wip (though, to be honest, it didn't work too well for me...).
- In VS Studio you could play with "Watched Path Autoexec": https://marketplace.visualstudio.com/items?itemName=hexix.watched-path-autoexec
* 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](https://medium.com/@tdeniffel/real-world-tcr-bb9958234bf8).
- You can either:
- install `inotifywait` or something similar depending on your OS:
- E.g. in Ubuntu run `sudo apt-get install inotify-tools`
- On Mac OS X: https://superuser.com/questions/371354/inotifywait-alternative-command-for-mac
- On Windows, one option is to use Cygwin and run the Linux scripts.
- If you use something different to `inotifywait`, modify your `watch.sh` file.
- 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`)
- A more agnostic solution: use the scripts included under the folder `/scripts` of each language-specific folder of this repo (or create your own). The scripts are based on [these](https://medium.com/@tdeniffel/real-world-tcr-bb9958234bf8).
- You'll need:
- Linux: install `inotifywait` e.g. in Ubuntu run `sudo apt-get install inotify-tools`
- Mac OS X: `brew install fswatch`
- Windows: one option is to use Cygwin and run the Linux scripts.
- Alternately, install the `watch` utility (it exists in both Linux and Mac OS X)
- To run the scripts, go to your specific folder (e.g. `tcr-python`), and run the watch script
- `../scripts/watch-linux.sh` for `inotifywait`
- `../scripts/watch-osx.sh` for `fswatch`
- `../scripts/watch-generic.sh` for `watch`

If your OS doesn't have any of these options, then you'll need to find a similar watchdog tool and make a new watch script.


## Proposed exercise
Expand Down
1 change: 1 addition & 0 deletions scripts/commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git commit -m working $(PWD)
1 change: 1 addition & 0 deletions scripts/revert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git checkout HEAD -- $(PWD)
1 change: 1 addition & 0 deletions scripts/tcr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./scripts/buildIt.sh && (./scripts/test.sh && $(PWD)/../scripts/commit.sh || $(PWD)/../scripts/revert.sh)
2 changes: 1 addition & 1 deletion tcr-generic/watch-generic.sh → scripts/watch-generic.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# You just need to install watch, e.g. in Mac `brew install watch`
watch ./tcr.sh
watch $(PWD)/../scripts/tcr.sh
9 changes: 9 additions & 0 deletions scripts/watch-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -eux -o pipefail

while true
do
inotifywait -r -e modify $(PWD)
$(PWD)/../scripts/tcr.sh
done
9 changes: 9 additions & 0 deletions scripts/watch-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -eux -o pipefail

while true
do
fswatch --recursive --one-event $(PWD)
$(PWD)/../scripts/tcr.sh || true
done
9 changes: 3 additions & 6 deletions tcr-csharp/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# Template for trying TCR in DotNet Core

## Prerequisites
1. You need **.Net Core 2.2.x**
1. You need **.Net Core 2.2.x**
* https://dotnet.microsoft.com/download
2. If you are using Mac OS you should install **watchexec**
* https://github.com/watchexec/watchexec
3. Connectiviy to the Internet!

2. Connectivity to the Internet!

## How to verify that everything works
From the terminal, run `dotnet build` or `dotnet test`: it should download all the dependencies and finish showing that the tests were successfully executed.

## How to run TCR
* Run the script `./watch.sh`
* Run the watch script as specified in the top-level README
* Only the business code gets reverted when failing the tests
1 change: 0 additions & 1 deletion tcr-csharp/scripts/commit.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-csharp/scripts/revert.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-csharp/tcr.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-csharp/watch.sh

This file was deleted.

8 changes: 1 addition & 7 deletions tcr-elixir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,4 @@

Requirements

- Elixir 1.7 or above

How to run

```
sh watch.sh
```
- Elixir 1.7 or above
1 change: 0 additions & 1 deletion tcr-elixir/scripts/commit.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-elixir/scripts/revert.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-elixir/tcr.sh

This file was deleted.

5 changes: 0 additions & 5 deletions tcr-elixir/watch.sh

This file was deleted.

4 changes: 1 addition & 3 deletions tcr-generic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ You only need to adapt two scripts to your language:
* `buildIt.sh`
* `test.sh`

Then, if you're on a Linux system, you can use the `watch.sh` script (you need to install inotify-tools first). A more generic solution, working in both Linux and Mac OSX, would be the `watch-generic.sh` script (you just need to install hte `watch` utility, e.g. `brew install watch` in OSX).

Finally, just include your code under the /src folder or change that path in the `watch.sh` and `revert.sh` scripts.
Then you should be able to run the watch script as specified in the top-level README
1 change: 0 additions & 1 deletion tcr-generic/scripts/commit.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-generic/scripts/revert.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-generic/tcr.sh

This file was deleted.

2 changes: 0 additions & 2 deletions tcr-generic/watch-mac.sh

This file was deleted.

5 changes: 0 additions & 5 deletions tcr-generic/watch.sh

This file was deleted.

12 changes: 6 additions & 6 deletions tcr-java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
## Prerequisites
1. You need **Maven 3.x** (variables M2_HOME, M2, MAVEN_OPTS, PATH...)
* https://maven.apache.org/install.html
* Example en Ubuntu: https://www.vultr.com/docs/how-to-install-apache-maven-on-ubuntu-16-04
* Example on Ubuntu: https://www.vultr.com/docs/how-to-install-apache-maven-on-ubuntu-16-04
2. Having installed **JDK 1.8** (or you can just change the pom.xml to whatever version fits you)
* E.g. para Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
* E.g. for Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
* Configure the JAVA_HOME env variable.
3. Connectiviy to the Internet!
3. Connectivity to the Internet!


## How to verify that everything works
There are several ways to do it:

* From you favourite IDE: run the test and see it going green
* From the terminal, run `mvn clean test`: it should download all the dependencies and finish showing that the tests were successfully executed.
* From your favourite IDE: run the test and see it going green
* From the terminal, run `mvn clean test`: it should download all the dependencies and finish showing that the tests were successfully executed


## How to run TCR
* Run the script `./watch.sh`
* Run the watch script as per the top-level README
* Only the business code gets reverted when failing the tests
1 change: 0 additions & 1 deletion tcr-java/scripts/commit.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-java/scripts/revert.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-java/tcr.sh

This file was deleted.

5 changes: 0 additions & 5 deletions tcr-java/watch.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-python/scripts/commit.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-python/scripts/revert.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-python/tcr.sh

This file was deleted.

5 changes: 0 additions & 5 deletions tcr-python/watch.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tcr-ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

## How to run it
1. Run `rspec --init`
2. Run `./watch.sh`
2. Run relevant watch script (see README)

It should work! :-)
1 change: 0 additions & 1 deletion tcr-ruby/scripts/commit.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-ruby/scripts/revert.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-ruby/tcr.sh

This file was deleted.

5 changes: 0 additions & 5 deletions tcr-ruby/watch.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-rust/scripts/commit.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-rust/scripts/revert.sh

This file was deleted.

1 change: 0 additions & 1 deletion tcr-rust/tcr.sh

This file was deleted.

5 changes: 0 additions & 5 deletions tcr-rust/watch.sh

This file was deleted.