-
-
Notifications
You must be signed in to change notification settings - Fork 201
@Ignore all but the first test case? #25
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
Comments
I don't think it would be obvious for some users to then need to modify the tests to remove the ignores. |
That's a good point. We're using this technique on the Java track and we haven't had that problem. That said, we also include a play-by-play intro to Are there other ways we could hint for the practitioner to remove the |
We also use our tests to verify the example implementations pass too, so that would potentially be problematic. I think what you are kinda going for it to try to mimic ping-pong programming, but do you think it really is overwhelming if they see all fail at once? I really like the documentation that was provided in the Java track's tutorial perhaps that could encourage the practitioner to try to tackle one failure at a time? |
That's definitely a part of it, Steve, absolutely: supporting incremental implementation not unlike how ping-pong feels.
Empathy for less-experienced practitioners is at play. Learning to read error output is enough of a challenge when it is just the one error message, let alone a wall of text and 5-20+ errors. For the those who want to jump in the deep end, mass-removing
The heart of a great UX is delighting our user. In this context, it's about keeping their focus on learning their craft and avoiding burning gumption unnecessarily. UX is so important in @kytrinyx's eyes, she's fundraising for it. And I wouldn't worry that our friends are being coddled, they'll have plenty of other experiences to get frustrated by. :) If we have the ability, why wouldn't we make the experience more pleasant?
A little Gradle config does the trick: task copyTestsFilteringIgnores(type: Copy) {
from "src/test/xkotlin"
into "build/gen/test/xkotlin"
filter { line ->
line.contains("@Ignore") ? "" : line
}
}
test.dependsOn(copyTestsFilteringIgnores) alongside a sourceSet definition: test {
kotlin.srcDirs = ["build/gen/test/kotlin"]
} Here's what the build.gradle looks like in the Java track. And this works swimmingly with IntelliJ's Gradle integration. |
Poking around for a different reason I noticed that in the C# track, they use this same scheme and include a helpful note in the annotation: [Test]
public void New_school_has_an_empty_roster()
{
...
}
[Ignore("Remove to run test")]
[Test]
public void Adding_a_student_adds_them_to_the_roster_for_the_given_grade()
{
...
} |
As a fan of Exercism, someone fairly new to programming and very much hooked on the Kotlin track, I'd like to chime in and say that I always @ignore all but the first test when I begin each exercise. It's not a massive annoyance, but I'd favour that being the default behaviour so I don't have to manually do it. |
Thanks for the from-the-trenches feedback, @forty9er. Without objection, @sdavids13, I'll start that PR? |
@sdavids13 In a lot of the other tracks we have a test script that copies the exercise directory to a temporary directory, rewrites the exercise file to remove the ignore/pending/skip directives, and then run the tests. It's a bit ornery, but was deemed worth it to help smooth the experience for people working on solutions. |
@jtigger Sounds good! Could you include the tutorial write-up too? |
@sdavids13 asked:
I'd love to. It's a whole different (and also significant) effort. I'll submit that as a separate PR. |
Addressed by #30 |
When getting going with an exercise, it can be overwhelming to have a full suite failing all at once. JUnit provides the ability to skip tests through the
@Ignore
annotation. If all of the tests — save the first one — were skipped, it becomes far easier to see where to get started.By way of example, here's
hello-world
, as is (removing the Gradle preamble)...And here's what it looks like with all but the first test skipped:
The text was updated successfully, but these errors were encountered: