Problem description

  • After the automatic test of Jmeter interface was connected to Jenkins, some interfaces failed to execute and returned corresponding error codes, but Jenkins construction status was still successful, so there may be problems in downstream construction.

The solution

  • First look at the Jmeter test report. When all interfaces are successfully executed and the assertion is successful, the Success Rate is 100.00%

  • To add an execution shell to the project, fill in the following information

    Grep -c “100.00%”/home/ci/workspace/workspace/CKMSKdcTest/Report/TestReport. HTML

    if [ $? == 0 ]

    then exit 0 else exit 1 fi

  • Verify that all interfaces are successfully executed and asserted by searching for 100.00% success rates in the report
  • The result of the grep -c command is $? == 0 is successful, and status 0 is returned. At this point, Jenkins confirms that the build is successful by status 0; otherwise, the build fails