Skip to content

Commit 903611c

Browse files
committed
Fix for filenames starting with py.
1 parent d7247fd commit 903611c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/client/testing/testController/common/resultsHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export async function updateResultFromJunitXml(
9797
}
9898

9999
const result = junitSuite.testcase.find((t) => {
100-
const idResult = getRunIdFromRawData(`${t.$.classname}.${t.$.name}`);
100+
const idResult = getRunIdFromRawData(`${t.$.classname}::${t.$.name}`);
101101
const idNode = rawTestCaseNode.runId;
102102
return idResult === idNode || idNode.endsWith(idResult);
103103
});

src/client/testing/testController/common/testItemUtilities.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,12 @@ function getRangeFromRawSource(raw: { source: string }): Range | undefined {
8888
}
8989

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

0 commit comments

Comments
 (0)