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

Clear test results on test execution? #1060

Open
ladariha opened this issue Sep 1, 2023 · 14 comments · Fixed by #1087
Open

Clear test results on test execution? #1060

ladariha opened this issue Sep 1, 2023 · 14 comments · Fixed by #1087
Labels
external-issue issues caused by external system ( (no fix needed)

Comments

@ladariha
Copy link

ladariha commented Sep 1, 2023

Environment

  1. vscode-jest version: 6.0.1
  2. node -v: 14.17.0
  3. npm -v or yarn --version: yarn 1.22.19
  4. npm ls jest or npm ls react-scripts (if you haven’t ejected): [fill]
  5. your vscode-jest settings if customized:
    • jest.autoRun? off
    • jest.debugMode: true
    • jest.monitorLongRun: off
    • jest.autoClearTerminal: true
    • jest.virtualFolders : [{name: "somename", jestCommandLine: "/home/somePath/node_modules/jest/bin/jest.js --config=... "}]
    • anything else that you think might be relevant? [fill]
  6. Operating system: RHEL 9

Would it be possible to clear previous test results (or make it configurable) when I start new test execution? What I mean is the right column in TEST RESULTS bottom panel. I'd find it much easier to use if the content of the history would be cleared anytime I trigger some tests. So essentially the desired state is to have history of size 1, aka latest test run only

image

@connectdotz
Copy link
Collaborator

This is controlled by vscode testing subsystem, cc @connor4312 for insight.

@connectdotz connectdotz added the external-issue issues caused by external system ( (no fix needed) label Sep 14, 2023
@connor4312
Copy link

We could have a setting for this; if more users request it we could go that direction. An extension could also manually run the testing.clearTestResults command.

@connectdotz
Copy link
Collaborator

@connor4312 good point, we can try testing.clearTestResults upon starting new tests.

One potential issue though: In a multi-root workspace environment, this will mean one run from a given folder will clear out the output from other folders... is there a way to close out the output associated with the specific controllers?

@connor4312
Copy link

That's right--unfortunately no command to clear a specific controller's output.

@ladariha
Copy link
Author

Having it hidden behind some settings would be great :)

Personally I don't really care about history of test runs - in my workflow, I don't really remember what exactly was different (either in application code or test code) in previous test executions so seeing different results brings zero value

@connor4312
Copy link

Yea, I think some testing.historyEnabled would be the right solution here. I would want to see if there's interest from more people here before taking the time to implement it (though I would take a PR)

@ladariha
Copy link
Author

@connor4312 Challenge accepted :) I have the changes ready (I hope) - will do some more testing and prepare PR today :)

@connor4312
Copy link

sounds good 🙂

@ladariha
Copy link
Author

@connor4312 Here's the PR #1071 , hopefully somewhat meaningful - as stated in the PR's description, I did not bumped version in package.json and I kind of "guessed" the version in README.md file - not sure how to do it better? Thank you

@connor4312
Copy link

connor4312 commented Sep 20, 2023

Oh, sorry. I was speaking to the VS Code side of things; I'm not a maintainer of the Jest extension. @connectdotz can weigh in on that PR. Code pointers for VS code if you opt to contribute there:

@ladariha
Copy link
Author

No worries and sorry for the misunderstanding. I somehow managed to make the changes (unless proven otherwise in PR :))

@connectdotz
Copy link
Collaborator

@connor4312 after playing with testing.clearTestResults command, I am not sure that is what we are looking for. The command not only clears the test results and history in the panel, it also removes the status of all the test items. Did I miss something? I think we are looking for a way to clear just the output and the history of the runs, not the actual status of the tests.

@connectdotz
Copy link
Collaborator

reopen this issue to remind us when a better clear test-results panel command becomes available.

@connectdotz connectdotz reopened this Nov 2, 2023
@connor4312
Copy link

The state of items is intrinsically linked to the history: the state of any given item is that of its most recent test run. There is not a way to keep states but remove the history, or vise versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-issue issues caused by external system ( (no fix needed)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants