Skip to content

Commit

Permalink
Pr sugg
Browse files Browse the repository at this point in the history
  • Loading branch information
Jatin Garg authored and Jatin Garg committed Dec 23, 2024
1 parent 9f6c69d commit cd47985
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const codeCoverageComparisonIgnoreList: string[] = [
];

/**
* Type for the code coverage report generated by comparing the baseline and pr code coverage
* Type for the code coverage report generated by comparing the baseline and pr code coverage. We are noting both line and branch coverage
* here but as part of the code coverage comparison check, we are only using branch coverage.
*/
export interface CodeCoverageComparison {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default class ReportCodeCoverageCommand extends BaseCommand<

const summaryFooterOnFailure =
"### What to do if the code coverage check fails:\n" +
"- Ideally, add more tests to increase the code coverage for the package(s) whose code-coverage regressed.\n" +
"- Ideally, add more tests to increase the code coverage for the package(s) whose code-coverage regressed. Currently, we are only checking branch coverage for the code coverage check.\n" +
"- If a regression is causing the build to fail and is due to removal of tests, removal of code with lots of tests or any other valid reason, there is a checkbox further up in this comment that determines if the code coverage check should fail the build or not. You can check the box and trigger the build again. The test coverage analysis will still be done, but it will not fail the build if a regression is detected.\n" +
"- Unchecking the checkbox and triggering another build should go back to failing the build if a test-coverage regression is detected.\n\n" +
"- You can check which lines are covered or not covered by your tests with these steps:\n" +
Expand Down
22 changes: 1 addition & 21 deletions packages/loader/container-loader/src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1721,27 +1721,7 @@ export class Container
if (pendingLocalState?.clientId !== undefined) {
this.protocolHandler.audience.setCurrentClientId(pendingLocalState?.clientId);
}
if (pendingLocalState?.clientId !== undefined) {
this.protocolHandler.audience.setCurrentClientId(pendingLocalState?.clientId);
}
if (pendingLocalState?.clientId !== undefined) {
this.protocolHandler.audience.setCurrentClientId(pendingLocalState?.clientId);
}
if (pendingLocalState?.clientId !== undefined) {
this.protocolHandler.audience.setCurrentClientId(pendingLocalState?.clientId);
}
if (pendingLocalState?.clientId !== undefined) {
this.protocolHandler.audience.setCurrentClientId(pendingLocalState?.clientId);
}
if (pendingLocalState?.clientId !== undefined) {
this.protocolHandler.audience.setCurrentClientId(pendingLocalState?.clientId);
}
if (pendingLocalState?.clientId !== undefined) {
this.protocolHandler.audience.setCurrentClientId(pendingLocalState?.clientId);
}
if (pendingLocalState?.clientId !== undefined) {
this.protocolHandler.audience.setCurrentClientId(pendingLocalState?.clientId);
}

timings.phase3 = performance.now();
const codeDetails = this.getCodeDetailsFromQuorum();
await this.instantiateRuntime(
Expand Down
25 changes: 0 additions & 25 deletions packages/loader/container-loader/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,28 +424,3 @@ export async function getDocumentAttributes(

return attributes;
}

/**
* Just for testing the PR.
*/
export async function getDocumentAttributes1(
storage: Pick<IDocumentStorageService, "readBlob">,
tree: ISnapshotTree | undefined,
): Promise<IDocumentAttributes> {
if (tree === undefined) {
return {
minimumSequenceNumber: 0,
sequenceNumber: 0,
};
}

// Backward compatibility: old docs would have ".attributes" instead of "attributes"
const attributesHash =
".protocol" in tree.trees
? tree.trees[".protocol"].blobs.attributes
: tree.blobs[".attributes"];

const attributes = await readAndParse<IDocumentAttributes>(storage, attributesHash);

return attributes;
}

0 comments on commit cd47985

Please sign in to comment.