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

Use Sourcery to automatically generate LinuxMain.swift with lists of tests #48

Closed
BalestraPatrick opened this issue Oct 7, 2017 · 11 comments

Comments

@BalestraPatrick
Copy link
Owner

BalestraPatrick commented Oct 7, 2017

Seems like this is a nice starting point: https://github.com/nodes-vapor/sourcery-templates

@meghankane
Copy link
Collaborator

I'd like to try to add support for this! :) Would you mind assigning this to me @BalestraPatrick ?

@BalestraPatrick
Copy link
Owner Author

Hey @meghaphone! Just invited you as collaborator, feel free to assign it to yourself 👍

@meghankane meghankane self-assigned this Oct 7, 2017
@meghankane
Copy link
Collaborator

Awesome! Thanks

@BalestraPatrick
Copy link
Owner Author

If anyone is interested in implementing this, it's still not implemented.

@moritzsternemann
Copy link
Collaborator

I'd like to work on this 😄

@moritzsternemann moritzsternemann self-assigned this Oct 10, 2018
@BalestraPatrick
Copy link
Owner Author

Awesome @moritzsternemann, let me know if you need any help!

@moritzsternemann
Copy link
Collaborator

I never used sourcery before but I guess assuming the command line tool is installed, mentioning the process in README and configuring via `.sourcery.yml' is the way to go here.

@moritzsternemann
Copy link
Collaborator

While researching this I just found out that with Swift 4.1 the SwiftPM added a command to generate and update the LinuxMain.swift (swiftlang/swift-package-manager#1485).
I got it to work with some small adjustments to the test case setup and I think this is a better solution than adding another dependency.

When SwiftPM generates the LinuxMain.swift it thinks the TestCase class is a test case itself and fails because that's an invalid test case name. I changed the class to a protocol and adopted it in all test case files.

Let me know what you think about this solution 🙃

@BalestraPatrick
Copy link
Owner Author

@moritzsternemann The problem with that as stated in the SPM PR is that it only works on macOS. Our CI runs on Linux on CircleCI so the LinuxMain wouldn't be generated.

@moritzsternemann
Copy link
Collaborator

moritzsternemann commented Oct 13, 2018

Alright, using sourcery 👌

@kimdv
Copy link
Collaborator

kimdv commented Oct 17, 2018

Now on staging

Fixed in #155

@kimdv kimdv closed this as completed Oct 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants