Hello all, just trying to create a “better” email response.
I have some custom written tests that produce lots of test output, but I only want the failures (FAIL:) in the email,
09:53:06 *** FAIL: LTU_FUNC_TEST.LIBCFSEARCH_HITCOUNTTEST
…
09:54:09 *** FAIL: LTU_FUNC_TEST.LIBCFSEARCH_ATOMCENTER
…
09:54:15 *** FAIL: LTU_FUNC_TEST.LIBCFSEARCH_STRINGRESULT
so I use
${BUILD_LOG_REGEX, regex="(?i)( FAIL:.*)", substText="\n$1\n", showTruncatedLines=false, escapeHtml=true}
But I get this,
*** FAIL: LTU_FUNC_TEST.LIBCFSEARCH_HITCOUNTTEST *** FAIL: LTU_FUNC_TEST.LIBCFSEARCH_ATOMCENTER *** FAIL: LTU_FUNC_TEST.LIBCFSEARCH_STRINGRESULT
I would like each of these failures to be on its own line. That is what I thought maybe the substText might do but apparently not.
Is there a way to do this?
Dick Ginga, Informatics R&D
PerkinElmer Inc. | For the Better
HUMAN HEALTH | ENVIRONMENTAL
HEALTH
940 Winter Street, Waltham MA 02451
dick.ginga@perkinelmer.com
Mobile – 508-847-1434
Office – 781-663-6947
Are you using html email?
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D8711C23%40AMERMBX02.PERKINELMER.NET.
For more options, visit https://groups.google.com/d/optout.
yes
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVerq2uUTBOzeY8Gwp2ebPRthjObtJ_A4M%3DeU1OZtRcA1w%40mail.gmail.com.
Have you tried using </br> instead of \n?
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D8711CA0%40AMERMBX02.PERKINELMER.NET.
I can try that. the tests run for 45 minutes…
But it looks to me like $1 is eval’ing to ALL 3 lines instead of EACH line
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfBHhTwfNGgSwn_Rs5i8%2B0BWO0ceHWfREE3qcywv2rG8w%40mail.gmail.com.
I have tried <br> and escaped and not escaped HTML and <body> … </body> around my build-log-regex and I get this:
***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_HITCOUNTTEST ***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_ATOMCENTER ***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_STRINGRESULT
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfBHhTwfNGgSwn_Rs5i8%2B0BWO0ceHWfREE3qcywv2rG8w%40mail.gmail.com.
The complete source of the email is:
meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
font-size:11px;
color:black;
}
h1 { color:black; }
h2 { color:black; }
h3 { color:black; }
TD.bg1 { color:white; background-color:#0000C0; font-size:120% }
TD.bg2 { color:white; background-color:#4040FF; font-size:110% }
TD.bg3 { color:white; background-color:#8080FF; }
TD.test_passed { color:blue; }
TD.test_failed { color:red; }
TD.console { font-family:Courier New; }
</style>
<body>
<table>
<tr><td align="right"><img src="http://XXXXXXXX/static/e59dfe28/images/32x32/yellow.gif">
</td><td valign="center"><b style="font-size: 200%;">BUILD UNSTABLE</b></td></tr>
<tr><td>Build URL</td><td><a href="http://XXXXXXXX/job/Build-Run-CommonCS-Tests-Win/13/">http://XXXXXXXX/job/Build-Run-CommonCS-Tests-Win/13/</a></td></tr>
<tr><td>Build Log</td><td><a href="http://XXXXXXXX/job/Build-Run-CommonCS-Tests-Win/13/console">http://XXXXXXXX/job/Build-Run-CommonCS-Tests-Win/13/console</a></td></tr>
<tr><td>Project:</td><td>Build-Run-CommonCS-Tests-Win</td></tr>
<tr><td>Date of build:</td><td>Fri, 10 Jun 2016 13:05:06 -0400</td></tr>
<tr><td>Build duration:</td><td>30 min</td></tr>
<tr><td>Stream:</td><td>null</td></tr>
<tr><td>Build Number:</td><td>13</td></tr>
<tr><td>Build Type:</td><td>null</td></tr>
</table>
<br>
<!-- CHANGE SET -->
<table width="100%">
<tr><td class="bg1" colspan="2"><b>CHANGES</b></td></tr>
<tr><td colspan="2">No Changes</td></tr>
</table>
<br>
<!-- ARTIFACTS -->
<!-- MAVEN ARTIFACTS -->
<!-- JUnit TEMPLATE -->
</table>
<br>
<!-- CONSOLE OUTPUT -->
</body>
<body>
***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_HITCOUNTTEST
***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_ATOMCENTER
***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_STRINGRESULT
</body>
From: Ginga, Dick
Sent: Friday, June 10, 2016 1:57 PM
To: jenkins...@googlegroups.com
Subject: RE: tidying up Ext-email output
I have tried <br> and escaped and not escaped HTML and <body> … </body> around my build-log-regex and I get this:
***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_HITCOUNTTEST ***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_ATOMCENTER ***<br> FAIL: LTU_FUNC_TEST.LIBCFSEARCH_STRINGRESULT
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfBHhTwfNGgSwn_Rs5i8%2B0BWO0ceHWfREE3qcywv2rG8w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D8711F14%40AMERMBX02.PERKINELMER.NET.
I don’t know what you consider large, but it all looks more or less like this:
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: m_at [0] != kccNoAb && m_at [0] < m_at [1] && m_at [1] < m_at [2] && (m_at [2] < m_at [3] || m_at [3] == kccNoAb) at line: 210, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libcc\src\cc_stereo.cpp
13:08:49 *** Value of: (int)queryHitSet.NumHits() | Actual: 17 | Expected: numExpected | Which is: 1 | Hit count failed for: test1.cdxml
13:08:49 *** Value of: (int)queryHitSet2.NumHits() | Actual: 17 | Expected: numExpected | Which is: 1 | Hit count2 failed for: test1.cdxml
13:08:49 *** FAIL: LTU_FUNC_TEST.LIBCFSEARCH_HITCOUNTTEST
13:08:49 *** Starting test LTU_FUNC_TEST.LIBCFSEARCH_ATOMCENTER
13:08:49 CORE CHEM ERROR: m_fQuery || sopts.FullStruct() at line: 420, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libcc\src\cc_screens.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
13:08:49 CORE CHEM ERROR: CoordsAvail (a1, a2, a3) at line: 815, file: c:\builds\workspace\build-run-commoncs-tests-win\commoncs\libsdg\src\sdg_chains.cpp
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVe3cGdf_RAwO6wDSj5wmdCOKgjGixb_cUaZDEjR0MoDpg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D8711F85%40AMERMBX02.PERKINELMER.NET.
I am using a template for the bulk of the email (attached). The actual Email Default Content field contains (at the moment)
$DEFAULT_CONTENT
<body>
${BUILD_LOG_REGEX, regex="(?i)( FAIL:.*)", escapeHtml=true, substText="<br>$1", showTruncatedLines=false, escapeHtml=true}
</body>
Thanks for your help.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVf0U3QtdyDC_R8Hz5c0Tj%2BeDZa-4gfTNy3Lv7MfW7CqLQ%40mail.gmail.com.
This would create two body elements in the email, not sure how that will affect things.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D87129CA%40AMERMBX02.PERKINELMER.NET.
Well Slide, that was just my most recent attempt at getting the output I desire. I am still getting this as email output (fragment):
CHANGES |
No Changes |
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVeDVRt%2B0gaMaZ_XdMkb%3D29ZJEr0YyJdA5YsPSXo4E0yRw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D8713721%40AMERMBX02.PERKINELMER.NET.
Yes, I did notice that J
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfmE1Jieg-aXDeBF1mfE2mhZCe-%3DYH8H%2Bb06_jpCTy9tw%40mail.gmail.com.
Hey Slide, if you would like to pursue this for academic reasons, feel free, but, we have just changed our tests to produce Junit formatted XML output and now my email looks like this. so I can now get rid of my attempt at capturing console test results.
Thanks a LOT for your help. I mean it.
CHANGES |
No Changes |
JUnit Tests |
Name: (root) Failed: 3 test(s), Passed: 37 test(s), Skipped: 0 test(s), Total: 40 test(s) |
· Failed: LTU_FUNC_TEST.LIBCFSEARCH_ATOMCENTER |
· Failed: LTU_FUNC_TEST.LIBCFSEARCH_HITCOUNTTEST |
· Failed: LTU_FUNC_TEST.LIBCFSEARCH_STRINGRESULT |
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVfmE1Jieg-aXDeBF1mfE2mhZCe-%3DYH8H%2Bb06_jpCTy9tw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D8713AEC%40AMERMBX02.PERKINELMER.NET.
Thanks muchly
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVdqNACQ9jNbE1M5LQGx_%3DsE%3DXCCSovungjewKx%3D_fStFw%40mail.gmail.com.