Skip to content

test: add convertAll operation tests (Phase 9)#83

Merged
fank merged 1 commit intomainfrom
test/improve-coverage-phase9
Jan 30, 2026
Merged

test: add convertAll operation tests (Phase 9)#83
fank merged 1 commit intomainfrom
test/improve-coverage-phase9

Conversation

@fank
Copy link
Member

@fank fank commented Jan 30, 2026

Summary

  • Add comprehensive tests for the convertAll function in cmd/ocap-webserver
  • Tests cover successful conversion flow and failed conversion handling

Changes

cmd/ocap-webserver/main_test.go (+129 lines)

Test Purpose
TestConvertAll_WithOperations Tests successful conversion of operations including file creation and status updates
TestConvertAll_WithFailedOperation Tests handling when conversion fails (missing JSON file)

Coverage Improvements

Package Before After
cmd/ocap-webserver 27.1% 33.3%
Overall 48.2% 48.7%

Specific Function Coverage

Function Before After
convertAll 33.3% 93.3%

Test plan

  • All existing tests pass
  • New tests pass
  • Coverage metrics verified

cmd/ocap-webserver/main_test.go (+129 lines):
- TestConvertAll_WithOperations: successful conversion flow
- TestConvertAll_WithFailedOperation: failed conversion handling

Coverage improvements:
- convertAll: 33.3% → 93.3%
- cmd/ocap-webserver: 27.1% → 33.3%
@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/web/cmd/ocap-webserver 33.33% (+6.25%) 👍

Coverage by file

Changed unit test files

  • github.com/OCAP2/web/cmd/ocap-webserver/main_test.go

@fank fank merged commit c4575dc into main Jan 30, 2026
4 checks passed
@fank fank deleted the test/improve-coverage-phase9 branch January 30, 2026 15:17
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.

1 participant