Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4b990d5
Refactor: Merge save/load into one file, remove verbose from MCP context
shreyabhagat1 Aug 21, 2025
c1c6756
Remove failing MCP test case
shreyabhagat1 Aug 21, 2025
5f3e986
Created folder structure for e2e test
abhishekanne Aug 21, 2025
ceb7a6e
Fixed the warnings in code
abhishekanne Aug 22, 2025
a192763
Modified the tests features to support multiple features
abhishekanne Aug 22, 2025
27131f1
QCLI Automation for core_session,integration,mcp,model,session_mgmt t…
sayemaanjum0412 Aug 22, 2025
d65314c
Reduce read_response timeout from 20s to 4s
sayemaanjum0412 Aug 22, 2025
6da0041
Refactor: Remove verbose from MCP context and save/load and fixed the…
shreyabhagat1 Aug 22, 2025
571ce1d
Migrated to python script with HTML report generation
abhishekanne Aug 22, 2025
6931157
Add new tests cases test_add_and_remove_mcp_command and test_q_mcp_st…
shreyabhagat1 Aug 25, 2025
021762a
added html template
abhishekanne Aug 26, 2025
0c281dc
Test wise console output
abhishekanne Aug 26, 2025
1ca00cd
Test wise console output for single thread
abhishekanne Aug 26, 2025
4018f06
Move reports to reports folder
abhishekanne Aug 26, 2025
f2b936a
Script updated to support test description
abhishekanne Aug 26, 2025
ebf882b
Added description to agent and usage command tests , add .gitignore
abhishekanne Aug 26, 2025
be73c04
Fixed individual test output
abhishekanne Aug 28, 2025
50e36d6
Removed all regression test cases
abhishekanne Aug 28, 2025
05da0fc
Added descriptions to tests
abhishekanne Aug 28, 2025
5c19540
Modfied system info
abhishekanne Aug 28, 2025
0a68437
Fixed the Suite tital to capitalize
abhishekanne Aug 28, 2025
b669f7b
Clean console output
abhishekanne Aug 29, 2025
14113a4
Removed the tiles from summary section , added table in HTML report
abhishekanne Aug 29, 2025
3c598fb
Added histogram for the test pass fail
abhishekanne Aug 29, 2025
0e354a4
Validate the user input for passed features
abhishekanne Aug 29, 2025
d8336f2
Fixed the summary cards layout
abhishekanne Aug 29, 2025
d9da161
Sending prompts used execute command instead of send prompts
abhishekanne Aug 29, 2025
0408887
Fixed graph hover text label
abhishekanne Aug 29, 2025
3dbbbf6
Added highlights on failed features
abhishekanne Sep 1, 2025
a4e3f2f
QCLI Automation for tools
shreyabhagat1 Sep 1, 2025
0936edd
move common functions from lib to individual test files to fix interm…
sayemaanjum0412 Sep 1, 2025
ae4d39d
add compact new tests and fix chat function for help,clear,ai_prompts…
sayemaanjum0412 Sep 2, 2025
9ee973a
Add new test cases related to tools and fix the warning
shreyabhagat1 Sep 2, 2025
d7fdcf5
Updated help section of script
abhishekanne Sep 3, 2025
4b8722a
Added executng animation while executing cargo command
abhishekanne Sep 3, 2025
f87ff99
Improved quiet mode
abhishekanne Sep 3, 2025
24035aa
Add detail descriptions to 5 test cases related to tools.
shreyabhagat1 Sep 3, 2025
b4b71af
add new tests for editor feature
sayemaanjum0412 Sep 3, 2025
b1ff5f1
Fixed quiet mode
abhishekanne Sep 4, 2025
9552cee
Fixed quiet mode with logs
abhishekanne Sep 4, 2025
55af456
add new tests for editor,compact feature and description for editor ,…
sayemaanjum0412 Sep 4, 2025
9b9ae7f
Fixed order of features
abhishekanne Sep 5, 2025
8f81460
Add Q subcommand support and corresponding tests
shreyabhagat1 Sep 5, 2025
ff47f0d
added new test case for compact feature
sayemaanjum0412 Sep 5, 2025
4bfd154
Improved animation
abhishekanne Sep 8, 2025
7387c6e
Add regression tests for MCP feature
sayemaanjum0412 Sep 8, 2025
f265c84
Modified the report css for code
abhishekanne Sep 9, 2025
e1d7f33
Refactor Q CLI subcommand execution and enhance tests
shreyabhagat1 Sep 9, 2025
8e90c22
Add tests for q settings and q whoami subcommands
sayemaanjum0412 Sep 10, 2025
aeb975b
Add tests for q debug and q inline subcommands
shreyabhagat1 Sep 10, 2025
6e0903e
Refactor test descriptions to use HTML code tags for command formatting
shreyabhagat1 Sep 11, 2025
265366e
Enhance MCP subcommand tests and add q debug build related tests
sayemaanjum0412 Sep 11, 2025
cd74a72
Add help subcommand tests for q inline commands and Add todos command…
shreyabhagat1 Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions e2etests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
qcli_test_summary*.json
qcli_test_summary*.html
59 changes: 30 additions & 29 deletions e2etests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,33 @@ edition = "2021"
expectrl = "0.7"

[features]
default = []
core_session = []
agent = []
context = []
save_load = []
model = []
session_mgmt = []
integration = []
mcp = []
ai_prompts = []
issue_reporting = []
tools=[]
compact=[]
hooks=[]
usage=[]
editor=[]
subscribe=[]

[[test]]
name = "test_help_command"
path = "tests/test_help_command.rs"

[[test]]
name = "test_tools_command"
path = "tests/test_tools_command.rs"

[[test]]
name = "test_ai_prompt"
path = "tests/test_ai_prompt.rs"
core_session = ["help", "quit", "clear"] # Core Session Commands (/help, /quit, /clear)
help = [] # Help Command (/help)
quit = [] # Quit Command (/quit)
clear = [] # Clear Command (/clear)

tools = [] # Tools Command (/tools)
agent = [] # Agent Commands (/agent list, /agent create, etc.)
context = [] # Context Commands (/context show, /context add, etc.)
save_load = [] # Save/Load Commands (/save, /load, help)
model = [] # Model Commands (/model, /model --help)

session_mgmt = ["compact", "usage"] # Session Management Commands (/compact, /usage, help)
compact = [] # Compact Commands
usage = [] # Usage Commands

integration = ["subscribe", "hooks", "editor", "issue_reporting"] # Integration Commands (/subscribe, /hooks, /editor, /issue help)
subscribe = [] # Subscribe Commands
hooks = [] # Hooks Commands
editor = [] # Editor Commands
issue_reporting = [] # Issue Reporting Commands

mcp = [] # MCP Commands (/mcp, /mcp --help)
ai_prompts = [] # AI Prompts ("What is AWS?", "Hello")

q_subcommand = [] # Q SubCommand (q chat, q doctor, q translate)

todos = [] # todos command

regression = [] # Regression Tests
sanity = [] # Sanity Tests - Quick smoke tests for basic functionality
246 changes: 246 additions & 0 deletions e2etests/html_template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Q CLI Test Report</title>
<style>
body {{ font-family: Arial, sans-serif; margin: 20px; background-color: #f5f5f5; }}
.container {{ max-width: 1200px; margin: 0 auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }}
.header {{ text-align: center; margin-bottom: 30px; }}
.summary-card {{ background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0; }}
.summary-content {{ display: flex; gap: 50px; align-items: flex-start; }}
.stats-column {{ flex: 1; }}
.chart-column {{ flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; }}
.legend {{ display: flex; justify-content: center; gap: 20px; margin-top: 10px; }}
.legend-item {{ display: flex; align-items: center; gap: 5px; }}
.legend-color {{ width: 15px; height: 15px; border-radius: 3px; }}
.stats-cards {{ display: flex; gap: 10px; justify-content: center; }}
.stat-card {{ background: white; padding: 8px 12px; border-radius: 4px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.08); min-width: 60px; }}
.stat-card h3 {{ margin: 0 0 4px 0; font-size: 12px; color: #666; letter-spacing: 0.3px; }}
.stat-card .value {{ font-size: 14px; font-weight: bold; margin: 0; }}
.stat-card .success {{ color: #28a745; }}
.stat-card .failure {{ color: #dc3545; }}
.stat-card .neutral {{ color: #007bff; }}
.collapsible {{ background-color: #007bff; color: white; cursor: pointer; padding: 15px; border: none; text-align: left; outline: none; font-size: 16px; border-radius: 5px; margin: 5px 0; width: 100%; }}
.collapsible:hover {{ background-color: #0056b3; }}
.collapsible.active {{ background-color: #0056b3; }}
.collapsible-failed {{ border-left: 4px solid #dc3545; }}
.content {{ padding: 0 18px; display: none; overflow: hidden; background-color: #f1f1f1; border-radius: 0 0 5px 5px; }}
.test-item {{ margin: 10px 0; padding: 10px; background: white; border-radius: 5px; }}
.test-passed {{ border-left: 4px solid #28a745; }}
.test-failed {{ border-left: 4px solid #dc3545; }}
.stdout {{ background: #f8f9fa; padding: 10px; border-radius: 5px; font-family: monospace; font-size: 12px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; }}
.timestamp {{ color: #666; font-size: 14px; }}
code {{ background: #f0f0f0; padding: 2px 4px; border-radius: 3px; font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; font-size: 0.9em; color: #d73a49; }}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>πŸ§ͺ Q CLI E2E Test Report</h1>
<p class="timestamp">Generated: {timestamp}</p>
</div>

<div class="summary-card">
<h2>πŸ“Š Summary</h2>
<div class="chart-column" style="margin-bottom: 30px;">
<canvas id="histogramChart" style="display: block; margin: 0 auto;"></canvas>
<div class="legend">
<div class="legend-item">
<div class="legend-color" style="background-color: #007bff;"></div>
<span>Total Tests</span>
</div>
<div class="legend-item">
<div class="legend-color" style="background-color: #28a745;"></div>
<span>Passed Tests</span>
</div>
</div>
</div>
<div class="summary-content">
<div class="stats-column">
<div class="stats-cards">
<div class="stat-card">
<h3>Features Tested</h3>
<p class="value neutral">{total_features}</p>
</div>
<div class="stat-card">
<h3>Tests Passed</h3>
<p class="value success">{tests_passed}</p>
</div>
<div class="stat-card">
<h3>Tests Failed</h3>
<p class="value failure">{tests_failed}</p>
</div>
</div>
</div>
</div>
</div>

{test_suites_content}

<div class="system-info" style="background: #e9ecef; padding: 15px; border-radius: 5px; margin: 30px 0; text-align: left;">
<h3>πŸ’» System Information</h3>
<p><strong>Platform:</strong> {platform}</p>

<p><strong>Q Binary:</strong> {q_binary_info}</p>
</div>
</div>

<script>
window.onload = function() {{
var canvas = document.getElementById('histogramChart');
if (!canvas) return;

// Make canvas responsive
var container = canvas.parentElement;
canvas.width = container.offsetWidth - 40;
canvas.height = 300;

var ctx = canvas.getContext('2d');
var width = canvas.width;
var height = canvas.height;
var padding = 50;
var chartWidth = width - 2 * padding;
var chartHeight = height - 2 * padding;

// Sample data - this should be replaced with actual feature data
var features = {feature_names};
var totalTests = {feature_total_tests};
var passedTests = {feature_passed_tests};

if (!features || features.length === 0) return;

var maxTests = Math.max(...totalTests);
var barWidth = Math.min(60, chartWidth / (features.length * 2.2));

// Calculate actual chart width and center it
var actualChartWidth = (features.length * 2) * barWidth + barWidth;
var chartStartX = padding + (chartWidth - actualChartWidth) / 2;

ctx.clearRect(0, 0, width, height);

// Draw axes
ctx.strokeStyle = '#333';
ctx.lineWidth = 2;
ctx.beginPath();
ctx.moveTo(chartStartX, padding);
ctx.lineTo(chartStartX, height - padding);
var xAxisEnd = chartStartX + actualChartWidth;
ctx.lineTo(xAxisEnd, height - padding);
ctx.stroke();

// Draw bars
for (var i = 0; i < features.length; i++) {{
var x = chartStartX + (i * 2 + 0.5) * barWidth;

// Total tests bar (blue) - wider
var totalHeight = (totalTests[i] / maxTests) * chartHeight;
ctx.fillStyle = '#007bff';
ctx.fillRect(x, height - padding - totalHeight, barWidth * 0.7, totalHeight);

// Passed tests bar (green) - with gap
var passedHeight = (passedTests[i] / maxTests) * chartHeight;
ctx.fillStyle = '#28a745';
ctx.fillRect(x + barWidth * 0.8, height - padding - passedHeight, barWidth * 0.7, passedHeight);

// Feature labels
ctx.fillStyle = '#333';
ctx.font = '12px Arial';
ctx.textAlign = 'center';
var featureName = features[i].replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
ctx.fillText(featureName, x + barWidth * 0.75, height - padding + 15);
}}

// Y-axis labels
ctx.fillStyle = '#333';
ctx.font = '12px Arial';
ctx.textAlign = 'right';
var steps = Math.max(1, maxTests);
for (var i = 0; i <= steps; i += 2) {{
var y = height - padding - (i / steps) * chartHeight;
ctx.fillText(i, chartStartX - 10, y + 4);
}}

// X-axis label
ctx.fillStyle = '#333';
ctx.font = '14px Arial';
ctx.textAlign = 'center';
var xAxisCenter = (chartStartX + xAxisEnd) / 2;
ctx.fillText('Features', xAxisCenter, height - 5);

// Add hover functionality with tooltip
var tooltip = document.createElement('div');
tooltip.style.position = 'absolute';
tooltip.style.background = 'rgba(0,0,0,0.8)';
tooltip.style.color = 'white';
tooltip.style.padding = '5px 10px';
tooltip.style.borderRadius = '4px';
tooltip.style.fontSize = '12px';
tooltip.style.pointerEvents = 'none';
tooltip.style.display = 'none';
tooltip.style.zIndex = '1000';
document.body.appendChild(tooltip);

canvas.addEventListener('mousemove', function(e) {{
var rect = canvas.getBoundingClientRect();
var mouseX = e.clientX - rect.left;
var mouseY = e.clientY - rect.top;
var found = false;

// Check if mouse is over any bar
for (var i = 0; i < features.length; i++) {{
var x = chartStartX + (i * 2 + 0.5) * barWidth;
var totalHeight = (totalTests[i] / maxTests) * chartHeight;
var passedHeight = (passedTests[i] / maxTests) * chartHeight;

// Check total tests bar
if (mouseX >= x && mouseX <= x + barWidth * 0.7 &&
mouseY >= height - padding - totalHeight && mouseY <= height - padding) {{
var featureName = features[i].replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
tooltip.innerHTML = featureName + ': ' + totalTests[i] + ' total tests';
tooltip.style.left = (e.pageX + 10) + 'px';
tooltip.style.top = (e.pageY - 30) + 'px';
tooltip.style.display = 'block';
found = true;
break;
}}

// Check passed tests bar
if (mouseX >= x + barWidth * 0.8 && mouseX <= x + barWidth * 1.5 &&
mouseY >= height - padding - passedHeight && mouseY <= height - padding) {{
var featureName = features[i].replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
tooltip.innerHTML = featureName + ': ' + passedTests[i] + ' passed tests';
tooltip.style.left = (e.pageX + 10) + 'px';
tooltip.style.top = (e.pageY - 30) + 'px';
tooltip.style.display = 'block';
found = true;
break;
}}
}}

if (!found) {{
tooltip.style.display = 'none';
}}
}});

canvas.addEventListener('mouseleave', function() {{
tooltip.style.display = 'none';
}});
}};

var coll = document.getElementsByClassName("collapsible");
for (var i = 0; i < coll.length; i++) {{
coll[i].addEventListener("click", function() {{
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {{
content.style.display = "none";
}} else {{
content.style.display = "block";
}}
}});
}}
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion e2etests/run_mcp_clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ echo ""

# Run only the specific MCP test files
echo "πŸ”„ Running MCP tests..."
cargo test --test test_mcp_help_command --test test_mcp_loading_command --features "mcp" -- --nocapture --test-threads=1
cargo test --test --features "mcp" -- --nocapture --test-threads=1

exit_code=$?

Expand Down
Loading