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

bugfix: accommodate junit encoded test names #1411

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

kasiaMarek
Copy link
Contributor

@kasiaMarek kasiaMarek commented Jul 26, 2023

use display name for test cases

connected to:
scalameta/metals#5485
scalameta/metals#5378

className: test._metalsParent.id,
tests: [test.label],
className: _metalsParent.id,
tests: [idStartsWithParent ? id.slice(parent.id.length + 1) : id],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When do we encode the test with name of the parent? Could we fix that on the server side?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the change here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I asked you again for review kind of by accident (I revoked the request but I guess it already alarmed you). I forgot for a sec I was supposed to fixed that. :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good now.

@kasiaMarek kasiaMarek requested review from tgodzik and removed request for tgodzik August 18, 2023 13:15
@@ -94,8 +94,9 @@ function analyzeTestCases(

if (parent) {
const tests = new Set(testCases.map((t) => t.id as TestName));
const failed = Array.from(testCasesResults.values())
.filter((result) => !tests.has(result.testName))
const failed = Array.from(testCasesResults.entries())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could explain a bit about why these chanegs are needed? Also why do we need to drop the parent in the test case id? This doesn't seem related to the display name

Copy link
Contributor Author

@kasiaMarek kasiaMarek Aug 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, the changes in tests are not needed per se. We can go either way: test cases can have the parent's name encoded in the id or not. I understood you suggested that maybe it makes more sense not to do it: #1411 (comment), so I changed that. I didn't initially do it to avoid making more changes in the code.

One way or another for the names that come from the dap session we need to do a mapping, since depending on the build server the names might have the parent's id or not. Here the names returned by DAP were used (without mapping), which I believe to be an error anyway.

I'm only concerned with the id, because previously label (which now corresponds to the display name) was used when a test case was run.

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking so long! One minor comment, otherwise LGTM!

Comment on lines 115 to 116
className: _metalsParent.id,
tests: [id],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
className: _metalsParent.id,
tests: [id],
className: test._metalsParent.id,
tests: [test.id],

that would be a bit less magical.

@kasiaMarek kasiaMarek merged commit 5196b10 into scalameta:main Sep 6, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants