-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Html report improvements #30094
Closed
amankagithub
wants to merge
5
commits into
microsoft:main
from
amankagithub:aman/html-report-improvements
Closed
Html report improvements #30094
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,12 +15,12 @@ | |
*/ | ||
|
||
import type { TestCaseSummary } from './types'; | ||
|
||
export class Filter { | ||
project: string[] = []; | ||
status: string[] = []; | ||
text: string[] = []; | ||
labels: string[] = []; | ||
annotations: string[] = []; | ||
|
||
empty(): boolean { | ||
return this.project.length + this.status.length + this.text.length === 0; | ||
|
@@ -32,6 +32,7 @@ export class Filter { | |
const status = new Set<string>(); | ||
const text: string[] = []; | ||
const labels = new Set<string>(); | ||
const annotations = new Set<string>(); | ||
for (const token of tokens) { | ||
if (token.startsWith('p:')) { | ||
project.add(token.slice(2)); | ||
|
@@ -45,6 +46,10 @@ export class Filter { | |
labels.add(token); | ||
continue; | ||
} | ||
if (token.startsWith('a:')) { | ||
annotations.add(token.slice(2)); | ||
continue; | ||
} | ||
text.push(token.toLowerCase()); | ||
} | ||
|
||
|
@@ -53,6 +58,7 @@ export class Filter { | |
filter.project = [...project]; | ||
filter.status = [...status]; | ||
filter.labels = [...labels]; | ||
filter.annotations = [...annotations]; | ||
return filter; | ||
} | ||
|
||
|
@@ -114,6 +120,7 @@ export class Filter { | |
line: String(test.location.line), | ||
column: String(test.location.column), | ||
labels: test.tags.map(tag => tag.toLowerCase()), | ||
annotations: test.annotations.map(a => a.type.toLowerCase() + '=' + a.description?.toLocaleLowerCase()) | ||
}; | ||
(test as any).searchValues = searchValues; | ||
} | ||
|
@@ -144,7 +151,12 @@ export class Filter { | |
if (!matches) | ||
return false; | ||
} | ||
|
||
if (this.annotations.length) { | ||
const matches = this.annotations.every(annotation => | ||
searchValues.annotations.some(_annotation => _annotation.includes(annotation))); | ||
if (!matches) | ||
return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add a test to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have added the test as you suggested . Please review . |
||
} | ||
return true; | ||
} | ||
} | ||
|
@@ -157,5 +169,6 @@ type SearchValues = { | |
line: string; | ||
column: string; | ||
labels: string[]; | ||
annotations: string[]; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This will return all the tests w/o annotations as matching the search criteria.
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.
I tried and it did not . Only test case with annotations will be returned . In below example ,only two test cases which had some annotation is displayed . Am I missing something here?
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.
Ah, you are right, I missed that
this
is a filter here. Still need a test for every new feature though.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.
I have added the test cases for copy feature . Please review .