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 attachDebugger parameter to TestAction.testPlans(...) #4425

Conversation

Andrea-Scuderi
Copy link
Contributor

Resolves #4424
Request for comments document (if applies):

Short description 📝

Add attachDebugger parameter to TestAction.testPlans(...)

This will allow to disable the debugger during Unit and UI tests

Scheme(
                name: "\(name)UITests",
                shared: true,
                buildAction:  .buildAction(
                    targets: ["\(name)", "\(name)UITests"]
                ),
                testAction: .testPlans(
                    [.relativeToRoot("TestPlan/\(name)UITests.xctestplan")],
                    configuration: .debug,
                    attachDebugger: false,
                    preActions: [],
                    postActions: []
                )
)

The parameter attachDebugger will be defaulted to true to allow backward compatibility.

Scheme(
                name: "\(name)UITests",
                shared: true,
                buildAction:  .buildAction(
                    targets: ["\(name)", "\(name)UITests"]
                ),
                testAction: .testPlans(
                    [.relativeToRoot("TestPlan/\(name)UITests.xctestplan")],
                    configuration: .debug,
                    preActions: [],
                    postActions: []
                )
)

The previous code will behave as before.

How to test the changes locally 🧐

Include a set of steps for the reviewer to test the changes locally.

A demo project has been provide here

Checklist ✅

  • The code architecture and patterns are consistent with the rest of the codebase.
  • The changes have been tested following the documented guidelines.
  • The PR includes the label changelog:added, changelog:fixed, or changelog:changed, whenever it should be included in the “Added”, “Fixed” or “Changed” section of the CHANGELOG. Note: when included in the CHANGELOG, the title of the PR will be used as entry, please make sure it is clear and suitable.
  • In case the PR introduces changes that affect users, the documentation has been updated.
  • In case the PR introduces changes that affect how the cache artifact is generated starting from the TuistGraph.Target, the Constants.cacheVersion has been updated.

Copy link
Collaborator

@kwridan kwridan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing this @Andrea-Scuderi 🎉

@kwridan
Copy link
Collaborator

kwridan commented May 7, 2022

@allcontributors add @Andrea-Scuderi for code

@allcontributors
Copy link
Contributor

@kwridan

I've put up a pull request to add @Andrea-Scuderi! 🎉

@kwridan kwridan added the changelog:added PR will be listed in the Added section of CHANGELOG label May 7, 2022
@albertodebortoli
Copy link

Thank you very much @Andrea-Scuderi for raising this.
Andrea and I noticed we need this at Just Eat Takeaway.com as we rely on Test Plans and we need to keep "Debug Executable" turned off when running the CI pipelines.

Copy link
Member

@fortmarek fortmarek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this, looks good!

@fortmarek fortmarek merged commit 65c7382 into tuist:main May 8, 2022
@albertodebortoli
Copy link

Hey @fortmarek thank you so much for merging this. We are really interested in this change, can you please give an ETA on when this will be released?

@fortmarek
Copy link
Member

Hey @albertodebortoli, we should make a new release later this week (will try to make it sooner, rather than later 🙌 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:added PR will be listed in the Added section of CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to disable attach debugger when generating TestAction with TestPlan
4 participants