Xcode testing "-only-testing" and "-skip-testing" flags

testing
xcode
#1

Description of the feature request

There are two flags used for testing with xcodebuild: “-only-testing” and “skip-testing”. They describe test suites (aka groups) that need to be tested. So, the scheme can contain many suits, but this flags tell xcodebuild to test only some of them.
It would be great to be able to optionally set one of this flag in “Xcode Test for iOS” workflow step.

Use case / for what or how I would use it

I have a project with a scheme which has two groups on tests (the unit tests and the integration tests). For pull requests into develop I want to run unit-tests and once a day I want to run integration tests (because it’s long to perform and gives additional traffic usage). Also, I do not want to duplicate the scheme.
I want just run xcodebuild tests with a flag “-only-testing:UnitTests” for the first case and “-only-testing:IntTests” for the second one.

0 Likes

#2

Oh’ I’ve got it.
There is no such option in UI, but I can use “Debug” section to add any flags to xcodebuild call!

That’s cool!

BTW, still want this option or a comment about the ability to set it in the debug section at least.

0 Likes

#3

Hi @DlgVladlex!

Thanks for the feature request! Glad to hear you’ve found the option! I’m a bit confused as to what do you mean by

BTW, still want this option or a comment about the ability to set it in the debug section at least.

Do you mean that this should be displayed more clearly somewhere on the step? Can you perhaps explain or edit your request accordingly? :slight_smile:

0 Likes

#4
  1. I would like to see something like this:


    It’s a field with one of three options (the last two requires string list with names of the tests).
    The first one means “perform all tests” (and its value by default). No additional information needed.
    The second one is a filter that means “perform only tests in the list”. User should enter the name of the tests to perform.
    The third one is a filter that means “perform all tests excluding ones from the list”. User should the name of the tests to skip.

  2. As long as the first way is not implemented for any reason it may be useful to extend the description of Step like this:

The way 2 is useful because it’s not so easy to figure out that you can set flags for an xcodebuild call at all.

1 Like