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-utils-recorder] beforeEach recording even when the test is skipped #6284

Closed
willmtemple opened this issue Nov 20, 2019 · 2 comments
Closed
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. test-utils-recorder Label for the issues related to the common recorder
Milestone

Comments

@willmtemple
Copy link
Contributor

If a test is skipped, ideally it would generate no recording. When we were using recorder.ts in the various packages, the recording would be cancelled as soon as it would go to look for a recording and find that it was configured to be skipped, so that was the case.

In the common recorder, however, if a test suite contains setup logic in beforeEach that makes a request, then that request will be recorded (and the recording will be required for playback) even if the test is subsequently skipped, meaning that even skipped tests will require a recording (of only the beforeEach steps).

Example:

describe("A Test Suite", () => {
  beforeEach(async () => {
    recorder = record(this);
    shareName = recorder.getUniqueName("share");
    shareClient = serviceClient.getShareClient(shareName);
    await shareClient.create();
  });

  it("this test will still generate a recording", async () => {
    recorder.skip(undefined, "some reason");
    assert.ok(true);
  });
});
@willmtemple willmtemple added the test-utils-recorder Label for the issues related to the common recorder label Nov 20, 2019
@sadasant sadasant self-assigned this Nov 21, 2019
@HarshaNalluru
Copy link
Member

Documented here #4336

@ramya-rao-a ramya-rao-a added the Client This issue points to a problem in the data-plane of the library. label Jan 29, 2020
@xirzec xirzec added this to the Backlog milestone Jan 29, 2020
@witemple-msft witemple-msft changed the title [common recorder] beforeEach recording with skipped tests [test-utils-recorder] beforeEach recording even when the test is skipped Jul 26, 2021
@HarshaNalluru HarshaNalluru self-assigned this Jun 9, 2022
@HarshaNalluru HarshaNalluru modified the milestones: Backlog, [2022] July Jun 9, 2022
@HarshaNalluru
Copy link
Member

fine with this tradeoff now, nothing left to do here.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. test-utils-recorder Label for the issues related to the common recorder
Projects
None yet
Development

No branches or pull requests

5 participants