A
A
a000_000a2018-04-26 14:25:16
GitLab
a000_000a, 2018-04-26 14:25:16

How to add unit tests to gitlab-ci?

Gitlab-CI is building a build built on Docker containers. But you need to add a run of unit tests. Those. enter the container, run unit tests and, depending on the results, either stop the build or continue. How to determine the ID of the desired container in order to get into it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hikmat Abdunabiev, 2018-04-26
@Khikmat

And what prevents you from creating a test image, after successful tests, reupload this image to the prod version ?!
For example, a piece from a pipe:

Step 3:
  stage: build
  only:
    - "master"
  script:
    - docker pull $IMAGE:${VERSION}_test
    - docker tag $IMAGE:${VERSION}_test $IMAGE:latest
    - docker tag $IMAGE:${VERSION}_test $IMAGE:$VERSION
    - docker push $IMAGE:latest
    - docker push $IMAGE:$VERSION
  tags: [build]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question