Running tests in k8s with gitlabci

Hello - please advice to me with such problem.
i want to run sbt tests in kubernetes inside of pod - for that i create helm chart with my code, tests starting with command sbt test.
Also i’m running it from .gitlab-ci.yaml file - creating namespace, needed tools ( kafka, postgres), and inside of this dynamical env i’m running container.
But now even if tests failed - job is successful, i’m getting logs with kubectl logs -f $(POD_NAME) and redirecting it from gitlab job.
How i can mark job as failed, when tests fails ?
thank you