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 custom build/test commands by configuration #87

Open
yhkaplan opened this issue Jul 21, 2018 · 4 comments
Open

Add custom build/test commands by configuration #87

yhkaplan opened this issue Jul 21, 2018 · 4 comments

Comments

@yhkaplan
Copy link
Contributor

Idea/pitch

So I'm not sure how difficult this might be, but what do you think about adding support for customizing test command arguments?

The two main use-cases I thought of are below.

Parallel testing with Xcode 10

set via g:xcodetest_arguments
https://medium.com/xcblog/wwdc18-xcode-10-in-action-f56e14c62d79

$ xcodebuild -project Xcode10-Demo.xcodeproj/ -scheme Xcode10-Demo -destination 'platform=iOS Simulator,OS=12.0,name=iPhone X' clean build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -parallel-testing-worker-count 4

Running specific tests/test suites

https://stackoverflow.com/questions/35166214/running-individual-xctest-ui-unit-test-cases-for-ios-apps-from-the-command-li
set via g:xcodetest_arguments or : Xtest -only-testing:TestBundle/TestSuite/TestCase

xcodebuild test -workspace <path> -scheme <name> -destination <specifier> -only-testing:TestBundle/TestSuite/TestCase
@gfontenot
Copy link
Owner

I'm very on board with this.

I definitely thing the first thing to do would be to open up the ability to pass custom flags to xcodebuild test. I'd tweak the name for consistency to be g:xcode_xcodebuild_test_flags. That would leave us the ability to add flags for the base xcodebuild command down the line. Adding the flags to the Xtest command seems reasonable too, since we're not using arguments there at all yet.

One thought re: the -only-testing command: it'd be amazing if we could somehow integrate with vim-test if it's available. They are already doing a lot of work around finding the test case/module nearest to the cursor, and I actually added support for swift test in that plugin. This has been on my todo list for a long time.

@yhkaplan
Copy link
Contributor Author

Sounds great!

Vim-test integration would also be very nice! My understanding of vim-test is that we could:
a). copy the code from vim-xcode and integrate xcodebuild test support
b). reimplement some features from vim-test
c). integrate vim-xcode into vim-test such that, if a user has vim-xcode installed, he or she could use xcodebuild-based testing in vim-test

It sounds like you prefer option c), which certainly sounds like the best in the long term because maintenance would be easier. I'm guessing that the best way to implement this would be to make a very thin wrapper for vim-xcode in vim-test, but do you have any other approaches in mind?

I'll start implementing the test flags support in vim-xcode when I get the chance this week. This sounds very exciting!

@gfontenot
Copy link
Owner

Yeah, C would be my pick for sure. vim-test has a fantastic architecture that would actually let us ship the runner alongside our plugin, with no code changes on their end. Users would need to add a custom runner in their config, but it should be easy enough to do. I started playing with this last night but didn't get too far. I'll keep picking at it if I can find the time.

@gfontenot
Copy link
Owner

I opened up #88 to cover the vim-test stuff specifically, because I needed a place to record my thoughts on it.

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

No branches or pull requests

2 participants