Kotlin / kotlin-koans

Kotlin workshop
MIT License
2.6k stars 1.42k forks source link

Provide a better way for command-line users to run the koans #76

Open coproduto opened 7 years ago

coproduto commented 7 years ago

I understand the koans were mostly thought out for IDE users, but I believe there are many people who prefer doing their coding work with just the command line and text editors such as me.

The problem with running the koans using ./gradlew test is that the output is very messy, and you need to sift through it in order to find out if the test you were working on has passed. Of course, you can run the individual test you're working on, but a lot of Kotlin newcomers are also newcomers to Gradle and won't know how to do that.

Most other "koans" projects such as ruby-koans provide a script you can run which will tell you the first koan to fail among all of them and no other information. I find that to be the best way to have koans gently introduce newcomers to a language. It would be nice to have a script like that for kotlin-koans too.

coproduto commented 7 years ago

Update: I'm actually working on a solution for this as a way to stretch my fledgling Kotlin skills. I'll open a pull request as soon as I have something real.

nvlled commented 7 years ago

Not a pure commandline solution, but there is a test result summary in HTML in the build output: build/reports/tests/test/index.html

Edit: You can choose what tests to run by with the --test flag:

$ ./gradlew test --tests i_*          # run tests in part 1
$ ./gradlew test --tests ii_*          # run tests in part 2
$ ./gradlew test --tests ii_*22*          # run test number 22 in part 2
weklund commented 7 years ago

@nvlled Found an issue with a version of Gradle, couldn't run those tests with the flag.

https://issues.gradle.org/browse/GRADLE-3112

The only workaround I found was having Android Studio run the ones I want manually.