donal
2018-04-24 8eeb96a62229efe236bfef089ee172c56e8cc321
FIXES - lab3 first part
5 files modified
14 ■■■■ changed files
exercises/2-attack-of-the-pipelines/README.md 4 ●●●● patch | view | raw | blame | history
exercises/3-revenge-of-the-automated-testing/README.md 10 ●●●● patch | view | raw | blame | history
exercises/images/exercise3/api-build-step.png patch | view | raw | blame | history
exercises/images/exercise3/change-test-to-fail.png patch | view | raw | blame | history
exercises/images/exercise3/jenkins-build-step.png patch | view | raw | blame | history
exercises/2-attack-of-the-pipelines/README.md
@@ -316,9 +316,9 @@
$ git checkout exercise2/jenkins-slave docker/ templates/ params/jenkins-slave-npm
```
3. Open the `params/jenkins-slave-npm` file and update `<YOUR_ENABLEMENT_GIT_REPO>` accordingly. This set of parameters will clone from the enablement repo and run a docker build of the Dockerfile stored in `docker/jenkins-slave-npm`.
3. Open the `params/jenkins-slave-npm` file and update `<GIT_URL>` accordingly. This set of parameters will clone from the enablement repo and run a docker build of the Dockerfile stored in `docker/jenkins-slave-npm`.
```bash
SOURCE_REPOSITORY_URL=<YOUR_ENABLEMENT_GIT_REPO>
SOURCE_REPOSITORY_URL=<GIT_URL>
SOURCE_CONTEXT_DIR=docker/jenkins-slave-npm
NAME=npm-jenkins-slave
```
exercises/3-revenge-of-the-automated-testing/README.md
@@ -130,13 +130,13 @@
2. Click `save` or `apply` at the bottom to save the changes. Run the `dev-todolist-fe-build` job and verify that this passes and the `build` and `bake` jobs are both triggered.
2. We're now going to deliberately fail a test to ensure that `bake` and `deploy` jobs aren't triggered if any tests fail. Go to `ListOfTodos.spec.js` in `/tests/unit/vue-components` and head to `line 38`. Add `not.` before `toHaveBeenCalled()`.
2. We're now going to deliberately fail a test to ensure that `bake` and `deploy` jobs aren't triggered if any tests fail. Open the `todolist-fe` source code in your favourite editor. Open `ListOfTodos.spec.js` in `/tests/unit/vue-components` and head to `line 39`. Add `not.` before `toHaveBeenCalled()` to fail the test.
![change-test-to-fail](../images/exercise3/change-test-to-fail.png)
2. Push this to Gitlab and run the build job.
```bash
$ git add .
$ git commit -m "Deliberately failed test to test the pipeline stops me deploying broken code"
$ git commit -m "TEST - failing build with tests"
$ git push
```
@@ -161,11 +161,11 @@
2. Push this to Gitlab and run the build job.
```bash
$ git add .
$ git commit -m "Deliberately failed test to test the pipeline stops me deploying broken code"
$ git commit -m "TEST - failing build with tests"
$ git push
```
2. If successful this will fail the build and not run the `bake` or `deploy` jobs.
2. If successful this will fail the build and not run the `bake` or `deploy` jobs! Undo your changes and move on to the next section.
<p class="tip">
  NOTE - Don't forget to undo the changes that you made to your tests!
@@ -189,7 +189,7 @@
2. With tests executing locally; let's add them to our Jenkins pipeline. To do this; we'll create a new job and connect it up to our `todolist-fe` jobs. Open Jenkins and create a `New Item` called `dev-todolist-fe-e2e`. Make this Job `Freestyle`.
2. On the configuration page; Set the Label for the job to run on as `jenkins-slave-npm` and a build parameter of `BUILD_TAG`
2. On the configuration page; Set the Label for the job to run on as `jenkins-slave-npm`. Check the box marking the build parameterised and add a String parameter of `BUILD_TAG` as done before
![e2e-general](../images/exercise3/e2e-general.png)
2. On the Source Code Management tab; set the source code to git and add the url to your `todolist-fe` app. Set the branch to `refs/tags/${BUILD_TAG}`
exercises/images/exercise3/api-build-step.png

exercises/images/exercise3/change-test-to-fail.png

exercises/images/exercise3/jenkins-build-step.png