Skip to content

add tests for GetLanguageStats handler - #115

Merged
andrewtavis merged 1 commit into
scribe-org:mainfrom
ashb155:test/get-language-stats-handler
Oct 20, 2026
Merged

andrewtavis merged 1 commit into
scribe-org:mainfrom
ashb155:test/get-language-stats-handler

Conversation

@ashb155

@ashb155 ashb155 commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Contributor checklist

  • This pull request is on a separate branch and not the main branch
  • I have ran the ./pre-commit executable as well as make lint and have fixed all reported issues

Description

This PR adds comprehensive unit test coverage for the GET /api/v1/language-stats handler (GetLanguageStats).

Coverage:

  • GetLanguageStats: 0.0% -> 100.0%
  • api/handlers package: 30.7% -> 36.1%
  • Total project coverage: 16.2% -> 17.1%

Related issue

@andrewtavis

Copy link
Copy Markdown
Member

question @DeleMike and @ashb155: Are we planning on setting up a CI check for a minimum code coverage at some point? If so, how would we do that? Is there a fail option for the coverage method we're using? Maybe we can set this up when we're over 25%?

@DeleMike

DeleMike commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Yes, I think a minimum coverage check is a great idea, and I'd suggest adding it sooner rather than later.

We can start small and then extend it later.

Go's coverage tools don't have a fail option: go test -cover only reports. So we can add a small CI step after make test-cover that reads the total test coverage and fails if below a MIN_COVERAGE value.

If we later want per-package thresholds or coverage of new code in PRs, we could switch to the go-test-coverage action or Codecov(Not fully free but could work).

Happy to open an issue and PR for this! Should I open the issue?

@DeleMike DeleMike left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all's good here!

Thanks @ashb155

@andrewtavis

Copy link
Copy Markdown
Member

Happy to open an issue and PR for this! Should I open the issue?

Would be great to get an issue, @DeleMike! I don't think we need per-package thresholds or coverage of new code in PRs. We could even just parse the output and get the coverage for PRs, if need be :) Might be the easiest.

@andrewtavis andrewtavis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: All this is looking great to me as well, @ashb155! Thanks for the great work on the tests! 🚀

@andrewtavis
andrewtavis merged commit 8a1c771 into scribe-org:main Oct 20, 2026
4 checks passed
@DeleMike

Copy link
Copy Markdown
Member

Happy to open an issue and PR for this! Should I open the issue?

Would be great to get an issue, @DeleMike! I don't think we need per-package thresholds or coverage of new code in PRs. We could even just parse the output and get the coverage for PRs, if need be :) Might be the easiest.

Alright, I will open an issue right away!

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.

Add handler tests for GET /api/v1/language-stats

3 participants