Skip to content

Improve test infrastructure: restructure shared traits, unit tests, and JMF rules #78

@miroslavpojer

Description

@miroslavpojer

Feature Description

Three housekeeping improvements to the test infrastructure:

  1. Move DBTestingConnection (and new MockResultSets) from testing/classes/ to the root test package so the test tree mirrors src/main.
  2. Migrate .github/copilot-instructions.md from Python to Scala — correct tooling, add JMF criteria, add Repo additions.
  3. Add project-specific JMF rules for deprecated delegates, factory wrappers, label-overloads, and trivial accessors.

Problem / Opportunity

testing/classes/ has no main-tree counterpart. JMF flags trivially untestable methods as coverage gaps. Copilot instructions reference the wrong language and tools.

Acceptance Criteria

  1. testing/classes/ is deleted; imports updated to za.co.absa.db.balta.
  2. QueryResult has its own unit and integration test files; its tests are not in QueryResultRowIntegrationTests.
  3. MockResultSets exposes emptyMockResultSet, singleRowMockResultSet, twoRowMockResultSet, mockResultSetWithCols(n).
  4. Every new JMF rule has a one-line comment; none covers a method with branching logic.
  5. sbt "testOnly *UnitTests" passes without a DB.

Proposed Solution

All changes are in branch feature/improve-jmf-rules-by-adding-unit-tests:

  • Relocate DBTestingConnection.scala and new MockResultSets.scala to balta/src/test/scala/za/co/absa/db/balta/
  • Add QueryResultUnitTests.scala (10 tests, no DB) and QueryResultIntegrationTests.scala (split from QueryResultRowIntegrationTests)
  • Add 9 project-specific rules to jmf-rules.txt under # PROJECT RULES
  • Rewrite .github/copilot-instructions.md and .github/copilot-review-rules.md for Scala/sbt

Dependencies / Related

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

🆕 To groom

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions