Skip to content

(chore): Make neo4j tests skipped for failing ones#54

Merged
kpom-specter merged 1 commit intomainfrom
kpom/neo4j-skips
Apr 1, 2026
Merged

(chore): Make neo4j tests skipped for failing ones#54
kpom-specter merged 1 commit intomainfrom
kpom/neo4j-skips

Conversation

@kpom-specter
Copy link
Copy Markdown
Contributor

@kpom-specter kpom-specter commented Apr 1, 2026

Description

Create a skip system that skips failing tests so we can backlog/resolve them independently.

Resolves: PQE-411

Type of Change

  • Bug fix (a change that fixes an issue)

Testing

  • Integration tests added / updated
  • Manual integration tests run (go test -tags manual_integration ./integration/...)

Checklist

  • Code is formatted
  • All existing tests pass

Summary by CodeRabbit

  • Tests
    • Updated test framework to support driver-specific test skipping with improved granularity.
    • Enhanced test case execution to properly handle and report panics as test failures.
    • Updated multiple test cases with driver compatibility directives for Neo4j and PostgreSQL drivers.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Walkthrough

This PR migrates the test skip mechanism from generic string-based skip fields to driver-scoped skip_drivers string arrays. The test harness now evaluates whether to skip a test by checking if the current driver is contained in the skip list, and adds panic recovery to convert panics into test failures. Test data files are updated accordingly.

Changes

Cohort / File(s) Summary
Test Harness Logic
integration/cypher_test.go
Replaced skip string field checks with skip_drivers array membership checks. Added panic recovery handler that converts panics to test failures. Removed formatCaseSummary helper function.
Test Data—Driver Skip Configuration
integration/testdata/cases/expansion_inline.json, integration/testdata/cases/shortest_paths.json
Added skip_drivers: ["neo4j"] field to 2 test cases to prevent execution under Neo4j driver.
Test Data—Node Filter Cases
integration/testdata/cases/nodes.json
Added skip_drivers: ["neo4j"] field to 3 node filter test cases.
Test Data—Cross-Product Filter Cases
integration/testdata/cases/nodes_inline.json
Migrated 2 cross-product filter cases from generic skip message to skip_drivers: ["pg"].

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit hops through tests with care,
Drivers skip what they don't dare,
Panics caught mid-leap so high,
Now test failures never die! 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: implementing a system to skip failing Neo4j tests. It's clear and specific about which driver tests are being skipped.
Description check ✅ Passed The description follows the template structure with all key sections completed: clear motivation, ticket reference (PQE-411), appropriate type selection (Bug fix), testing methods documented, and all checklist items checked.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 kpom/neo4j-skips

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
integration/cypher_test.go (2)

112-116: Include stack traces in panic recovery output.

Current recovery reports panic value only. Adding stack output will make integration failures much faster to triage.

Proposed patch
 import (
 	"context"
 	"encoding/json"
 	"errors"
 	"fmt"
 	"os"
 	"path/filepath"
+	"runtime/debug"
 	"slices"
 	"testing"
@@
 					defer func() {
 						if r := recover(); r != nil {
-							t.Fatalf("panic: %v", r)
+							t.Fatalf("panic: %v\n%s", r, debug.Stack())
 						}
 					}()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@integration/cypher_test.go` around lines 112 - 116, The panic recovery
currently only logs the recovered value; update the defer recovery block to
include the goroutine stack trace by importing runtime/debug and appending
debug.Stack() to the t.Fatalf message (i.e., keep the recover handling around
the same defer with if r := recover(); r != nil { ... } but call t.Fatalf with
both the panic value and string(debug.Stack())) so failures in the test
(integration/cypher_test.go) show the full stack trace for faster triage.

102-104: Consider logging file-level skips for visibility.

Case-level skips are explicit, but file-level skips are currently silent. A lightweight log here would improve run diagnostics.

Proposed patch
 			if slices.Contains(cf.SkipDrivers, driver) {
+				t.Logf("skipping case file for driver %s", driver)
 				continue
 			}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@integration/cypher_test.go` around lines 102 - 104, The file-level skip
branch that checks slices.Contains(cf.SkipDrivers, driver) silently continues;
add a lightweight log before continue to record the file-level skip (e.g., use
t.Logf or the package logger available in the test) indicating which driver was
skipped and why (reference cf.SkipDrivers and driver), so replace the silent
continue with a log statement followed by continue.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@integration/cypher_test.go`:
- Around line 112-116: The panic recovery currently only logs the recovered
value; update the defer recovery block to include the goroutine stack trace by
importing runtime/debug and appending debug.Stack() to the t.Fatalf message
(i.e., keep the recover handling around the same defer with if r := recover(); r
!= nil { ... } but call t.Fatalf with both the panic value and
string(debug.Stack())) so failures in the test (integration/cypher_test.go) show
the full stack trace for faster triage.
- Around line 102-104: The file-level skip branch that checks
slices.Contains(cf.SkipDrivers, driver) silently continues; add a lightweight
log before continue to record the file-level skip (e.g., use t.Logf or the
package logger available in the test) indicating which driver was skipped and
why (reference cf.SkipDrivers and driver), so replace the silent continue with a
log statement followed by continue.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8640b50c-4022-4ae1-8cf0-82ee59a84d49

📥 Commits

Reviewing files that changed from the base of the PR and between f289bda and 67e3174.

📒 Files selected for processing (5)
  • integration/cypher_test.go
  • integration/testdata/cases/expansion_inline.json
  • integration/testdata/cases/nodes.json
  • integration/testdata/cases/nodes_inline.json
  • integration/testdata/cases/shortest_paths.json

@kpom-specter kpom-specter merged commit 817cd6b into main Apr 1, 2026
2 checks passed
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.

3 participants