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

CodeQL: Open test as current database

Open aeisenberg opened this issue 5 years ago • 3 comments

Note: this issue is currently blocked, but adding it here so we know to work on it when the blocker is removed.

When a test fails, I can right-click on it and have the useful options to see or accept the difference. One other useful thing to do is to locate the test database on disk and set it as the current database so that I can run queries and quick-evaluations against it.

However, there are currently issues with database corruption when you run tests while the test database is open in codeql, so currently we don't want to make it easier to open the test data and hit this problem more often than they do currently until we fix that problem.

aeisenberg avatar May 22 '20 15:05 aeisenberg

Comment from @tausbn:

On a whim, I tried renaming the database before importing it, and so far this seems to have none of those evaluation errors. Could this be a solution? Instead of sharing the database with the test, simply import a copy of it? I feel like it would certainly be better than what we have now. (We could even name the database "Snapshot of such and such test made at such and such time" to make more clear that this database is unaffected by changing the test files.)

aeisenberg avatar Sep 09 '20 15:09 aeisenberg

A workaround is to do the following:

  1. Remove the .testproj extension
  2. Run the codeql database cleanup command on the database
  3. Import into vscode

aeisenberg avatar Nov 18 '20 19:11 aeisenberg

However, there are currently issues with database corruption when you run tests while the test database is open in codeql, so currently we don't want to make it easier to open the test data and hit this problem more often than they do currently until we fix that problem.

Is that still relevant after #868?

Marcono1234 avatar Oct 06 '23 22:10 Marcono1234