-
Notifications
You must be signed in to change notification settings - Fork 720
Capture separate logs for each lsptoolshost test suite #8529
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
base: main
Are you sure you want to change the base?
Conversation
@@ -5,6 +5,7 @@ | |||
Defines the lowest supported target framework for the extension. | |||
Used by server download / integration tests to ensure they run when only this SDK is installed. | |||
--> | |||
<CheckEolTargetFramework>false</CheckEolTargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed project loading did not like running on a .NET 10 preview while building net6.0 projects.
|
||
import * as vscode from 'vscode'; | ||
import { EOL, platform } from 'os'; | ||
import { describe, expect, test } from '@jest/globals'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separated these helpers out because they use @jest/globals
and importing it isn't allowed in the test runner (index.ts).
// We have to fix up the file path because the test file was discovered in the /out/ directory. | ||
file = file.substring(0, file.length - 2) + 'ts'; | ||
file = file.replace(/[\\/]out[\\/]/, path.sep); | ||
file = workingDirectory[0] + file.substring(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So locally __dirname
is returning the drive letter lowercased and the filepaths also are lowercased. Jest fails to match the paths to a test suite if I don't bring in a correct drive letter. Thankfully the working directory has the correct casing. Figure on unix-like platforms it should basically be a no-op.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
.map((file) => path.join(__dirname, file)); | ||
|
||
for (let file of testFiles) { | ||
// We have to fix up the file path because the test file was discovered in the /out/ directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do sourcemaps still work if we do this? e.g. f5 launching integration tests is fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our launch targets set the TEST_FILTER_FILE
so it shouldn't run this bit of code.
|
||
const targetLogDir = path.join( | ||
path.dirname(exports.logDirectory), | ||
`${name ?? 'unknown'}_${path.basename(exports.logDirectory)}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove unknown, name isn't nullable here
const workingDirectory = process.cwd(); | ||
|
||
const testFiles = (await fsExtra.readdir(__dirname)) | ||
.filter((file) => file.endsWith('.integration.test.js')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of doing this, I think you could probably simplify all this by getting the rootPath here, and then just go directly to the typescript files?
|
||
process.env.TEST_FILE_FILTER = file; | ||
|
||
results = await runIntegrationTests(jestIntegrationTestProjectName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current runs logs should still be in the logs folder even if they aren't moved.
No description provided.