Now that you have a script that tests Charlene's script we can start to find when the error was introduced!
Step 6
Let's run our new script on the current state of Charlene's project and see what happens:
Make sure you are in Charlene's last commit (i.e., d8bc3eb), you can check it with git log.
Run git bisect start to start the bisect process (it should not produce any output)
Run your script: python test_sagittal_brain.py
In which state is the code? Did it fail (bad) or everything seemed fine (good)?
Run the git bissect <state> <id-commit>
Note
If you are in this commit, you can use `HEAD` as the `id`
Now let's got to a point in history we believe the code was working correctly.
Take a look at the history of Charlene's repository: git log --oneline
Jump to her second commit: git checkout <id-commit> (When she introduced data for future testing)
Run your script: python test_sagittal_brain.py
In which state is the code now, bad or good?
Run the git bissect <state> <id-commit>
By now we should have told bisect that there is a good and a bad commit and we want to find when things started going wrong.
You can see which ones are by running git bisect log.
Hint
The output of the `log` should be something like:
```
git bisect start
# bad: [d8bc3ebaecd0cc7a2872da4c81d30b56f9b746ad] Makes the file Pep8 compliant and fixessome typos on docs
git bisect bad d8bc3ebaecd0cc7a2872da4c81d30b56f9b746ad
# good: [9dc8a27ada280e4479241c37bcb4d7f50c34ca09] Adds input and output data for future testing
git bisect good 9dc8a27ada280e4479241c37bcb4d7f50c34ca09
```
Let's now git bisect to find the commit that introduce the bug!
git bisect run python test_sagittal_brain.py
React to this issue (#27) with a 🚀 when your team has completed the task.
Continuation from #26.
Now that you have a script that tests Charlene's script we can start to find when the error was introduced!
Step 6
Let's run our new script on the current state of Charlene's project and see what happens:
d8bc3eb
), you can check it withgit log
.git bisect start
to start the bisect process (it should not produce any output)python test_sagittal_brain.py
In which state is the code? Did it fail (
bad
) or everything seemed fine (good
)? Run thegit bissect <state> <id-commit>
Note
If you are in this commit, you can use `HEAD` as the `id`Now let's got to a point in history we believe the code was working correctly.
git log --oneline
git checkout <id-commit>
(When she introduced data for future testing)python test_sagittal_brain.py
bad
orgood
? Run thegit bissect <state> <id-commit>
By now we should have told
bisect
that there is a good and a bad commit and we want to find when things started going wrong. You can see which ones are by runninggit bisect log
.Hint
The output of the `log` should be something like: ``` git bisect start # bad: [d8bc3ebaecd0cc7a2872da4c81d30b56f9b746ad] Makes the file Pep8 compliant and fixessome typos on docs git bisect bad d8bc3ebaecd0cc7a2872da4c81d30b56f9b746ad # good: [9dc8a27ada280e4479241c37bcb4d7f50c34ca09] Adds input and output data for future testing git bisect good 9dc8a27ada280e4479241c37bcb4d7f50c34ca09 ```Let's now
git bisect
to find the commit that introduce the bug!React to this issue (#27) with a 🚀 when your team has completed the task.
Sample solution