-
Notifications
You must be signed in to change notification settings - Fork 42
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
Implemented test for irloc feature #281
Conversation
@yegor256 please, check this test out |
@zaqbez39me looks very good! However, |
@yegor256 check it out, please. I suppose, it is ready to be merged |
tests/metrics/test-irloc.sh
Outdated
mkdir -p "${LOCAL}/${temp}" | ||
touch "${LOCAL}/${temp}/file.java" | ||
"${LOCAL}/metrics/irloc.sh" "${LOCAL}/${temp}/file.java" "${LOCAL}/${temp}/stdout" | ||
grep "Provided non-git repo" "${LOCAL}/${temp}/stdout" |
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.
@zaqbez39me I think the script should fail here, instead of printing a message to the console
tests/metrics/test-irloc.sh
Outdated
git config user.name 'Foo' | ||
file1="one.java" | ||
"${LOCAL}/metrics/irloc.sh" "./${file1}" "t0" | ||
grep "File does not exist" "t0" # The given file does not exist |
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.
@zaqbez39me same here - the script should fail
tests/metrics/test-irloc.sh
Outdated
file1="one.java" | ||
touch "${file1}" | ||
"${LOCAL}/metrics/irloc.sh" "./${file1}" "t0" | ||
grep "No commits yet in repo" "t0" # There are no commits in repo with given file |
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.
@zaqbez39me this looks like a wrong output. Instead, it should say IRLoC 0
tests/metrics/test-irloc.sh
Outdated
git add "${file1}" | ||
git commit --quiet -m "first file" | ||
"${LOCAL}/metrics/irloc.sh" "./${file1}" "t0" | ||
grep "Zero lines of code in repo" "t0" # There are only empty files committed in the repo |
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.
@zaqbez39me The output should be IRLoC 0
(see how other script print their results)
tests/metrics/test-irloc.sh
Outdated
git add "${file2}" | ||
git commit --quiet -m "second line" | ||
"${LOCAL}/metrics/irloc.sh" "./${file2}" "t2" | ||
grep "irloc 0.5 " "t2" # There are two lines in repo and one for the given file |
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.
@zaqbez39me I think it should be IRLoC
instead of irloc
@yegor256 please check it out. I changed the expected behaviour after your review. |
@yegor256 check it out, removed multiple TODOs referencing one PR |
@zaqbez39me thanks! |
Test for Impact Ratio by Lines of Code (IRLoC) feature in #226