1

I'm new to gitlab CI after years of using Jenkins. I'm trying to convert my old project over to use Gitlab CI but I'm wondering if this is possible?

In Jenkins I have code that gets the number of tests and works out the percentage that passed, if over 90% pass I then set the Jenkins build to be successful, if <=90 I mark the build as failed.

In my Gitlab CI pipeline I can see gitlab already works out the percentage in success rate, is it possible for me to use this to pass or fail the job based on the value?

Doctor Who
  • 1,287
  • 5
  • 25
  • 46

1 Answers1

2

This should be possible in a similar way to Jenkins. Basically you need to catch output of your test tool and then process it and fail on condition. It is possible with bash, smth like:

    - if [ $percentage -lt 90 ];
      then
        echo "Percentage of passed tests is less than 90";
        exit 1;
      fi;
Distdev
  • 2,312
  • 16
  • 23