Skip to content

Commit 0edca58

Browse files
feat: add reportDescription method to provide detailed test descriptions in reports (#25)
1 parent 250ea73 commit 0edca58

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

internal/application/domain/report.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,26 @@ func (r *TestReport) reportTitle() string {
7575
return "TEST REPORT"
7676
}
7777

78+
// reportDescription returns a description of the test based on mode
79+
func (r *TestReport) reportDescription() string {
80+
const commonDesc = "This CI runs on a real DAppNode using the same RPC calls a user would make to configure a staker setup: " +
81+
"execution client, consensus client, web3signer, MEV-boost, and relays. " +
82+
"The self-hosted runner is pre-loaded with synced (or near-synced) execution client volumes, enabling fast sync and attestation tests with any client combination. " +
83+
"Consensus clients use checkpoint sync, so no pre-synced volume is required."
84+
85+
if r.Mode.IsSync() {
86+
return commonDesc + "\n\n" +
87+
"**Sync Test:** Verifies that both execution and consensus clients reach a synced state. " +
88+
"This test ensures the staker configuration is valid and clients can synchronize with the network."
89+
}
90+
if r.Mode.IsTest() {
91+
return commonDesc + "\n\n" +
92+
"**Proof of Attestation Test:** After clients sync, this test imports validators into web3signer and waits for them to become live on the beacon chain. " +
93+
"A successful attestation proves the full staker stack is operational end-to-end."
94+
}
95+
return commonDesc
96+
}
97+
7898
// NewTestReport creates a new TestReport from mode + StakerConfig
7999
func NewTestReport(mode RunMode, config StakerConfig) *TestReport {
80100
return &TestReport{
@@ -153,6 +173,10 @@ func (r *TestReport) ToMarkdown() string {
153173
sb.WriteString(fmt.Sprintf("## ❌ %s - FAILED\n\n", r.reportTitle()))
154174
}
155175

176+
// Description section
177+
sb.WriteString(r.reportDescription())
178+
sb.WriteString("\n\n")
179+
156180
// Attestation section (if URLs present)
157181
if r.BeaconchainEpochURL != "" || len(r.BeaconchainValidatorURLs) > 0 {
158182
sb.WriteString("### 📝 Attestation\n\n")
@@ -282,6 +306,18 @@ func (r *TestReport) ToConsoleString() string {
282306
sb.WriteString(fmt.Sprintf("%s - %s\n", r.reportTitle(), status))
283307
sb.WriteString("========================================\n\n")
284308

309+
// Description section
310+
sb.WriteString("DESCRIPTION:\n")
311+
// Wrap description for console (replace markdown bold with plain text)
312+
desc := r.reportDescription()
313+
desc = strings.ReplaceAll(desc, "**", "")
314+
for _, line := range strings.Split(desc, "\n") {
315+
if line != "" {
316+
sb.WriteString(fmt.Sprintf(" %s\n", line))
317+
}
318+
}
319+
sb.WriteString("\n")
320+
285321
// Attestation section (if URLs present)
286322
if r.BeaconchainEpochURL != "" || len(r.BeaconchainValidatorURLs) > 0 {
287323
sb.WriteString("ATTESTATION:\n")

0 commit comments

Comments
 (0)