From the course: Continuous Integration and Continuous Delivery with GitLab

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Adding a test

Adding a test

- Let's take a quick look at the output of our pipeline before we move on. So if we open up the test1 job, which is the one where we added our cat of a file, you could see, here is the result. So the file that we created in the build job was passed along successfully and the content, which is just "This is a file" is output here. Now that's a somewhat useful test, but let's add something that actually offers some pass/fail functionality for us. So we'll click back to the editor, and let's scroll down here to test1. And just to keep things a little simpler, let's delete some of this example content. And we'll add a new line that actually describes what's going on. So we'll say, "Echo, testing for string GitLab." So we'll need to add some sort of test here. And because this is Bash, I can use something pretty simple. I can just use the grep command. If you've used Linux much, you're probably familiar with grep. It…

Contents