Skip to content
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

Merged
merged 13 commits into from Apr 26, 2024
Merged

Conversation

zaqbez39me
Copy link
Contributor

Test for Impact Ratio by Lines of Code (IRLoC) feature in #226

@zaqbez39me
Copy link
Contributor Author

@yegor256 please, check this test out

@yegor256
Copy link
Owner

@zaqbez39me looks very good! However, make doesn't pass, see the log above

@zaqbez39me
Copy link
Contributor Author

@yegor256 fixed the test disabling method. Please, check my reasoning about make in #259

@zaqbez39me
Copy link
Contributor Author

@yegor256 check it out, please. I suppose, it is ready to be merged

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"
Copy link
Owner

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

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
Copy link
Owner

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

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
Copy link
Owner

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

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
Copy link
Owner

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)

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
Copy link
Owner

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

@zaqbez39me
Copy link
Contributor Author

@yegor256 please check it out. I changed the expected behaviour after your review.

@zaqbez39me
Copy link
Contributor Author

@yegor256 check it out, removed multiple TODOs referencing one PR

@yegor256 yegor256 merged commit aa0e182 into yegor256:master Apr 26, 2024
9 checks passed
@yegor256
Copy link
Owner

@zaqbez39me thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants