TDD Workflow - Continuous Integration2:54 with Jeremy McLain
Let's finish the workflow by integrating the code back into to a shared branch.
If you’re new to Git or GitHub, check out this course, which will give you an introduction to the Git version control system.
If you’re familiar with Git and GitHub, but are new to Visual Studio’s integration with GitHub, this workshop will get you up and running.
Some common continuous integration systems:
Now, my changes are committed and pushed back to GitHub. 0:00 But they haven't been merged into a shared branch for 0:03 everyone else in the project to enjoy. 0:06 Again, having good unit tests makes it possible for 0:08 us to competently merge these changes. 0:11 Before merging in these changes, it's often a good idea to have someone 0:14 other than yourself take a look at the changes and the test. 0:18 GitHub Has a really nice feature for doing this called a poll request. 0:22 Making a poll request just tells others that there are changes on a branch that 0:27 we'd like to have pulled into the rest of the project. 0:30 Other folks in the project can take a look at the changes and 0:33 inspect them before attempting to merge them into the shared branch that everyone 0:36 else is branching off of. 0:41 The reviewer can then decide whether to pull in the changes or 0:42 they'll make some suggestions for 0:45 additional changes that should be made before the code can be accepted. 0:47 When a pull request is pulled, it's first merged with the rest of the code. 0:51 But before these merged changes are committed and pushed back to GitHub, 0:55 all of the unit tests of the project are run again to make 0:59 sure that merging in the new code didn't break anything. 1:02 This is where unit tests once again are an integral part of the process. 1:06 If all of these tests pass, the code is committed and 1:10 pushed to the shared branch for all to enjoy. 1:14 GitHub is just one version control system. 1:16 So this process may be a bit different depending on your own tool chain. 1:19 If you'd like to learn more about GitHub check the teacher's notes for 1:23 links to other courses. 1:27 In most teams working on professional projects, 1:29 unit tests are an integral part of a continuous integration process. 1:32 A continuous integration system, or CI for short, 1:37 is used to make sure that all of the code that makes it into certain branches in 1:41 version control both builds and passes all of the tests. 1:46 If the build or 1:50 test fail then developers are immediately alerted to resolve the issue. 1:51 This is important because all developers who are working on a project, 1:56 need to be able to pull working code from the branch at any time to do the work. 2:00 Typically the CI system monitors a branch for any new commits. 2:05 As soon as the commit happens it builds the project and then runs the unit tests. 2:10 Some teams may decide to only run some of the unit tests on each commit. 2:15 The reason for this is because in a large project, 2:19 running all of the unit tests may take too much time. 2:22 If this is the case, they may decide to only run all of the unit tests once 2:26 a day and only during the night, at a time when the system has the most resources. 2:31 This is referred to as the night build. 2:36 As you can see, the unit tests are run over, 2:39 and over with every commit to ensure that nothing breaks. 2:42 This makes having good complete unit tests even more important. 2:45 Test driven development ensures that every unit of code written has test. 2:50
You need to sign up for Treehouse in order to download course files.Sign up