Skip to main content
deleted 2 characters in body
Source Link
  • We want to run unit tests against a built Docker image and not by installing the environment inside Gitlab CI runner
  • We don't want to push the docker image to a registry and pull it back in a test job to run unit tests - it's slower.

But it contradicts the separation of concerns principle - now our build job will also run unit tests.

The question for the community: is thisit okay to sacrifice this principle in this case or there are better alternatives?

  • We want to run unit tests against a built Docker image and not by installing the environment inside Gitlab CI runner
  • We don't want to push the docker image to a registry and pull it back in a test job to run unit tests - it's slower.

But it contradicts the separation of concerns principle - now our build job will also run unit tests.

The question for the community: is this okay to sacrifice this principle in this case or there are better alternatives?

  • We want to run unit tests against a built Docker image and not by installing the environment inside Gitlab CI runner
  • We don't want to push the docker image to a registry and pull it back in a test job to run unit tests - it's slower.

But it contradicts the separation of concerns principle - now our build job will also run unit tests.

The question for the community: is it okay to sacrifice this principle in this case or there are better alternatives?

Source Link

Is it a good practice to run unit tests inside build job in Gitlab CI?

  • We want to run unit tests against a built Docker image and not by installing the environment inside Gitlab CI runner
  • We don't want to push the docker image to a registry and pull it back in a test job to run unit tests - it's slower.

But it contradicts the separation of concerns principle - now our build job will also run unit tests.

The question for the community: is this okay to sacrifice this principle in this case or there are better alternatives?