Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/17270.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix for test result not found for files starting with py.
2 changes: 1 addition & 1 deletion src/client/testing/testController/common/resultsHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export async function updateResultFromJunitXml(
}

const result = junitSuite.testcase.find((t) => {
const idResult = getRunIdFromRawData(`${t.$.classname}.${t.$.name}`);
const idResult = getRunIdFromRawData(`${t.$.classname}::${t.$.name}`);
const idNode = rawTestCaseNode.runId;
return idResult === idNode || idNode.endsWith(idResult);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ function getRangeFromRawSource(raw: { source: string }): Range | undefined {
}

export function getRunIdFromRawData(id: string): string {
// TODO: This is a temporary solution to normalize test ids.
// The current method is error prone and easy to break. When we
// re-write the test adapters we should make sure we consider this.
// This is the id that will be used to compare with the results.
const runId = id
.replace(/\.py/g, '')
.replace(/\.py[^\w\-]/g, '') // we want to get rid of the `.py` in file names
.replace(/[\\\:\/]/g, '.')
.replace(/\:\:/g, '.')
.replace(/\.\./g, '.');
Expand Down