From the course: Continuous Integration and Continuous Delivery with GitLab
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Adding a test - GitLab Tutorial
From the course: Continuous Integration and Continuous Delivery with GitLab
Adding a test
- [Instructor] Now that we have a well-defined pipeline, let's create an actual test that can run inside. For our test, we'll use something pretty simple. We'll use the grep command to look for a specific string in our text file. First, we'll need to edit our pipeline file. So we'll click on .gitlab-ci.yml, and we'll go to edit, and edit in pipeline editor. And then we can scroll down to our test. So we want to look at this unit-test-job. The first thing we can do is change this line here from echo with just this example text, and we'll say Testing for the string. And then I'll use a single quote and say 'gitlab'. And then we can replace cat file.txt with grep, "gitlab" in quotes, and then file.txt. So that will just look for the string, gitlab in our file.txt. If you've used Linux much, you're probably familiar with the grep command. It just lets you use regular expressions to search within a file. In our case, we're just using this exact string, so that's our regular expression. Now…