MobileNativeFoundation / bluepill

Bluepill is a reliable iOS testing tool that runs UI tests using multiple simulators on a single machine
BSD 2-Clause "Simplified" License
3.18k stars 231 forks source link

Introduce BPSwimlane holding LaneID that keeps the same when reused to fix trace-profile issue. #486

Closed YangSun33 closed 3 years ago

YangSun33 commented 3 years ago

Issue: When a BP is reused, the id increases by 1 automatically, like BP-1 & BP-5. In the trace-profile, the stats will be listed in 2 separated lines, which is not friendly to check.

Logic Changes: Introduce BPSwimlane. Moved all NSTask-related code into BPSwimlane. BPSwimlane is in charge of launching tasks to run test bundles. BPSwimlane holds LaneID which keeps the same when reused, so the logs are in one lane in tracing-profile.

Trace-profile Changes: Logs of reused BPSwimlane are listed in the same line. Thread-name: "BP-[THREAD_ID]" -> "BP Swimlane #[LANE_ID]" Event-name: "bp ([PROCESS_ID])" -> "BP-[THREAD_ID] ([PROCESS_ID])"

ravimandala commented 3 years ago

Awesome feature that is long due. @YangSun33, can you please some screenshots of trace-profile (Eg. visualization from Chrome's chrome://tracing) after this change? I started reviewing the PR and request @ob to also review this. \cc @chenxiao0228

YangSun33 commented 3 years ago

Hey @ravimandala , I've uploaded the screenshot. I ran BPSampleAppTests with my changes. So mainly 2 parts changed in trace-profile (as I marked in the screenshot):

  1. On the left side, names of lanes have changed to be "BP Swimlane #[LANE_ID]"
  2. On the center part, names of simulators have changed to be "BP-[THREAD_ID] ([PROCESS_ID])"

Thanks for reviewing!

Screen Shot 2021-04-27 at 22 35 08