Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47975

Add utility methods to LoggerRule for easier testing

    Details

    • Similar Issues:

      Description

      It would be nice for LoggerRule to provide methods so that log contents can easily be checked in tests, i.e.

      assertThat(logRule, recorded(Level.WARN, equalTo("expected log message"))

        Attachments

          Activity

          Hide
          dnusbaum Devin Nusbaum added a comment -

          Here is a PR to introduce utility methods that allow matching a single log record by level, message, and throwable: https://github.com/jenkinsci/jenkins-test-harness/pull/86

          Show
          dnusbaum Devin Nusbaum added a comment - Here is a PR to introduce utility methods that allow matching a single log record by level, message, and throwable: https://github.com/jenkinsci/jenkins-test-harness/pull/86
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/org/jvnet/hudson/test/LoggerRule.java
          src/test/java/org/jvnet/hudson/test/LoggerRuleTest.java
          http://jenkins-ci.org/commit/jenkins-test-harness/deed831b4630142dad6737df3994ba7f2207dd6f
          Log:
          Merge pull request #86 from dwnusbaum/loggerrule-enhancements

          JENKINS-47975 Add utility methods to LoggerRule for matching log entries

          Compare: https://github.com/jenkinsci/jenkins-test-harness/compare/366e912d9dd2...deed831b4630

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jvnet/hudson/test/LoggerRule.java src/test/java/org/jvnet/hudson/test/LoggerRuleTest.java http://jenkins-ci.org/commit/jenkins-test-harness/deed831b4630142dad6737df3994ba7f2207dd6f Log: Merge pull request #86 from dwnusbaum/loggerrule-enhancements JENKINS-47975 Add utility methods to LoggerRule for matching log entries Compare: https://github.com/jenkinsci/jenkins-test-harness/compare/366e912d9dd2...deed831b4630
          Hide
          dnusbaum Devin Nusbaum added a comment -
          Show
          dnusbaum Devin Nusbaum added a comment - Released in jenkins-test-harness:2.32

            People

            • Assignee:
              dnusbaum Devin Nusbaum
              Reporter:
              dnusbaum Devin Nusbaum
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: