brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geomacy <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Fix assertions for 'succeeds even...
Date Tue, 08 Dec 2015 14:47:55 GMT
GitHub user geomacy opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/1094

    Fix assertions for 'succeeds eventually' behaviour.

    The following test case will not work with the code as currently defined:
    
    name: testcase1
    location:
      mylocation
    services:
    - type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
      id: tomcatServer
      timeout: 15m
    - type: org.apache.brooklyn.test.framework.TestCase
      name: TomServTest
      brooklyn.children:
      - type: org.apache.brooklyn.test.framework.TestSensor
        target: $brooklyn:component("tomcatServer")
        sensor: service.isUp
        timeout: 1m
        assert:
        - equals: true
    
    With the two entities (server and test) deployed independently instead of
    within the same test case, the "checkAssertions" code will fail as it collects
    all failures in AssertionSupport, when it should only collect those that
    occur from the "Asserts.succeedsEventually".
    
    Changing this code in this commit to allow tests to work.  The effect will
    be that only one failed assertion will be reported on, even if many
    assertions might fail. We can come back to this in order to see if multiple
    assertion failures may be collected, but this is not necessary now.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/geomacy/incubator-brooklyn assertion-failures

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/1094.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1094
    
----
commit 1e8e374d6ab54e8e1298428f32b720f464660027
Author: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Date:   2015-12-08T14:35:59Z

    Fix assertions for 'succeeds eventually' behaviour.
    
    The following test case will not work with the code as currently defined:
    
    name: testcase1
    location:
      mylocation
    services:
    - type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
      id: tomcatServer
      timeout: 15m
    - type: org.apache.brooklyn.test.framework.TestCase
      name: TomServTest
      brooklyn.children:
      - type: org.apache.brooklyn.test.framework.TestSensor
        target: $brooklyn:component("tomcatServer")
        sensor: service.isUp
        timeout: 1m
        assert:
        - equals: true
    
    With the two entities (server and test) deployed independently instead of
    within the same test case, the "checkAssertions" code will fail as it collects
    all failures in AssertionSupport, when it should only collect those that
    occur from the "Asserts.succeedsEventually".
    
    Changing this code in this commit to allow tests to work.  The effect will
    be that only one failed assertion will be reported on, even if many
    assertions might fail. We can come back to this in order to see if multiple
    assertion failures may be collected, but this is not necessary now.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message