Skip to content

#8: Improve how asserts with the test function are handled#99

Open
benedeki wants to merge 1 commit into
masterfrom
feature/8-improve-how-asserts-with-the-test-function-are-handled
Open

#8: Improve how asserts with the test function are handled#99
benedeki wants to merge 1 commit into
masterfrom
feature/8-improve-how-asserts-with-the-test-function-are-handled

Conversation

@benedeki

@benedeki benedeki commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
  • by using method afterEach from BeforeAndAfterEach instead of overding the test method the class behavior streamlined considerably
  • added instruction file fore coderabbit review AI

Release Notes

  • Refactored the integration of database connection handling into ScalaTest. Instead of overriding the test method, the transaction is rolled-back/committed in afterEach method inherited from BeforeAndAfterEach; this makes the whole integration seamless for editors and also removed the bug that caused the test code to be executed eagerly too early.

Related

Closes #8
Fixes #98

Summary by CodeRabbit

  • Chores

    • Added standardized automated code review settings, including concise English feedback, enabled checks, path filtering, and chat responses.
    • Configured review automation to skip work-in-progress changes and generated or compiled files.
  • Tests

    • Improved test isolation by finalizing database transactions after each test.
    • Tests now commit or roll back changes consistently based on persistence settings, reducing unintended data carryover between tests.

* by using method `afterEach` from `BeforeAndAfterEach` instead of overding the `test` method the class behavior streamlined considerably
* added instruction file fore coderabbit review AI
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds a complete CodeRabbit configuration and changes DBTestSuite to finalize transactions through Scalatest’s afterEach() lifecycle hook.

Changes

CodeRabbit configuration

Layer / File(s) Summary
CodeRabbit review configuration
.coderabbit.yaml
Configures review language and tone, review behavior, automatic review filters, enabled tools, and chat auto-replies.

Database test lifecycle

Layer / File(s) Summary
Per-test transaction finalization
balta/src/main/scala/za/co/absa/db/balta/DBTestSuite.scala
Adds BeforeAndAfterEach, commits or rolls back after each test based on persistData, and removes the custom test override.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: lsulak

Poem

A rabbit hops through tests at night,
Commits and rollbacks timed just right.
Config flags sparkle, reviews grow clear,
Old test tricks disappear.
“Hop onward!” says the bunny engineer.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The DBTestSuite change uses afterEach and stops immediate test execution, preserving commit/rollback behavior as required by #8 and #98.
Out of Scope Changes check ✅ Passed The added .coderabbit.yaml is in scope because the PR description explicitly mentions adding a CodeRabbit instruction file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title is related to the test-behavior refactor, though it is broader than the main change.
Description check ✅ Passed The description includes release notes and related issues, and it provides overview content even though the Overview heading is implicit.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/8-improve-how-asserts-with-the-test-function-are-handled

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

JaCoCo Coverage Report

Metric (instruction) Coverage Threshold Status
Overall 84.63% 80.0%
Changed Files 55.11% 80.0%
Report Coverage (O/Ch) Threshold (O/Ch) Status (O/Ch)
Report: balta - scala:2.12.18 84.63% / 55.11% 80.0% / 80.0% ✅/❌
File Path Coverage Threshold Status
DBTestSuite.scala 55.11% 60.0%

Run 29908117077 · Event: pull_request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.coderabbit.yaml (1)

31-31: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Avoid excluding all lockfiles from review.

path_filters also affects Git sparse checkout, so !**/*.lock removes tracked dependency lockfiles from CodeRabbit’s review context. If this repository uses authoritative lockfiles, dependency changes may bypass review and security analysis. Remove this broad exclusion or verify that all matching files are generated artifacts. (coderabbit.ai)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.coderabbit.yaml at line 31, Remove the broad !**/*.lock exclusion from the
path_filters configuration in .coderabbit.yaml, or replace it with narrowly
scoped exclusions only for confirmed generated artifacts, so authoritative
dependency lockfiles remain available for review and sparse checkout.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.coderabbit.yaml:
- Line 31: Remove the broad !**/*.lock exclusion from the path_filters
configuration in .coderabbit.yaml, or replace it with narrowly scoped exclusions
only for confirmed generated artifacts, so authoritative dependency lockfiles
remain available for review and sparse checkout.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ae1f09b-c5da-42e4-a521-9f1fcd47bcb5

📥 Commits

Reviewing files that changed from the base of the PR and between b844d3a and cfe1c3d.

📒 Files selected for processing (2)
  • .coderabbit.yaml
  • balta/src/main/scala/za/co/absa/db/balta/DBTestSuite.scala

@lsulak

lsulak commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Only one thing, please consider updating release notes. It's not clear what was the behavior before vs what's now, so it's a bit abstract

Otherwise, thanks for the contribution, I have no other objections :)

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.

Test code is executed immidiatelly Improve how asserts with the test function are handled

2 participants