Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose new Parallelization setting through Tuist #6827

Closed
kelvinharron opened this issue Oct 7, 2024 · 3 comments · Fixed by #7200
Closed

Expose new Parallelization setting through Tuist #6827

kelvinharron opened this issue Oct 7, 2024 · 3 comments · Fixed by #7200

Comments

@kelvinharron
Copy link

What problem or need do you have?

Xcode 16 has introduced a new Parallelization option that Tuist needs to handle through the testingOptions. The Tuist setting for parallelizable incorrectly sets it to Swift Testing Only.

return Project(
    ...
    options: .options(
        automaticSchemesOptions: .enabled(
            targetSchemesGrouping: .notGrouped,
            codeCoverageEnabled: true,
            testingOptions: .parallelizable
        )
    ),

image

Potential solution

The option of parallelizable is represented in Xcode 16 as Swift Testing Only. We should be able to update Tuist to:

  1. Introduce a new testingOption for Swift Testing Only.
  2. Update the testingOption parallelizable to correctly set Enabled (if Possible)

macOS version

15.0.1

Tuist version

4.28.2

Xcode version

16.0

@kelvinharron
Copy link
Author

I created a new project in Xcode 16 with Swift Testing, created a manual .xctestplan, changing values to identify the output (reference below)

{
  "configurations" : [
    {
      "id" : "D65B4193-73E8-4F22-A96F-B200E8D01563",
      "name" : "Test Scheme Action",
      "options" : {

      }
    }
  ],
  "defaultOptions" : {

  },
  "testTargets" : [
    {
      "parallelizable" : false,
      "target" : {
        "containerPath" : "container:TestScheme.xcodeproj",
        "identifier" : "FA7755502CB44F3D00A98F55",
        "name" : "TestSchemeTests"
      }
    }
  ],
  "version" : 1
}

Parallelization off in Xcode ->"parallelizable" : false,
Parallelization on in Xcode ->"parallelizable" : true,
Parallelization Swift Testing Only in Xcode -> no value.

@fortmarek @pepicrft any pointers on how would you work from the TestingOptions enums to mapping this? Keen to give it a go!

@fortmarek
Copy link
Member

fortmarek commented Oct 16, 2024

Hey @kelvinharron 👋

Sorry for taking a bit longer to respond here. I'm aligned with the outlined potential solution (addition of swiftTestingOnly and fix the current behavior).

I'd first focus on fixing the current behavior.

To do that, you should be able to change this line to write false when parallelizable is false instead of default to nil.

When adding the new option for Swift Testing Only, you will need to change the parallelizable boolean to be an enum and propagate the value from ProjectDescription to that same line.

To compare how the value behaves in the pbxprop xml, I recommend:

  • Saving the current state of .xcodeproj
  • Change to a different value
  • Use git diff or xcdiff to compare what has changed

Let me know if you need any other pointers!

@kelvinharron
Copy link
Author

Thank you for the guidance @fortmarek , I've put together a draft PR with your recommended changes. Let me know what I'm missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants