-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Remove skips from all tests #279
Conversation
In other languages, we do comment out the skips. The same way we comment out the bats ones as we are working through the exercises. Some folks use On the plus side, the tests are not ordered randomly, so they always run in order, so aren't hard to |
This Pull Request, if approved, would be missing the changes required in the instructions for the exercises where it states:
This is included, I believe, in every exercise as delivered. |
Removed those, and becoming hesitant now. Here's the number of lines of output for each test, if running the tests now with no modification (in track order): 4 hello-world
10 two-fer
16 error-handling
55 raindrops
25 hamming
19 acronym
25 armstrong-numbers
31 pangram
79 bob
34 scrabble-score
34 grains
16 reverse-string
28 difference-of-squares
25 leap
28 rna-transcription
37 anagram
19 collatz-conjecture
16 nucleotide-count
43 phone-number
52 triangle
34 word-count
16 gigasecond
43 luhn
43 atbash-cipher
58 roman-numerals
49 affine-cipher
37 isogram
16 diamond
52 isbn-verifier Maybe the amount of output from raindrops there is overwhelming. So either maybe let's remove the skips from 'scrabble-score' onwards, or just drop this whole idea? |
Does anybody make these tests pass one by one? In my experience it goes something like: 50% test passed > 75% passed > 90% > 100% |
When I personally do exercises as a student, I just remove the ignores right away, or on other tracks run the tests with some test runner flags to run all tests, so as a student I'd personally prefer if this ignore/skip stuff was removed on all tracks. However, I suppose the purpose of this is to not overwhelm students that are completely new to TDD with a massive screen of "failures", and also to get them into the flow of addressing one test case at a time. I can see the value of this as well. |
It would be nice to get input from somebody who sees this as a problem. |
On Golang track the tests are not skipped btw. |
@giner true, but the golang tests don't proceed past the first failure in my experience. Their setup is ideal for TDD. |
@bkhl I agree that the longer tests could he overwhelming to new users. I use tall terminals, so it presents less of a challenge, but users with a standard term height of 25 will face additional challenges. |
Maybe let's put something like this in there for now, mainly for mentor [[ $BATS_RUN_SKIPPED == true ]] || skip Simultaneously, I could try making a pull request to bats instead, to add |
@bkhl That is a clever idea. If that line is present I think it should be explained in the readme, or even in a comment at the head of the exercises (even if mostly for mentors' convenience). We should also test it against myriad workarounds that people are currently using, and we should ensure that this doesn't create odd behaviors for existing users. If you are willing to do the leg work on this then I am willing to approve and merge with another maintainer's approval. If you are willing to make PR's to bats, then I think that is the most ideal long game solution to this problem. If you get a PR going over there and it seems like it is well received, then I would suggest not merging this PR. That way we wouldn't have to revert on our end after the bats PR is merged. If they wont accept the PR, or if it will take unnecessarily long to merge, then I think merging this PR is reasonable. Thank you for your hard work! |
I would also make changes to bin/validate_exercises to reflect the way that students/mentors should skip the tests as well. Right now it does reflect the "sed" way of commenting the skips at once, simulating how we suggest students to skip them over time. |
I have opened an issue on the bats repo about a noskip option. I quick glance at the source makes this look pretty easy to implement over there. |
These skips are to many an annoyance when using bats, since it doesn't have any command line flag to ignore skipped tests. By setting the environment variable $BATS_RUN_SKIPPED to `true`, you can now get bats to run all tests for the exercise. Also, moved instructive comment in test file for gigasecond to two-fer. This seems to fit better here than in gigasecond, since this is the first exercise on the track with skips.
So this is now mergeable in my opinion, but if we can get a noskip flag in bats itself I still think that is preferable. I appreciate your work on this @bkhl , and I don't want you to feel like it was all for naught. My suggestion is that we first proceed with a PR to the bats repo. I will have some time to work on that today, or I am willing to let someone else take a stab (or work together with someone else on the PR). I think we can get a functional PR to bats today, and then if their maintainers don't respond by tomorrow afternoon or so I am willing to merge this PR as a quick interim patch. @bkhl I appreciate the ingenuity of your work on this, and I think this workaround could teach important lessons to students using it. I am simultaneously concerned that it could be confusing to newer students. Out of respect for your efforts I would very much like your opinion on the plan I outlined above. If it is to your liking, then we can plan to proceed. If it is not, then please feel free to provide your opinions and counter strategies😀 |
I'm hacking away at a PR to However, personally I've been using |
I went ahead and made sstephenson/bats#265 now (some Travis test is failing and needs looking at though). However, as I said don't think we should wait around for that, so happy to see this merged. |
I just switched over to a macbook at work. Homebrew has recipes for both bats (https://github.com/sstephenson/bats) as well as bats-core (https://github.com/bats-core/bats-core). It seems neither is particularly active: they both have dozens of open pull requests. I wonder if it's worth an exercism-specific fork? |
I am too, at least. I am not sure that this or the sed equivalent is more or less confusing. Before the written instructions had a comment about commenting out skips. Now we have a longer line to comment out. And the bin/valid_tests.sh file should still work, but it works on the premise that the skips were commented, regardless of the environment variable set for that command. This leads to a bit of confusion, like should I use the environment variable or should I comment the skips? What if I comment the skips, or some of them, and decide to use the environment variable, then should I edit the skip comments to be uncommented? Teaching a little bit of sed (and storing the command as a convenient tool) may be a solution that supports the bash ideology as well. I like the idea of being able to set the environment variable to disable them all, but again, using sed to comment them out... once the skip is commented, I don't have to remember to comment them again or set that environment variable. |
@bkhl I just realized that once this is resolved (hopefully on bats' end) we will be able to substantially simplify our script for testing if example exercises pass the tests. So, thank you very much for your initiative on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, waiting on @bkhl to merge when ready!
Now we probably need to add all of the other exercises that have been ported by glennj, before this PR can be merged, or our track will be inconsistent. |
I've got 16 exercises in my queue. If you folks want to prioritize this PR, I'll rip the skips out on my end. |
I think the removals can be done in this PR... no need to coordinate. (It's programmatic to apply)... we would do a rebase on master and do the needful, right? |
Applied this again on modified tests.
Applied the same change to the exercises added since the last commit. |
So are we wanting to go ahead and merge this? |
Looking back I'm also confused by the trail of conversation here. Just interpreted the last comment from kotp as my original merge request needing to be brought up to date with the added exercises. |
Well, I for one, am happy to see this go through. @bkhl you said before you are happy to let this sit, but I it doesn't look like bats is going respond to your PR. Therefore, I leave it up to you. Whenever you want this merged just give the signal. Side note for the future:I know there had been mention of perhaps forking the bats project, so it would actually be maintained. I am of the opinion that there are multiple deficiencies that cannot be overcome in bats due to the fact that it is written in bash. I love bash, but it is not a fully fledged programming language. Bats is sluggish, and I think performance benchmarking would be unreliable if added. I have started work on a new shell testing program written in rust. Currently it can test any shell that supports the I am not quite ready to put this project on GitHub, but I think I am a couple weeks out. As soon as I push it to GitHub I will let everyone here know about it. I would really appreciate all of your scrutiny and testing. Hopefully, the project will be good enough to supplant FinallyThank you all for indulging me. I am excited about the project, but I imagine (if it is successful and accepted) that it will still be until late this year or sometime next year before it is adopted by the bash track. Therefore, I reiterate my support of moving forward with this PR. Thank you for all of your work @bkhl |
It appears that as of March 18th, the repository to raise issues and commits on would be bats-core/bats-core per sstephenson/bats#150. |
Thanks for the heads up @kotp |
Perhaps @bkhl should submit the PR to that repo then.
Regardless I will let you all know when I release my project in case anyone wants to check it out, or hack a little rust in a PR😀 |
I was just stating that if the exercises keep coming in from @glennj collection of 16 exercises before this is merged in, we should be able to facilitate the changes needed to bring them up to date. |
I would suggest we should merge this in first. I can update my code before submitting for PR. |
These skips are mostly an annoyance when using bats, since it doesn't
have any command line flag to ignore skipped tests.
The output of bats is not that verbose anyway, so generally just running
all the tests from the outset should not overwhelm the student too much.
Reviewer Resources:
Track Policies