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

testing: update testing API with proposals #207512

Merged
merged 3 commits into from
Mar 14, 2024
Merged

Conversation

connor4312
Copy link
Member

This replaces the test provider with:

  • An addCoverage method on the TestRun. The benefit of this is that
    test data can be provided gradually, even upserted, over a test run
    to provide more live results.
  • A loadDetailedCoverage on the profile which loads coverage details.
    This is the "resolve" handler before.
  • An additional onDidDispose event on the TestRun that extensions can
    use to clear allocated resources.

Note that the the FileCoverage instance given to loadDetailedCoverage
is the same instance provided to addCoverage, so it can be subclassed
to tag in additional detail. The TestRun instance is also the same, so
WeakMaps can be used for associating data with both.

Naming might change over the next week, but there were good feelings
about this structure the API call this morning.

This change has a backwards-compatibility shim, but extensions should
migrate over before our next stable release in ~3 weeks from today.

fyi @jdneo @eleanorjboyd

This replaces the test provider with:

- An `addCoverage` method on the TestRun. The benefit of this is that
  test data can be provided gradually, even upserted, over a test run
	to provide more live results.
- A `loadDetailedCoverage` on the profile which loads coverage details.
  This is the "resolve" handler before.
- An additional onDidDispose event on the TestRun that extensions can
  use to clear allocated resources.

Note that the the `FileCoverage` instance given to `loadDetailedCoverage`
is the same instance provided to `addCoverage`, so it can be subclassed
to tag in additional detail. The `TestRun` instance is also the same, so
`WeakMap`s can be used for associating data with both.

Naming might change over the next week, but there were good feelings
about this structure the API call this morning.

This change has a backwards-compatibility shim, but extensions should
migrate over before our next stable release in ~3 weeks from today.

fyi @jdneo @eleanorjboyd
@connor4312 connor4312 self-assigned this Mar 12, 2024
@connor4312 connor4312 enabled auto-merge (squash) March 12, 2024 21:46
@VSCodeTriageBot VSCodeTriageBot added this to the March 2024 milestone Mar 12, 2024
lszomoru
lszomoru previously approved these changes Mar 12, 2024
@connor4312 connor4312 merged commit d64800f into main Mar 14, 2024
6 checks passed
@connor4312 connor4312 deleted the connor4312/test-coverage-rev branch March 14, 2024 07:10
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants