2

I am using the latest version of TeamCity and I'm trying to get a build to fail if the number of occurrences of the word "Warning:" exceed a certain level.

I am using the new build failure conditions on the build log with a regular expression. I have another quesiton on this on stackoverflow for the actual regex.

https://stackoverflow.com/questions/10393489/regular-expression-to-determine-if-text-has-no-more-than-n-occurrences-of-a-word/10394765#10394765

the actual regex is

(?:\\bWarning:.*?){1000,}

or a modified version to enable single line matching

(?s)(?:\\bWarning:.*?){1000,}

either of these expressions, simply pass all the time.

1
  • 1. "Latest version" does not mean much with time; specify the version. 2. Must the solution be within TeamCity? If not: which operating system? 3. Are there actually more than 1000 matches when it passes? Try with a lower number and do a minimal test case. Commented May 3, 2012 at 8:43

1 Answer 1

1

Problem is that teamcity is not 100% clear about how the regex works.

It only operates on a per-line basis. I needed to check the complete log file. This was ultimately solved by having msbuild output the log file to a separate location and check it using a new build step.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .