You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/02/06 15:21:40 UTC

[GitHub] [pulsar] testfixer opened a new pull request #6247: Make tests more stable by using JSONAssert equals

testfixer opened a new pull request #6247: Make tests more stable by using JSONAssert equals
URL: https://github.com/apache/pulsar/pull/6247
 
 
   <!--
   ### Contribution Checklist
     
     - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number.
       Skip *Issue XYZ* if there is no associated github issue for this pull request.
       Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   `avroSchema.getSchemaInfo().getSchema()`  in `src/test/java/org/apache/pulsar/client/impl/schema/AvroSchemaTest.java` returns a JSON object. `schemaJson` compares with hard-coded JSON String. However, the order of entries in `schemaJson` is not guaranteed so the json results can contain entries in any order.
   
   This PR proposes to use JSONAssert and modify the corresponding json test assertions so that the test is more stable.
   
   ### Motivation
   
   Using JSONAssert and modifying the corresponding json test assertions so that the test is more stable.
   
   ### Modifications
   
   Adding `assertJSONEquals` method and replacing `assertEquals` with it in tests `testNotAllowNullSchema` and `testAllowNullSchema`.
   
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes)
     - The public API: (no)
     - The schema: (don't know)
     - The default values of configurations: ( no)
     - The wire protocol: (no)
     - The rest endpoints: ( no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] merlimat commented on a change in pull request #6247: Make tests more stable by using JSONAssert equals

Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #6247: Make tests more stable by using JSONAssert equals
URL: https://github.com/apache/pulsar/pull/6247#discussion_r375971015
 
 

 ##########
 File path: pulsar-client/pom.xml
 ##########
 @@ -151,6 +151,13 @@
       <version>${project.parent.version}</version>
       <scope>test</scope>
     </dependency>
+
+    <dependency>
+      <groupId>org.skyscreamer</groupId>
+      <artifactId>jsonassert</artifactId>
+      <version>1.5.0</version>
 
 Review comment:
   Versions of dependencies should be defined in the top level pom

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] sijie merged pull request #6247: Make tests more stable by using JSONAssert equals

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #6247: Make tests more stable by using JSONAssert equals
URL: https://github.com/apache/pulsar/pull/6247
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [pulsar] tuteng commented on issue #6247: Make tests more stable by using JSONAssert equals

Posted by GitBox <gi...@apache.org>.
tuteng commented on issue #6247: Make tests more stable by using JSONAssert equals
URL: https://github.com/apache/pulsar/pull/6247#issuecomment-609206778
 
 
   Add label release-2.5.1 due to #6588's dependency 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services