Skip to content
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

test(presence): Add snapshot tests for submitted signals #23048

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

tylerbutler
Copy link
Member

Adds a mock ephemeral runtime that snapshots each signal submitted through it. The idea is to use these snapshots to verify the correct signals are submitted in the correct order.

@github-actions github-actions bot added area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct dependencies Pull requests that update a dependency file base: main PRs targeted against main branch labels Nov 11, 2024
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 suggestions.

Files not reviewed (2)
  • packages/framework/presence/package.json: Language not supported
  • packages/framework/presence/src/test/snapshots/notificationsManager.vitest.ts.snap: Language not supported
Comments skipped due to low confidence (2)

packages/framework/presence/src/notificationsManager.ts:182

  • The use of 'any' for 'eventName' might introduce unintended behavior. Ensure that the types are consistent and consider resolving the typing issues without using 'any'.
const eventName: any = value.value.name;

packages/framework/presence/src/notificationsManager.ts:183

  • The use of 'Parameters<NotificationSubscriptions[any]>' for 'eventArgs' might introduce unintended behavior. Ensure that the types are consistent and consider resolving the typing issues without using 'any'.
const eventArgs = value.value.args as Parameters<NotificationSubscriptions<T>[any]>;

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

// @ts-expect-error TODO
createEmitter<NotificationSubscriptions<T>>();

// @ts-expect-error TODO
Copy link
Preview

Copilot AI Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '@ts-expect-error' comment indicates a suppressed typing error. Investigate if this typing error can be resolved properly instead of being suppressed.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
// @ts-expect-error TODO
createEmitter<NotificationSubscriptions<T>>();

// @ts-expect-error TODO
Copy link
Preview

Copilot AI Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '@ts-expect-error' comment indicates a suppressed typing error. Investigate if this typing error can be resolved properly instead of being suppressed.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
// @ts-expect-error TODO
createEmitter<NotificationSubscriptions<T>>();

// @ts-expect-error TODO
Copy link
Preview

Copilot AI Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '@ts-expect-error' comment indicates a suppressed typing error. Investigate if this typing error can be resolved properly instead of being suppressed.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link
Collaborator

@msfluid-bot msfluid-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Coverage Summary

↓ packages.framework.presence.src:
Line Coverage Change: -10.93%    Branch Coverage Change: -55.48%
Metric NameBaseline coveragePR coverageCoverage Diff
Branch Coverage 84.05% 28.57% ↓ -55.48%
Line Coverage 62.58% 51.65% ↓ -10.93%

Baseline commit: 9f60ea3
Baseline build: 305751
Happy Coding!!

Code coverage comparison check failed!!
More Details: Readme

  • Skip This Check!!

What to do if the code coverage check fails:

  • Ideally, add more tests to increase the code coverage for the package(s) whose code-coverage regressed.

  • 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.

  • Unchecking the checkbox and triggering another build should go back to failing the build if a test-coverage regression is detected.

  • You can check which lines are covered or not covered by your tests with these steps:

    • Go to the PR ADO build.
    • Click on the link to see its published artifacts. You will see an artifact named codeCoverageAnalysis, which you can expand to reach to a particular source file's coverage html which will show which lines are covered/not covered by your tests.
    • You can also run different kind of tests locally with :coverage tests commands to find out the coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants