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

Add number of metrics analyzer #341

Merged
merged 5 commits into from
May 27, 2024
Merged

Add number of metrics analyzer #341

merged 5 commits into from
May 27, 2024

Conversation

timur-harin
Copy link
Contributor

@yegor256
In this PR, I added:

  • Complex Java class to check number of metrics
  • Check that number is equivalent with number of metrics of simple Java class Foo

Now the result of sudo make test TEST=tests/steps/test-measure-file.sh

steps/test-measure-file.sh:
👍🏻 Single file measured correctly
👍🏻 Broken syntax measured and error log created
👍🏻 Complex file measured correctly
👍🏻 Number of metrics matches for simple and complex Java files: 62 metrics

@timur-harin
Copy link
Contributor Author

@yegor256
Please check this important PR for metrics

@yegor256
Copy link
Owner

@timur-harin looks good! However, you broke the structure that we use in all our tests. Don't go outside of the {...} layout and don't make your own error message. Just exit 1 if the test fails. Also, don't modify an existing test, but add your own new test at the bottom.

@timur-harin
Copy link
Contributor Author

@yegor256
But we had to remove expected in this file what I discussed in Issue #282

So you suggest creating another file test-number-of-metrics.sh with the same logic and return everything back in test-measure-file.sh besides analysing the number of metrics?

@yegor256
Copy link
Owner

@timur-harin no need to create a new file. Just take the test-measure-file.sh file, remove the line where we check the number of metrics and commit. Then, add a new test at the bottom of this file -- the test that you created.

@timur-harin
Copy link
Contributor Author

@yegor256
I applied your suggestions:

  • Separate test
  • All inside {}
  • Success message now 👍🏻 Number of metrics matches for simple and complex Java files: 62 metrics

@yegor256 yegor256 merged commit 3e8c8f0 into yegor256:master May 27, 2024
10 checks passed
@yegor256
Copy link
Owner

@timur-harin excellent work, 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.

2 participants