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

Add Test Plans #716

Open
wants to merge 7 commits into
base: master
from
Open

Add Test Plans #716

wants to merge 7 commits into from

Conversation

@yonaskolb
Copy link
Owner

@yonaskolb yonaskolb commented Nov 10, 2019

Adds test plan support
Resolves #684

  • reference test plans in schemes
  • generate test plan references in schemes
  • parsing tests
  • generation tests
  • updates scheme versions
  • remove xctestplan from resources
  • validation errors
  • validation tests
  • ability to define test plans in spec (probably not required) OR:
  • way to update UUID references in test plan files
  • docs

Possible changes:

  • make top level testPlans which are then referenced in schemes, similar to the new projectReferences?
  • ability to choose a default test plan? At the moment the first test plan in a scheme will be the default
  • ability to define test plans in the spec itself? If not we probably need a way to update the UUIDs in existing files in case XcodeGen/XcodeProj ever changes them

static var pathProperties: [PathProperty] {
[
.string("testPlans")

This comment has been minimized.

@yonaskolb

yonaskolb Nov 10, 2019
Author Owner

This file is getting large, gonna split it up

Copy link
Collaborator

@giginet giginet left a comment

LGTM

@@ -194,10 +194,18 @@ public class SchemeGenerator {
let launchVariables = scheme.run.flatMap { $0.environmentVariables.isEmpty ? nil : $0.environmentVariables }
let profileVariables = scheme.profile.flatMap { $0.environmentVariables.isEmpty ? nil : $0.environmentVariables }

var testPlans: [XCScheme.TestPlanReference]?

This comment has been minimized.

@giginet

giginet Nov 10, 2019
Collaborator

You can use let

let testPlanns: [XCScheme.TestPlanReference]? = scheme.test?.testPlans.map { plans in
    return plans.enumerated().map { index, path in
        .init(reference: "container:\(path)", default: index == 0)
    }
}

This comment has been minimized.

@yonaskolb

yonaskolb Nov 10, 2019
Author Owner

Yeah there’s a few ways to do it. The property has to be nil if there are no test plans though, as that’s what XcodeProj expects

This comment has been minimized.

@giginet

giginet Nov 11, 2019
Collaborator

Points of my comment was avoiding using mutable variables as we can.
Type should be [XCScheme.TestPlanReference]? Sorry.

@yonaskolb yonaskolb force-pushed the test_plans branch from cb90212 to 1114a40 Jan 15, 2020
@min
Copy link
Contributor

@min min commented Jan 22, 2020

@yonaskolb any updates on release for this? would love to start migrating to test plans.

@armintelker
Copy link

@armintelker armintelker commented Mar 1, 2020

I really like to use XcodeGen but our project is build up on test plans. Is here any update.

@soffes
Copy link
Contributor

@soffes soffes commented Mar 21, 2020

Really looking forward to this! Thanks for your effort on this feature! <3

@pinda
Copy link
Contributor

@pinda pinda commented Apr 21, 2020

Looking forward to this! Any ETA on when this will become available?

@omares
Copy link

@omares omares commented Apr 24, 2020

hey @yonaskolb / @giginet is there anything one can do to help out finializing this? I would like to give it a try and pick this up.

@omares
Copy link

@omares omares commented Apr 24, 2020

Went ahead and created an up-to-date version of the branch, tried my best to resolve the conflicts, but i really need some hints what the actual code was lacking. :D

Edit 1: Started with the simplest one: Adding documentation

Edit 2: Guess I understand the to-dos now. First up ill add the option to define a default test plan, after that ill try to add spec validation.

@omares omares mentioned this pull request Apr 24, 2020
10 of 11 tasks complete
@omares
Copy link

@omares omares commented Apr 24, 2020

I created a draft PR #846 that contains the default test plan option, validation errors + tests and the updated documentation. It only lacks the uuid update, would love to hear hints on how to tackle that. I would suggest taking further discussions, on how to proceed to the new PR.

@brentleyjones brentleyjones removed their request for review Jan 6, 2021
@popwarfour
Copy link

@popwarfour popwarfour commented Feb 12, 2021

Would love this feature!

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

Successfully merging this pull request may close these issues.

8 participants