Skip to content

Kotlin for the tests #1389

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

Closed
psh opened this issue Mar 29, 2018 · 3 comments
Closed

Kotlin for the tests #1389

psh opened this issue Mar 29, 2018 · 3 comments

Comments

@psh
Copy link
Collaborator

psh commented Mar 29, 2018

Summary:

It has been our stated strategy that we would evaluate the use of Kotlin by using it for writing tests.

Expected behavior:

New tests would be written using Kotlin & our test coverage would increase.

Observed behavior:

  1. Very few tests seem to be created, whether Java or Kotlin.
  2. We leave the CI build broken & don't actively maintain the test suite
  3. We don't utilize Kotlin (cf Fix Travis build failures due to Nearby tests #1371 - we could have / should have offered guidance that New tests be in Kotlin for the Nearby failures)

Device and Android version:

One thing to note: we should update the version of Kotlin in our project.

Would you like to work on the issue?

I would be happy to Port the entire suite to Kotlin, for sure, including new ones for Nearby but this needs to be a team buy-in ... are we "in" or "out" of the Kotlin game? If we are "in" is there a more effective strategy for adoption?

@misaochan
Copy link
Member

misaochan commented Apr 1, 2018

Agreed that we don't maintain the test suite as much as we should, and apologies on that front. :)

I'm "in" if we can get a good foundation to start with (e.g. the entire test suite ported to Kotlin), and ideally a bit of documentation on how to get started with writing tests in Kotlin (perhaps in the wiki we can give an example of one of the tests in both Kotlin and Java?).

As for whether or not we want to make it a requirement that all new tests should be in Kotlin, I'm undecided about that. For consistency it would indeed be better to do so, but on the other hand this would place a requirement on all core developers to learn Kotlin regardless of whether they like it or not. Personally I would not mind doing so (especially in light of the neverending Oracle vs Google battle ). But we probably want to see what others think about it as well.

@psh
Copy link
Collaborator Author

psh commented Apr 8, 2018

I ran across a blog post from Brian Button (an Agile leader based in the St Louis area) that talks about "Three Degrees of Unit Testing" that might be interesting to the current topic.

https://blog.brianbutton.io/index.php/2018/04/01/the-degrees-of-unit-testing/

I love his comment

Any amount of unit testing, done almost any way, adds value to a code base. Regardless of how and when the tests were written, as long as they are reliable and quick, and prove the code does what we think it does, I’m in favor of them.

@domdomegg
Copy link
Member

Tests are now done in Kotlin, builds are passing, coverage is increasing and there's a nice CI pipeline to alpha releases. Thanks to everyone who helped with this 🎉 🍾

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

3 participants