marathon icon indicating copy to clipboard operation
marathon copied to clipboard

Remove dependency on source code in iOS vendor

Open alex-apriamashvili opened this issue 5 years ago • 0 comments

Problem

At the moment, the implementation of the IOSTestParser implies source code to be persisted on the same machine the marathon-cli is running. This might be a problem in case if one decides to have 'build' and 'test' stages performed on separate machines. Assuming that git clone/git pull action is not particularly needed, as all artifacts could be propagated from the machine that had done the compilation, it makes having source code on the machine that does testing pretty much redundant, hence the logic inside the IOSTestParser. On top of that executing grep command upon every launch of marathon-cli might not be the best option.

Suggested solution

The suggestion is to have a possibility to provide a custom (full) list of tests that could be executed upon testing. This could be achieved by adding a parameter called testSuiteListPath to the vendorConfiguration in Marathonfile.

Proposed Marathonfile structure:

  1. Source Root parameter:
vendorConfiguration:
  type: "iOS"
  sourceRoot: "/Users/user/Developer/ios-project/src/"
  ...
  1. Path To Test Suits parameter:
vendorConfiguration:
  type: "iOS"
  testSuiteListPath: "./TestSuits"
  ...

The priority of the testSuiteListPath parameter shall be higher than of sourceRoot one, to avoid unnecessary grep'ings.

Proposed TestSuits file structure:

The testSuiteListPath field would identify a path to the YAML file containing a list of tests in the following format:

---
-
  method: testMagicButtonTap
  case: UITestCaseClassInTargetA
  suite: UITestTargetA
-
  method: testScrollViewScroll
  case: UITestCaseClassInTargetA
  suite: UITestTargetA
-
  method: testTextfieldInput
  case: UITestCaseClassInTargetB
  suite: UITestTargetB
-
  method: testMagicButtonTap
  case: UITestCaseClassInTargetC
  suite: UITestTargetC

where:

  • suite represents a test target (.xctest file blueprint),
  • case represents a class in that target (XCTestCase descendant)
  • method a particular test function in that class

Value

This change will help to make the configuration more flexible for iOS and minimize the number of redundant operations upon testing, that could eventually reduce the time spent on UI test run.

P.S. I don't mind including this change in my TODO list.

alex-apriamashvili avatar Aug 28 '19 07:08 alex-apriamashvili