wilfred-s commented on pull request #186:
URL: 
https://github.com/apache/incubator-yunikorn-core/pull/186#issuecomment-662842959


   I don't think the approach taken to move the tests is correct.
   
   We already have a number of test methods that will allow us to build up 
objects without the need to start a scheduler. It looks like there are just two 
missing: `AddPartitionToCluster` and `AddAppToPartition`. When we add those two 
in the `pkg/cache/cachetestutils.go` we can create the structures we need.
   
   That removes the need to export a number of functions, start the scheduler 
and keeps the changes far smaller.
   
   The test would init simply with:
   ```
        partition, err := cache.CreatePartitionInfo(...)
        app := cache.NewApplicationInfo(...)
        cache.AddAppToPartition(partition, app)
        gClusterInfo = cache.NewClusterInfo() 
        cache.AddPartitionToCluster(gClusterInfo, partition)
   ```
   
   Please have a look at that option.
   Make sure that you run `make test` and `make lint` before you push the 
changes.


----------------------------------------------------------------
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:
[email protected]


Reply via email to