vscode-dvc icon indicating copy to clipboard operation
vscode-dvc copied to clipboard

Testing table depth test

Open julieg18 opened this issue 3 years ago • 5 comments

julieg18 avatar Oct 12 '22 17:10 julieg18

Code Climate has analyzed commit f3291c74 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.8% (0.0% change).

View more on Code Climate.

qlty-cloud-legacy[bot] avatar Oct 12 '22 22:10 qlty-cloud-legacy[bot]

One of the problems here is that the test leaves the workspace in an altered state. The config value is left as 0 after the test runs which means subsequent runs will always fail:

image

mattseddon avatar Oct 14 '22 04:10 mattseddon

In the extension integration tests we reset the value after each call: https://github.com/iterative/vscode-dvc/blob/9b458fb52e24eff0b8dace471c13c2db3ed69d05/extension/src/test/suite/extension.test.ts#L47-L48

But could probably use after to remove the config value in this instance:

  after(() => {
    workspace
      .getConfiguration()
      .update(ConfigKey.EXP_TABLE_HEAD_MAX_DEPTH, undefined, false)
  })

mattseddon avatar Oct 14 '22 05:10 mattseddon

One of the problems here is that the test leaves the workspace in an altered state. The config value is left as 0 after the test runs which means subsequent runs will always fail: In the extension integration tests we reset the value after each call: But could probably use after to remove the config value in this instance:

Nice catch! Thanks for the idea on using the after hook! Could this problem be the reason behind the telemetry event being called twice in this test during some of the CI calls? I don't see how, but maybe I'm missing something 🤔

julieg18 avatar Oct 14 '22 13:10 julieg18

One of the problems here is that the test leaves the workspace in an altered state. The config value is left as 0 after the test runs which means subsequent runs will always fail: In the extension integration tests we reset the value after each call: But could probably use after to remove the config value in this instance:

Nice catch! Thanks for the idea on using the after hook! Could this problem be the reason behind the telemetry event being called twice in this test during some of the CI calls? I don't see how, but maybe I'm missing something 🤔

Sometimes when using Mocha the calls can run into each other when the tests are async. I would just test that one of the calls was what you expected it to be.

mattseddon avatar Oct 15 '22 01:10 mattseddon

Looks like this has been replaced by #2621

mattseddon avatar Oct 18 '22 20:10 mattseddon