Skip to content

test(display): split template repo handler tests to match source files - #2171

Merged
TerryHowe merged 1 commit into
oras-project:mainfrom
akshita317:test/split-repo-handler-tests
Sep 18, 2026
Merged

TerryHowe merged 1 commit into
oras-project:mainfrom
akshita317:test/split-repo-handler-tests

Conversation

@akshita317

Copy link
Copy Markdown
Contributor

Follow-up from review of #2164.

Change

template/repo_test.go held the tests for two source files, repo_list.go and repo_tags.go. Every other test file under display/metadata/ pairs 1:1 with its source, so this splits it:

New file Tests
repo_list_test.go TestNewRepoListHandler, TestRepoListHandler_Render, TestRepoListHandler_Render_empty, TestRepoListHandler_Render_invalidTemplate
repo_tags_test.go TestNewRepoTagsHandler, TestRepoTagsHandler_Render, TestRepoTagsHandler_Render_empty, TestRepoTagsHandler_Render_invalidTemplate

repo_test.go is moved to repo_list_test.go (git detects the rename), so history for the list tests is preserved.

Verification

This only moves code; no test body or assertion is changed.

  • go test -list . on the package gives the same 26 test names before and after (diffed)
  • package coverage is unchanged at 85.3%
  • gofmt and go vet are clean

No production code is changed.

template/repo_test.go held the tests for both repo_list.go and repo_tags.go,
while every other test file under display/metadata pairs 1:1 with its
source. Split it into repo_list_test.go and repo_tags_test.go.

repo_test.go is moved to repo_list_test.go so history for the list tests is
kept. No test body or assertion changes: `go test -list .` reports the same
26 tests before and after, and package coverage stays at 85.3%.

Signed-off-by: Akshita <[email protected]>
@codecov

codecov Bot commented Sep 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.74%. Comparing base (d1c4808) to head (8d29b56).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2171      +/-   ##
==========================================
+ Coverage   87.71%   87.74%   +0.03%     
==========================================
  Files         139      139              
  Lines        5689     5689              
==========================================
+ Hits         4990     4992       +2     
+ Misses        419      417       -2     
  Partials      280      280              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TerryHowe TerryHowe 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.

/lgtm

@TerryHowe
TerryHowe merged commit 1cd8618 into oras-project:main Sep 18, 2026
9 checks passed
@TerryHowe

Copy link
Copy Markdown
Member

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