-
Notifications
You must be signed in to change notification settings - Fork 1
✨ Add minClusterSize to config service #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Code ReviewThis PR adds ✅ Strengths
🔍 Missing Test CoverageCritical gap: No validation tests for The
Secondary gap: No env var test for While 🐛 Potential Issues1. Missing env var cleanup In beforeEach(() => {
delete process.env.VIZZLY_THRESHOLD;
delete process.env.VIZZLY_PORT;
// Missing: delete process.env.VIZZLY_MIN_CLUSTER_SIZE;
});This could cause test pollution if you add env var tests later. 2. Inconsistent source tracking In sources.comparison = 'env';This overwrites the source for the entire 💡 Minor Suggestions1. Config merging test already includes minClusterSize The test at line 352 already uses assert.strictEqual(config.comparison.minClusterSize, 5); // From project configThis clarifies it's testing the merge, not just the value. 2. Consider edge case: minClusterSize = 1 The validation allows 📝 Test Plan ChecklistFrom the PR description, ensure you verify:
🎯 VerdictApprove with changes requested: The core implementation is correct and well-tested, but the validation test gap is significant given the test plan explicitly calls for validation testing. Add the missing validation tests to match the coverage of other config fields, then this is ready to merge. 📋 Recommended AdditionsAdd these tests to it('returns error for non-integer minClusterSize', async () => {
let service = createConfigService({ workingDir: tempDir });
let result = await service.validateConfig({
comparison: { minClusterSize: 3.5 },
});
assert.strictEqual(result.valid, false);
assert.ok(result.errors.some(e => e.includes('minClusterSize')));
});
it('returns error for zero or negative minClusterSize', async () => {
let service = createConfigService({ workingDir: tempDir });
let result = await service.validateConfig({
comparison: { minClusterSize: 0 },
});
assert.strictEqual(result.valid, false);
assert.ok(result.errors.some(e => e.includes('minClusterSize')));
});
it('returns warning for very high minClusterSize', async () => {
let service = createConfigService({ workingDir: tempDir });
let result = await service.validateConfig({
comparison: { minClusterSize: 150 },
});
assert.strictEqual(result.valid, true);
assert.ok(result.warnings.some(w => w.includes('100')));
});And add env var cleanup: beforeEach(() => {
tempDir = createTempDir();
delete process.env.VIZZLY_THRESHOLD;
delete process.env.VIZZLY_MIN_CLUSTER_SIZE;
delete process.env.VIZZLY_PORT;
});
afterEach(() => {
cleanupTempDir(tempDir);
delete process.env.VIZZLY_THRESHOLD;
delete process.env.VIZZLY_MIN_CLUSTER_SIZE;
delete process.env.VIZZLY_PORT;
delete process.env.VIZZLY_HOME;
}); |
**Issue #158 - TDD still-failing screenshots aren't updated:** Added `_upsertComparison()` helper that replaces existing comparisons by ID instead of always appending. This fixes the bug where re-running tests in TDD daemon mode would accumulate stale comparison results, causing fixed screenshots to still appear as failures. **Issue #160 - minClusterSize not sent to cloud API:** Added `minClusterSize` to the `runOptions` object in the run command. The setting was already loaded from config but wasn't being passed through to the API payload builder.
- Add tests for _upsertComparison() method verifying deduplication - Add test for daemon mode stale result prevention - Add test verifying minClusterSize is passed from config to runOptions - Remove unnecessary this._upsertComparison.bind() call
- Add minClusterSize: 2 to DEFAULT_CONFIG.comparison - Add VIZZLY_MIN_CLUSTER_SIZE environment variable support - Add validation for minClusterSize (must be positive integer) This completes the CLI side of the minClusterSize settings cascade.
05ed804 to
ecf9578
Compare
- Add minClusterSize cleanup to beforeEach/afterEach hooks - Add validation tests: non-integer, zero/negative, very high, valid - Add env var override tests: VIZZLY_MIN_CLUSTER_SIZE
ecf9578 to
a6800bc
Compare
Summary
Adds
minClusterSizesupport to the CLI config service, completing the CLI side of the settings cascade.Changes
minClusterSize: 2toDEFAULT_CONFIG.comparisonVIZZLY_MIN_CLUSTER_SIZEenvironment variable supportRelated
This works with vizzly-testing/vizzly#180 to complete the full settings cascade:
Test plan
VIZZLY_MIN_CLUSTER_SIZEenv var override