why jenkins always Finished: SUCCESS even my scripts run fail/error?

Asked by Doris Chang on 2018-10-16

I am so confused my scripts run ERROR, jenkins finished always SUCCESS, it should be finished FAILURE, hope someone can help me, thanks.

My scripts:

# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import unittest
import shutil
import HTMLTestRunner
from sikuli import *
class DemoTestCase(unittest.TestCase):
    def test_Demo(self):
        """Description"""
        doubleClick(Pattern("1538146032908.png").similar(0.81))
    def test_Demo2(self):
        """Description"""
        assert True

if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(DemoTestCase)
    output = open("D:\\QQ\\" + "demo.html", 'w')
    runner = HTMLTestRunner.HTMLTestRunner(stream=output, title='Test Report', description='This is a test')
    runner.run(suite)

------------------------------------------------------------------------------------------------------------------
Jenkins Console:
C:\Program Files (x86)\Jenkins\workspace\aaa>D:\Sikuli1.1.4\runsikulix.cmd -r D:\QQ\POO.sikuli
+++ running this Java
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
+++ trying to run SikuliX
+++ using: -Xms64M -Xmx512M -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine -jar D:\Sikuli1.1.4\sikulix.jar -r D:\QQ\POO.sikuli
E.

Time Elapsed: 0:00:03.061000
Finished: SUCCESS

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-10-16
Last reply:
2018-10-17
RaiMan (raimund-hocke) said : #1

Jenkins in the standard runs headless, but SikuliX needs a real screen or at least a fake screen, that behaves like that (like xvfb on linux). Therefor I doubt, that doubleClick(Pattern("1538146032908.png").similar(0.81)) works.

Since you you use HTMLTestRunner, the tests always end up with no errors for the outer world - the problems are reported in the report file in your case, which is intended.

... and Jenkins says: job done.

To solve things in your Jenkins environment, you have to look into the net for solutions.
This goes far beyond SikuliX questions.

Can you help with this problem?

Provide an answer of your own, or ask Doris Chang for more information if necessary.

To post a message you must log in.