-
-
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
add "&&" to ensure "status" is included in test pass/fail #445
add "&&" to ensure "status" is included in test pass/fail #445
Conversation
Assuming you're running bats from https://github.com/sstephenson/bats then test suite should be setting Using your first solution,
|
> BATS_RUN_SKIPPED=true bats error_handling_test.sh
> bats error_handling_test.sh
> bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.
> bats -v
Bats 0.4.0 Environment: mac os, catalina. |
Let's go for a minimal reproduction of the issue.
If you get different results than I get, that should be filed as a |
@IsaacG , same results Please let me know what else I can do. And if decided to close the pr thats fine too. |
You can try and slowly morph test a to match the exercism test, line by line, to figure out which line causes the issue. Start by adding a |
@MichaelDimmitt looks like you're using the unsupported https://github.com/sstephenson/bats -- this repo is known to be buggy and appears to be abandoned. The recommended bats package is https://github.com/bats-core/bats-core as documented in https://exercism.io/tracks/bash/tests I would vote to close this PR: having the tests's check separate allows the more specific error to be shown, instead of "the test failed due to either the status or the output" |
ok, I think I was using brew install bats but I will see if there is an alternate install available. thanks for the input. I will uninstall and try with bats-core 👍 |
Probably would be worthwhile submitting an update/switch to I don't use it myself, but maybe someone here can try to submit a change to https://github.com/Homebrew/homebrew-core/blob/master/Formula/bats.rb ? |
@bkhl, Thanks for the suggestion. I am going to try submitting the suggested pr to homebrew. Will post a link to the pr shortly. |
@bkhl , It looks like homebrew does not want to update this package because bats has also I think they need to manually create an alias. I tried to rewrite the ruby formula to do the following class Bats < BatsCore
end However it errors out with the following, I believe this is because homebrew requires all formulas to extend formula therefore not submitting a pr. |
The project was handed over from the old maintainer to |
Created a discussion on homebrew with the information discussed. |
Summary:
Core excercise number 3: "Error Handling"
Submitting the solution with all tests giving a result of "status code 0"
Two tests should have failed for this excercise:
With the addition of "&&" the test suite is correctly failing.
Happy to make alternative changes if preferred.
Additionally,
let me know if you want me to add this to all of the test suites for the bash track.
Below are images where the mentor spotted the excercise should have had a failing test suite.
Cheers, Michael Dimmitt
Reviewer Resources:
Track Policies