Skip to content

Conversation

@Kubuxu
Copy link
Contributor

@Kubuxu Kubuxu commented Jul 29, 2025

This PR fixes assertions checks in emulator and re-organises the
validation logic a bit to facilitate testing.

Copilot AI review requested due to automatic review settings July 29, 2025 15:05
@github-project-automation github-project-automation bot moved this to Todo in F3 Jul 29, 2025
@Kubuxu Kubuxu requested review from ZenGround0 and rvagg July 29, 2025 15:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes assertions in the emulator's test framework and reorganizes the validation logic for better testing. The changes primarily focus on improving test error messages and exposing justification validation logic for testing.

  • Improves assertion error messages in the emulator for better debugging
  • Refactors justification validation logic to separate concerns and enable better caching
  • Fixes incorrect justification references in test cases

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
merkle/merkle_test.go Removes t.Parallel() call to fix test execution
gpbft/validator.go Refactors justification validation logic, moves caching logic, and extracts signature validation
gpbft/participant_test.go Updates test names and error message expectations
gpbft/gpbft_test.go Fixes justification references in test cases to use correct values
emulator/driver_assertions.go Enhances assertion error messages and fixes assertion bug
Comments suppressed due to low confidence (1)

emulator/driver_assertions.go:87

  • This line compares justification with itself instead of comparing it with msg.Justification. This was correctly fixed on line 88.
	d.require.True(vote.Eq(msg.Vote.Value))

This PR fixes assertions checks in emulator and re-organises the
validation logic a bit to facilitate testing.

Signed-off-by: Jakub Sztandera <[email protected]>
@codecov
Copy link

codecov bot commented Jul 29, 2025

Codecov Report

❌ Patch coverage is 86.30137% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.58%. Comparing base (993d8f7) to head (154871d).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
gpbft/validator.go 86.66% 5 Missing and 3 partials ⚠️
emulator/driver_assertions.go 84.61% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1043      +/-   ##
==========================================
- Coverage   64.91%   64.58%   -0.33%     
==========================================
  Files          80       81       +1     
  Lines        9733     9894     +161     
==========================================
+ Hits         6318     6390      +72     
- Misses       2914     2978      +64     
- Partials      501      526      +25     
Files with missing lines Coverage Δ
emulator/driver_assertions.go 98.29% <84.61%> (-1.71%) ⬇️
gpbft/validator.go 78.81% <86.66%> (+0.17%) ⬆️

... and 9 files with indirect coverage changes

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

@github-project-automation github-project-automation bot moved this from Todo to In review in F3 Jul 29, 2025
@Kubuxu Kubuxu merged commit 76fff18 into main Jul 30, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in F3 Jul 30, 2025
@Kubuxu Kubuxu deleted the tests/emulator branch July 30, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants