0

There is job script:

image: python:3.7.9

stages:
    - test

run_ui_tests:
    tags:
        - est
    stage: test
    before_script:
        - echo "Prepairing enviroment..."
        - python --version
        - pip install -r requirements.txt
    script:
        - echo "Executing ui tests with Pytest..."
        - cd cio_tests
        - pytest -v authorize_test.py
    after_script:
        - echo "Cleaning test catalogue..."

job fails after all tests are completed: enter image description here

What is the reason for this behaviour? After all, the tests are completed and one of the tests found a bug

Keith
  • 37
  • 4
  • `What is the reason for this behaviour?` What _exactly_ do you have in mind? What exactly is _this_ behavior? `After all, the tests are completed and one of the tests found a bug` ? Becaues one test failed. – KamilCuk Aug 05 '22 at 07:37
  • the `logs` are showing you everything, the job has failed since he couldn't pass the last test `FAILED authorize_test.py ...` – Aladin Aug 05 '22 at 07:38
  • That sounds like the expected behavior. The job should fail because one or more of your tests failed. – sytech Aug 05 '22 at 07:43
  • Just because the tests completed, does not mean the job should succeed. A test fails, your application exits with exit code 1, and the job fails. This is the exact expected behavior of a CI job. If tests fail, you want the CI to fail to be able to detect changes that introduced bugs. – faemmi Aug 05 '22 at 08:06
  • Okay, but how to make the job succesfully ends? – Keith Aug 08 '22 at 08:57

0 Answers0