Skip to content

Commit 7b8101c

Browse files
wenyihu6claude
andcommitted
asimview: add sha comparison functionality
Added comprehensive SHA comparison capability to the ASIM viewer tool, enabling side-by-side comparison of test results between different Git commits. Major additions: - New `-sha-compare` flag to enable SHA comparison mode - `sha_compare.go`: Core logic for managing Git operations, test generation, and file comparison - `sha_compare.html`: Interactive web interface for SHA comparison with Plotly charts - File-by-file comparison with visual indicators for identical, different, or SHA-specific files The tool now supports two modes: 1. Regular file viewer (existing functionality) 2. SHA comparison mode (new) - allows users to select two commits, automatically generates test data for both, and provides side-by-side chart comparison Updated BUILD.bazel and .gitignore to support the new comparison workflow and temporary file storage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 6525c6a commit 7b8101c

File tree

6 files changed

+1524
-6
lines changed

6 files changed

+1524
-6
lines changed

pkg/kv/kvserver/asim/tests/cmd/asimview/BUILD.bazel

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
22

33
go_library(
44
name = "asimview_lib",
5-
srcs = ["main.go"],
6-
embedsrcs = ["viewer.html"],
5+
srcs = [
6+
"main.go",
7+
"sha_compare.go",
8+
],
9+
embedsrcs = [
10+
"viewer.html",
11+
"sha_compare.html",
12+
],
713
importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/asim/tests/cmd/asimview",
814
visibility = ["//visibility:private"],
915
deps = [

pkg/kv/kvserver/asim/tests/cmd/asimview/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Interactive web viewer for ASIM test JSON output files with fuzzy search and mul
44

55
## Usage
66

7+
### Regular File Viewer Mode
8+
79
```bash
810
# Default: serves files from repo's testdata/generated directory
911
go run .
@@ -17,6 +19,24 @@ go run . -port 8081
1719

1820
Then open http://localhost:8080 in your browser.
1921

22+
### SHA Comparison Mode
23+
24+
```bash
25+
# Enable SHA comparison mode
26+
go run . -sha-compare
27+
28+
# With custom port
29+
go run . -sha-compare -port 8081
30+
```
31+
32+
Then open http://localhost:8080 in your browser. This mode allows you to:
33+
34+
1. **Generate test data for different Git SHAs**: Enter two commit SHAs and click "Generate Comparison" to run ASIM tests for both commits
35+
2. **Compare results side-by-side**: Select test files to see JSON data plotted side-by-side for visual comparison
36+
3. **Automatic Git workflow**: The tool handles switching between SHAs, running tests, and storing results automatically
37+
38+
**Note**: SHA comparison mode requires a clean Git working directory and will temporarily switch between commits to generate test data.
39+
2040
## Features
2141

2242
- **Fuzzy Search**: Type any part of test name or file name to filter

0 commit comments

Comments
 (0)