-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix(tests-table): filter by individual table path #882
Conversation
7891cd9
to
25a2a38
Compare
@@ -56,6 +56,44 @@ export interface ITestsTable { | |||
currentPathFilter?: string; | |||
} | |||
|
|||
type StatusGroup = Pick< |
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.
change to TestStatusGroup
, to differ of StatusGroups
(build)
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.
Changed to TPathTestsStatus
to make it very clear from where these fields are coming from!
return result; | ||
}), | ||
individual_tests: test.individual_tests.filter( | ||
t => t.status?.toUpperCase() === StatusTable.FAIL, |
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 toUpperCase
is really needed? If yes, in the statusCounter
function you may transform the status string to upper case too
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.
That's true, if toUpperCase
was needed, it should be included in statusCounter as well. Seeing that statusCounter
is working I'd have to think that toUpperCase
is not necessary in any situation. I'll change this and check to see if it's working correctly
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 think it would be very unlikely that the database changes the way the status are written (from upper case to lower case for example), but since this does not cause any problems (like performance issues), I'd still say we keep this and add the same to statusCounter
just to be sure
25a2a38
to
0955fc6
Compare
this is a better test subject than the one in the link, since there are tests paths that are different from the group path |
}; | ||
const individualTest = test.individual_tests.filter(t => { | ||
let dataIncludesPath = true; | ||
if (isValidPath) dataIncludesPath = t.path.includes(path); |
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.
nit:
if (isValidPath) dataIncludesPath = t.path.includes(path); | |
if (isValidPath) { | |
dataIncludesPath = t.path.includes(path); | |
} |
we should probably add this to eslint
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.
All add it to another PR just to not "add noise" to this one
if (isValidPath) dataIncludesPath = t.path.includes(path); | ||
if (dataIncludesPath) { | ||
statusCounter(localGroup, t.status); | ||
statusCounter(globalGroup, t.status); |
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.
I believe this is the expected behavior based on what we currently see in tree and hardware details. globalGroup
would be the sum of all localGroup
. If all tests are filtered out, then globalGroup
will correctly be 0-0-0-0
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.
it is working on my tests
Filter by the path of every individual test when `updatePathFilter` is undefined Closes #875
0955fc6
to
a772382
Compare
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.
LGTM
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.
Working well
Filter by the path of every individual test when
updatePathFilter
is undefinedCloses #875
How to test
updatePathFilter
there shouldn't be any differences from the version on staging. However, they are still influenced by this implementation since all of the status counting is done in the filteredDatauseMemo
.