> On June 28, 2016, 8:53 p.m., David McLaughlin wrote: > > config/legacy_untested_classes.txt, line 44 > > <https://reviews.apache.org/r/49334/diff/1/?file=1432053#file1432053line44> > > > > Isn't this a fairly easy class to test? > > Mehrdad Nurolahzade wrote: > I wrote a test for it initially but then I ran into a few problems > interesting problems but then eventually gave up. Seems like many other http > endpoints have remained untested for a similar reason. I can get behind > finding a solution for this testing problem though. > > The ```getTiers()``` call uses ```MessageBodyWriter``` to serialize the > ```Map```. The elements in that map can be ordered randomly (depending on map > implementation) which makes String equality difficult. That was the easier > problem to solve, I used ```LinkedHashMap``` in test fixtures to force > determinstic order of elements in the map. > > Then, I ran into the problem of Jackson ordering ```TierInfo``` > properties in undeterminstic order. That is, a tier can be serialized as > ```"perferred":{"preemptible":false,"revocable":false}``` or > ```"perferred":{"revocable":false,"preemptible":false}```. A quick Google > search suggested that application of @JasonPropertyOrder on ```TierInfo``` > can result in deterministic property serialization order but it did not work > for me (potentially because of mocking but I am not sure). > > Anyways, after burning some time here I decided to give up. Let me know > if you have any suggestion for testing. > > Mehrdad Nurolahzade wrote: > Found a simple solution using GSON. Will update this review board shortly.
Thanks! - David ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/49334/#review139857 ----------------------------------------------------------- On June 28, 2016, 10:04 p.m., Mehrdad Nurolahzade wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/49334/ > ----------------------------------------------------------- > > (Updated June 28, 2016, 10:04 p.m.) > > > Review request for Aurora, David McLaughlin and Maxim Khutornenko. > > > Repository: aurora > > > Description > ------- > > AURORA-1725 Expose tier configurations as a debug page > > > Diffs > ----- > > src/main/java/org/apache/aurora/scheduler/base/TaskTestUtil.java > 4089b79da8079243703eead884e80bcf736f8b29 > src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java > 496cd5590d6042d30e7bd0410a6c40d804c15023 > src/main/java/org/apache/aurora/scheduler/http/Tiers.java PRE-CREATION > src/main/resources/scheduler/assets/index.html > eca27e081950a66b743f79ae7ae3d08e4625d2c8 > src/test/java/org/apache/aurora/scheduler/TierManagerTest.java > 7d9b3330b8c2b7a87b4dc3adfff94e40ef25d294 > src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java > 561b134152113a50ff495cef28d2396b56d02f1c > src/test/java/org/apache/aurora/scheduler/http/TiersTest.java PRE-CREATION > > Diff: https://reviews.apache.org/r/49334/diff/ > > > Testing > ------- > > Comments: > - Logged the work done so far (new ```/tiers``` debug page) to this ticket > and kept AURORA-1710 for modifications to scheduler UI. > - Added comments to AURORA-1710 to clarify the suggested approach for > implementation. > > Testing: > ``` > ./build-support/jenkins/build.sh > ... > > *** OK (All tests passed) *** > > ./src/test/sh/org/apache/aurora/e2e/test_end_to_end.sh > ... > mesos-master start/running, process 18776 > + RETCODE=0 > + restore_netrc > + mv /home/vagrant/.netrc.bak /home/vagrant/.netrc > + true > Connection to 127.0.0.1 closed. > > real 15m5.795s > user 0m1.318s > sys 0m0.533s > ``` > > > Thanks, > > Mehrdad Nurolahzade > >