Skip to content

Conversation

@fank
Copy link
Member

@fank fank commented Jan 30, 2026

Summary

  • Add tests for previously uncovered functions in the storage package
  • Storage package coverage increased from 62.0% to 88.5%
  • Overall coverage increased from 36.9% to 43.8%

Changes

json_test.go

  • TestJSONEngineGetManifestReader: Verify GetManifestReader returns error (not supported)

protobuf_test.go

  • TestProtobufEngineGetManifestReader: Verify GetManifestReader returns raw file content
  • TestProtobufEngineGetManifestReaderMissingFile: Verify error on missing file

flatbuffers_test.go

  • TestFlatBuffersEngineGetManifestReader: Verify GetManifestReader returns raw file content
  • TestFlatBuffersEngineGetManifestReaderMissingFile: Verify error on missing file
  • TestFlatBuffersEngineConvert: End-to-end test converting JSON to FlatBuffers format
  • TestFlatBuffersEngineConvertMissingFile: Verify error on missing input file
  • TestPbEntityTypeToString: Test protobuf entity type to string conversion
  • TestPbSideToString: Test protobuf side to string conversion
  • TestPbManifestToStorageManifest: Test full manifest conversion with entities and events
  • TestPbManifestToStorageManifestEmpty: Test conversion of empty manifest

Test plan

  • All existing tests pass
  • All new tests pass
  • Coverage verified with go test -cover ./internal/storage/...

Add tests for previously uncovered functions in the storage package:

- json_test.go: Add TestJSONEngineGetManifestReader
- protobuf_test.go: Add TestProtobufEngineGetManifestReader and
  TestProtobufEngineGetManifestReaderMissingFile
- flatbuffers_test.go: Add comprehensive tests for:
  - GetManifestReader (success and missing file cases)
  - Convert (end-to-end JSON to FlatBuffers conversion)
  - pbEntityTypeToString and pbSideToString helper functions
  - pbManifestToStorageManifest conversion function

Storage package coverage increased from 62.0% to 88.5%.
Overall coverage increased from 36.9% to 43.8%.
@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/OCAP2/web/internal/storage 88.45% (+26.47%) 🌟

Coverage by file

Changed unit test files

  • github.com/OCAP2/web/internal/storage/flatbuffers_test.go
  • github.com/OCAP2/web/internal/storage/json_test.go
  • github.com/OCAP2/web/internal/storage/protobuf_test.go

@fank fank merged commit db05ad4 into main Jan 30, 2026
4 checks passed
@fank fank deleted the test/improve-coverage-phase3 branch January 30, 2026 14:39
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