-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Updated Perf Test display with parent and children builds separately #52
Conversation
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.
Thanks Sophia for working on this issue. Please update the typo "seperately" in the title. I'll review the changes later today.
</div>; | ||
} | ||
return <div> | ||
<Link to={{ pathname: '/buildDetail', search: params( { parentId: value._id } ) }} |
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.
We need to make sure the updated code will work for other types of tests.
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.
Modified as required. Please check.
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.
@sophiaxu0424 Please make sure to validate your changes with non-perf tests as well. You can choose 1-2 pipelines from the build monitoring list of the currently deployed TRSS and check whether those jobs can be parsed in the DB and viewed on TRSC as expected.
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 this will break for builds that contain tests directly (i.e., Daily-ODM). We could keep the original code, and add else block for line 76. In the else block, we can link to /buildDetail
.
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.
Yes, that's right, changed as required.
if ( response && response.insertedCount === 1 ) { | ||
buildOutputId = response.insertedIds[0]; | ||
} | ||
update.buildOutputId = buildOutputId; |
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.
If there is tests
obj return, the test output will be stored in line 106. There is no need to store the output again. If the plan is to store the perf test output, then the perf parser should be updated to store the value as testOutput.
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.
Yes, I agree, changed it back already.
style={{ color: resultColor }}> {value.buildName} # {value.buildNum} </Link>; | ||
} else { | ||
return <Link to={{ pathname: '/output/build', search: params( { id: value._id } ) }} | ||
style={{ color: resultColor }}> {value.buildName} # {value.buildNum} </Link>; |
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 is no special treatment for Perf. Could we just remove the if else altogether?
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.
Code changed as required. Please check.
@llxia @piyush286 updated as required. But having a new issue with conflict from above, not quite sure what to do. Would you please provide some information. Thank you. |
@sophiaxu0424 Let's discuss that issue on Webex! |
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.
@llxia Can you please review the changes? Thanks!
if ( value.tests[0]._id ) { | ||
return <div> | ||
<Link to={{ pathname: '/output/test', search: params( { id: value.tests[0]._id } ) }} | ||
style={{ color: result === "PASSED" ? "#2cbe4e" : ( result === "FAILED" ? "#f50" : "#DAA520" ) }}> |
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.
Don't we just have 2 conditions: PASSED
OR FAILED
for performance tests?
https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/8006133d8f660ce49c1c0345ab7ac241d49eec8e/TestResultSummaryService/parsers/BenchmarkParser.js#L148
Not sure if we need DAA520
. I notice that it was there earlier in TopLevelBuilds.jsx
as well.
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.
#DAA520 and #f50 are the background colors respect to the status of the result. Keep it won't be a big problem.
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.
We have other conditions for the test result (i.e., SKIPPED), so #DAA520
is needed.
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.
Got it.
</div>; | ||
} | ||
return <div> | ||
<Link to={{ pathname: '/buildDetail', search: params( { parentId: value._id } ) }} |
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.
@sophiaxu0424 Please make sure to validate your changes with non-perf tests as well. You can choose 1-2 pipelines from the build monitoring list of the currently deployed TRSS and check whether those jobs can be parsed in the DB and viewed on TRSC as expected.
let result = value.tests[0].testResult; | ||
if ( value.tests[0]._id ) { | ||
return <div> | ||
<Link to={{ pathname: '/output/test', search: params( { id: value.tests[0]._id } ) }} |
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.
Related issue for this: #70
This looks like is a bug with the old design since we would only show the the output of the first iteration (value.tests[0]._id) when the user clicks on a Jenkins build even though that Jenkins build may have multiple iterations, which won't be displayed. This problem will be fixed with the new design.
We can address this issue in #70.
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 agree, I have tested it using FVT (non-perf) build type before making this pull request. But since I am having a problem logging to the internal Jenkins server, I would test it again after fixing the logging problem.:)
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.
Instead of adding special code for perf, I am wondering if we can leverage allTestsInfo
directly.
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.
As I noticed, the value type could be "Build" "Perf" and "Test', so if the first condition(either "Build" or "Perf") is not satisfied, it will go to the allTestInfo (line 52).
Sure, I will review this shortly. I was confused by discussing on Webex comment. |
if ( value.tests[0]._id ) { | ||
return <div> | ||
<Link to={{ pathname: '/output/test', search: params( { id: value.tests[0]._id } ) }} | ||
style={{ color: result === "PASSED" ? "#2cbe4e" : ( result === "FAILED" ? "#f50" : "#DAA520" ) }}> |
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.
We have other conditions for the test result (i.e., SKIPPED), so #DAA520
is needed.
let result = value.tests[0].testResult; | ||
if ( value.tests[0]._id ) { | ||
return <div> | ||
<Link to={{ pathname: '/output/test', search: params( { id: value.tests[0]._id } ) }} |
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.
Instead of adding special code for perf, I am wondering if we can leverage allTestsInfo
directly.
</div>; | ||
} | ||
return <div> | ||
<Link to={{ pathname: '/buildDetail', search: params( { parentId: value._id } ) }} |
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 this will break for builds that contain tests directly (i.e., Daily-ODM). We could keep the original code, and add else block for line 76. In the else block, we can link to /buildDetail
.
@@ -69,6 +69,7 @@ export default class BuildDetail extends Component { | |||
buildUrl: builds[i].buildUrl, | |||
type: builds[i].type, | |||
hasChildren: builds[i].hasChildren, | |||
tests: builds[i].tests ? builds[i].tests : null, |
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.
Is tests
used?
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.
Yes, tests is defined here for been used in buildTable.js (else if statement in line 37).
@@ -17,11 +17,10 @@ export default class Build extends Component { | |||
|
|||
async updateData() { | |||
const { buildId } = getParams( this.props.location.search ); | |||
const fetchBuild = await fetch( `/api/getAllTestsWithHistory?buildId=${buildId}&limit=5 `, { | |||
const fetchBuild = await fetch( `/api/getAllTestsWithHistory?buildId=${buildId}&limit=1 `, { |
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.
The value for limit
has to be passed in. If Perf, set the limit to 1. Otherwise, the limit is 5.
@@ -83,6 +83,12 @@ export default class TopLevelBuilds extends Component { | |||
</Link> | |||
</div>; | |||
} | |||
} else if (value.parentId !== null){ |
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 we can use else
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.
@llxia @piyush286 Updated the code as required, would you please have a review again? Thank you.
</div>; | ||
} | ||
return <div> | ||
<Link to={{ pathname: '/buildDetail', search: params( { parentId: value._id } ) }} |
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.
Yes, that's right, changed as required.
let limitNum = 5; | ||
if ( build[0].type === "Perf" ) { | ||
limitNum = 1; | ||
} |
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.
An additional query to figure out the type is not necessary. When calling allTestsInfo
(link below), we know the type, we can set the limit based on type and pass the limit as params.
In AllTestsInfo.jsx, we can get the limit from the line 19 as following:
const { buildId, limit } = getParams( this.props.location.search );
- Test perf should display the parent builds in the first layer, by clicking each parent build's link would give information of all its child builds. Issue: #24 #70 adoptium/aqa-tests#850 Signed-off-by: sophiaxu0424 <xmh1989@my.yorku.ca>
@llxia I have updated the required changes, would you please take another review? Thanks. |
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
Issue: #24