You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by geomacy <gi...@git.apache.org> on 2015/12/08 15:47:55 UTC

[GitHub] incubator-brooklyn pull request: Fix assertions for 'succeeds even...

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 <ge...@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.
---

[GitHub] incubator-brooklyn pull request: Fix assertions for 'succeeds even...

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1094#issuecomment-162913518
  
    You can also indicate it's yaml by starting the block with \`\`\`yaml to get a bit of syntax highlighting:
    
    ```yaml
    location: foo
    services:
    - baz: bar
      
    ```


---
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.
---

[GitHub] incubator-brooklyn pull request: Fix assertions for 'succeeds even...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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.
---

[GitHub] incubator-brooklyn pull request: Fix assertions for 'succeeds even...

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1094#issuecomment-162913223
  
    @geomacy If you add \`\`\` (three backticks) on the lines before and after code blocks they will be formatted
    ```
    like this
    ```


---
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.
---

[GitHub] incubator-brooklyn pull request: Fix assertions for 'succeeds even...

Posted by geomacy <gi...@git.apache.org>.
Github user geomacy commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1094#issuecomment-162971952
  
    Thanks @sjcorbett have updated commit as suggested.


---
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.
---

[GitHub] incubator-brooklyn pull request: Fix assertions for 'succeeds even...

Posted by johnmccabe <gi...@git.apache.org>.
Github user johnmccabe commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1094#issuecomment-162907780
  
    :+1: my positive and negative tests are now working as expected with the timeout in the `Asserts#succeedsEventually` being honoured.


---
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.
---

[GitHub] incubator-brooklyn pull request: Fix assertions for 'succeeds even...

Posted by aledsage <gi...@git.apache.org>.
Github user aledsage commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1094#issuecomment-163157422
  
    Build failure looks unrelated, and an infrastructure thing ("Internal error: java.lang.IllegalStateException: Invalid object ID 19 iota=66").
    
    Note that Sam's comments about formatting yaml refer to the PR description, rather than changes within the code.
    
    Merging.


---
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.
---