Skip to content

Commit

Permalink
Add code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Clue committed Nov 21, 2023
1 parent 85ac89a commit 5a6072f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions client/components/TestQueueRow/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,9 @@ const TestQueueRow = ({
'completed'
].join('-');

const completedAllTests = !testPlanReport.draftTestPlanRuns.find(
const completedAllTests = testPlanReport.draftTestPlanRuns.every(
testPlanRun =>
testPlanRun.testResultsLength !== testPlanReport.runnableTestsLength
testPlanRun.testResultsLength === testPlanReport.runnableTestsLength
);

return (
Expand Down
10 changes: 3 additions & 7 deletions server/migrations/20231031162340-verifyNoSkippedTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,9 @@ module.exports = {
});

for (const data of Object.values(dataById)) {
let isComplete = true;

data.runLengths.forEach(runLength => {
if (runLength !== data.runnableTestsLength) {
isComplete = false;
}
});
const isComplete = data.runLengths.every(
runLength => runLength === data.runnableTestsLength
);
if (!isComplete) {
console.info(`Found incomplete report ${data.id}`); // eslint-disable-line
// Since final test plan reports can
Expand Down
4 changes: 4 additions & 0 deletions server/scripts/populate-test-data/populateFakeTestResults.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ const populateFakeTestResults = async (testPlanRunId, fakeTestResultTypes) => {
index += 1;
}

// The following makes it so that fake tests are made for
// all possible tests that can be completed for any given
// test plan. Therefore, there will be no missing or skipped
// fake tests in the database.
if (testPlanReport.runnableTests.length !== fakeTestResultTypes.length) {
for (let i = index; i < testPlanReport.runnableTests.length; i += 1) {
await getFake({
Expand Down

0 comments on commit 5a6072f

Please sign in to comment.