Skip to content

Commit

Permalink
A little debugging for historical timings
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Dec 5, 2024
1 parent 90eae68 commit 3e1b978
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/analyze-ui-test-times.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ async function analyzeTestTimes() {
console.log('[analyze-test-times] Processing historical results...\n');
const historicalAverages = new Map();
const historicalCounts = new Map();
const variablesTimings = new Set();
const jobACLDisabledTimings = new Set();

// Read each historical result file
console.log('[analyze-test-times] Reading historical results directory...\n');
Expand Down Expand Up @@ -65,6 +67,15 @@ historicalFiles.forEach((file, index) => {
const count = historicalCounts.get(test.name) || 0;
historicalAverages.set(test.name, current + test.duration);
historicalCounts.set(test.name, count + 1);
// Log out all timings for "Acceptance | variables > Job Variables Page: If the user has variable read access, but no variables, the subnav exists but contains only a message"
if (test.name === "Acceptance | variables > Job Variables Page: If the user has variable read access, but no variables, the subnav exists but contains only a message") {
console.log(`[analyze-test-times] Timings for ${test.name}: ${test.timings.join(', ')}`);
variablesTimings.add(test.duration);
}
if (test.name === "Unit | Ability | job: it permits job run when ACLs are disabled") {
console.log(`[analyze-test-times] Timings for ${test.name}: ${test.timings.join(', ')}`);
jobACLDisabledTimings.add(test.duration);
}
});
} else {
console.log(`[analyze-test-times] Skipping ${file} because it has failed tests or invalid format`);
Expand All @@ -86,6 +97,9 @@ if (historicalAverages.size > 0) {
console.log(`- ${name}: ${total}ms total, ${count} samples`);
}
}
// Log out variablesTimings
console.log(`[analyze-test-times] Variables timings: ${Array.from(variablesTimings).join(', ')}`);
console.log(`[analyze-test-times] Job ACL disabled timings: ${Array.from(jobACLDisabledTimings).join(', ')}`);
// Calculate averages and compare
const analysis = {
timestamp: new Date().toISOString(),
Expand Down

0 comments on commit 3e1b978

Please sign in to comment.