1 00:00:01,640 --> 00:00:05,210 We just saw all of our tests get executed whenever we create this new request. 2 00:00:05,630 --> 00:00:08,840 Now, one has tried to add in an additional commit to this bold request. 3 00:00:09,290 --> 00:00:13,040 And in this additional comment, we're going to make a breaking change to one of our tests. 4 00:00:13,130 --> 00:00:16,910 Again, this is just so you can see what would happen if we make a change that's going to break our 5 00:00:16,910 --> 00:00:17,200 test. 6 00:00:17,300 --> 00:00:21,890 And I would be assigned to us that we should probably fix up our code before we merged into the master 7 00:00:21,890 --> 00:00:22,340 branch. 8 00:00:23,410 --> 00:00:24,530 The back inside my editor. 9 00:00:25,440 --> 00:00:28,680 I'm going to find the roots directory inside the old service. 10 00:00:29,670 --> 00:00:31,150 I'll find the test folder inside there. 11 00:00:31,720 --> 00:00:33,370 I'll open up the current user test file. 12 00:00:34,710 --> 00:00:38,370 And I'm going to make a change to this test to forcibly break it. 13 00:00:39,090 --> 00:00:43,050 In particular, I'll change the expectation right here from 200 to 400. 14 00:00:43,930 --> 00:00:45,930 That should definitely cause my test suite to fail. 15 00:00:47,360 --> 00:00:51,720 I'm gonna save that and we're going to imagine that maybe along with this failing test, we also wrote 16 00:00:51,720 --> 00:00:55,380 out some other code inside of our project that we would want you would eventually deploy. 17 00:00:55,920 --> 00:00:57,180 So we would want to go again. 18 00:00:58,320 --> 00:01:00,300 Go through this kind of process right here. 19 00:01:00,780 --> 00:01:03,300 We're going to commit our changes to that same branch. 20 00:01:03,660 --> 00:01:08,490 Well, then push that up to get home, because we have already prete created a plot request for this 21 00:01:08,490 --> 00:01:08,880 branch. 22 00:01:08,910 --> 00:01:13,980 We do not have to create a pull request a second time instead because we are making these changes to 23 00:01:13,980 --> 00:01:14,850 the same branch. 24 00:01:15,090 --> 00:01:18,060 They will be added in it as additional changes to the pilot cost. 25 00:01:18,090 --> 00:01:18,990 We had just created. 26 00:01:20,270 --> 00:01:21,840 They will go back over to my terminal. 27 00:01:23,160 --> 00:01:24,480 We'll do a get status. 28 00:01:25,380 --> 00:01:27,120 There's the test change I just made. 29 00:01:27,660 --> 00:01:32,380 Go at it, admit it, and I'll call us about last minute change. 30 00:01:35,030 --> 00:01:36,510 And I'll push it up to the same branch. 31 00:01:36,540 --> 00:01:37,740 The dead branch. 32 00:01:37,950 --> 00:01:39,930 Well, do I get push origin? 33 00:01:40,140 --> 00:01:40,500 Deb? 34 00:01:45,490 --> 00:01:45,680 All right. 35 00:01:45,730 --> 00:01:49,570 Once we push that, we should be able to go back or to get up and take a look at that play request. 36 00:01:50,540 --> 00:01:52,100 So there's the last minute change. 37 00:01:52,880 --> 00:01:55,760 And after a moment or two, I should see this little box down here. 38 00:01:55,790 --> 00:01:58,580 Update and say that it's running an additional set of tests. 39 00:01:59,090 --> 00:02:02,540 The tests that are now being executed include that latest change. 40 00:02:02,720 --> 00:02:05,240 And so we should have a test inside there that is going to fail. 41 00:02:05,930 --> 00:02:11,540 I can once again click on details and take a look at the running tests so I can expand that little bullet 42 00:02:11,540 --> 00:02:12,680 point right here. 43 00:02:14,830 --> 00:02:16,720 If you'll let me know, it's not going to let me. 44 00:02:17,930 --> 00:02:19,160 Well, there we go. 45 00:02:19,430 --> 00:02:19,630 OK. 46 00:02:19,700 --> 00:02:23,000 So are installing dependencies once again, we're going to run the tests in this case. 47 00:02:23,030 --> 00:02:24,140 They should fail horribly. 48 00:02:25,070 --> 00:02:26,720 So I'm going to let it do a thing for a moment here. 49 00:02:30,170 --> 00:02:31,840 It looks like a test we just started up. 50 00:02:32,510 --> 00:02:36,970 There's are a couple of passes and eventually we get that failure because our test failed. 51 00:02:37,540 --> 00:02:41,590 Now this over all little workflow right here should have failed as well. 52 00:02:42,290 --> 00:02:44,350 So if I now go back over to my conversation tab. 53 00:02:46,230 --> 00:02:48,870 I'll be told that some of our checks are in this case. 54 00:02:48,900 --> 00:02:50,100 All of our checks have failed. 55 00:02:50,850 --> 00:02:56,040 And so we can't technically merge our code into master, but GitHub is going to as strongly discourage 56 00:02:56,040 --> 00:02:59,520 you to do so, can say, hey, look, you are trying to run some tests here. 57 00:02:59,550 --> 00:03:02,850 It is clear that there is something wrong inside of your code base right now. 58 00:03:03,330 --> 00:03:08,190 And it's kind of encouraging us to fix up our code base before we merge these changes into master. 59 00:03:08,880 --> 00:03:09,990 I bet you guess I would do that. 60 00:03:10,110 --> 00:03:14,880 We just go into our code base, make the fixes, make sure our test pass locally and they eventually 61 00:03:15,180 --> 00:03:19,430 commit those changes and push them back up to the same PR and do that right now. 62 00:03:19,530 --> 00:03:21,840 We're going to essentially undo the change we just made. 63 00:03:23,440 --> 00:03:28,150 Back over inside my editor, I'll find that current user test file and I'll change that response right 64 00:03:28,150 --> 00:03:29,850 there back over to 200. 65 00:03:33,360 --> 00:03:38,640 Once I've got that updated, I'm then going to run my tests locally just to make sure that that actually 66 00:03:38,640 --> 00:03:41,520 fixed it up because this is what you really would do in the real world. 67 00:03:41,820 --> 00:03:44,940 We'll change into off, then do an NPM run test. 68 00:03:45,150 --> 00:03:45,880 Ohlin S.I. 69 00:03:46,380 --> 00:03:50,820 I'm running the S.I. script because I really just want to run the tests one time and immediately exit 70 00:03:50,880 --> 00:03:53,490 as opposed to start at my test and I kind of watch our mode. 71 00:03:57,290 --> 00:03:58,740 It looks like everything is now passing. 72 00:03:59,840 --> 00:04:03,110 Now we can commit that change and push it back up to get Hub once again. 73 00:04:04,520 --> 00:04:05,860 So I'll add that change. 74 00:04:06,160 --> 00:04:09,010 I'll give a commit message of something like fixed nest. 75 00:04:09,850 --> 00:04:11,740 We should probably provide a better description than that. 76 00:04:11,800 --> 00:04:12,670 I'll leave that up to you. 77 00:04:14,040 --> 00:04:15,680 And push that to origin. 78 00:04:15,870 --> 00:04:16,190 Deb. 79 00:04:21,320 --> 00:04:23,760 Now, once again, after that change has been made. 80 00:04:23,820 --> 00:04:24,870 I smell a flip back over. 81 00:04:27,140 --> 00:04:30,560 We're going to either see another test run right here. 82 00:04:30,810 --> 00:04:32,210 Yep, looks like there it starts. 83 00:04:33,060 --> 00:04:35,450 And once again, we're going to have to wait for these tests to be completed. 84 00:04:36,140 --> 00:04:37,820 So I bet you can guess what's going to happen now. 85 00:04:37,880 --> 00:04:40,430 Those tests are going to run in about 30 seconds or so. 86 00:04:40,850 --> 00:04:43,700 We're going to see a little green checkmark that says, hey, everything looks good. 87 00:04:43,760 --> 00:04:46,310 You can merge these changes into the master branch. 88 00:04:47,240 --> 00:04:47,440 All right. 89 00:04:47,450 --> 00:04:48,440 So that is pretty much it. 90 00:04:48,470 --> 00:04:51,500 That is kind of step number one in this entire workflow. 91 00:04:52,010 --> 00:04:55,520 Again, it's going to go something like this diagram right here. 92 00:04:56,240 --> 00:05:01,250 Remember, this diagram is really all about the first time that you create a particular branch or really 93 00:05:01,250 --> 00:05:04,720 a particular pull request after you create that pull request. 94 00:05:04,760 --> 00:05:06,550 You do not have to create a pull request again. 95 00:05:06,860 --> 00:05:07,770 You can continue. 96 00:05:08,840 --> 00:05:13,340 Making changes on the same branch, pushing them up to get hub every time you push those changes to 97 00:05:13,340 --> 00:05:14,180 that same branch. 98 00:05:14,390 --> 00:05:17,000 The tests are going to rerun and update people request. 99 00:05:18,100 --> 00:05:22,150 It's only when you merge that pull request or otherwise close it, you're going to have to create a 100 00:05:22,150 --> 00:05:24,060 pull request again at some point in the future. 101 00:05:25,280 --> 00:05:25,550 All right. 102 00:05:25,580 --> 00:05:30,080 So at this point, we have successfully shown that we can run tests around our suite whenever we push 103 00:05:30,080 --> 00:05:35,060 up code and we can get some output from those tests visible on our play request itself. 104 00:05:35,850 --> 00:05:38,360 Now we're going to expand the GitHub action we put together. 105 00:05:38,660 --> 00:05:44,240 We're going to make sure that we run tests from all of our different services, not just the service. 106 00:05:44,630 --> 00:05:45,440 So quick pause right here. 107 00:05:45,440 --> 00:05:48,110 And we're going to expand that little script in just a moment.