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

Updated Perf Test display with parent and children builds separately #52

Merged
merged 1 commit into from
Apr 4, 2019
Merged

Updated Perf Test display with parent and children builds separately #52

merged 1 commit into from
Apr 4, 2019

Conversation

sophiaxu0424
Copy link
Contributor

@sophiaxu0424 sophiaxu0424 commented Mar 12, 2019

- Perf Test 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

@karianna karianna added this to In progress in aqa-test-tools via automation Mar 12, 2019
@karianna karianna added the enhancement New feature or request label Mar 12, 2019
@sophiaxu0424 sophiaxu0424 changed the title Updated Test Perf display with parent and children builds seperately Updated Perf Test display with parent and children builds seperately Mar 13, 2019
aqa-test-tools automation moved this from In progress to Needs review Mar 13, 2019
Copy link
Contributor

@piyush286 piyush286 left a 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.

@sophiaxu0424 sophiaxu0424 changed the title Updated Perf Test display with parent and children builds seperately Updated Perf Test display with parent and children builds separately Mar 13, 2019
</div>;
}
return <div>
<Link to={{ pathname: '/buildDetail', search: params( { parentId: value._id } ) }}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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.

Copy link
Contributor Author

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>;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@sophiaxu0424 sophiaxu0424 changed the title Updated Perf Test display with parent and children builds separately Updated Perf Test display with parent and children builds separately -in progress Mar 14, 2019
@sophiaxu0424 sophiaxu0424 changed the title Updated Perf Test display with parent and children builds separately -in progress Updated Perf Test display with parent and children builds separately Mar 15, 2019
@sophiaxu0424
Copy link
Contributor Author

@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.

@piyush286
Copy link
Contributor

piyush286 commented Mar 15, 2019

@sophiaxu0424 Let's discuss that issue on Webex!

Copy link
Contributor

@piyush286 piyush286 left a 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" ) }}>
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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 } ) }}
Copy link
Contributor

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 } ) }}
Copy link
Contributor

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.

Copy link
Contributor Author

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.:)

Copy link
Contributor

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.

Copy link
Contributor Author

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).

@llxia
Copy link
Contributor

llxia commented Mar 20, 2019

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" ) }}>
Copy link
Contributor

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 } ) }}
Copy link
Contributor

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 } ) }}
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is tests used?

Copy link
Contributor Author

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 `, {
Copy link
Contributor

@llxia llxia Mar 27, 2019

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){
Copy link
Contributor

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

Copy link
Contributor Author

@sophiaxu0424 sophiaxu0424 left a 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 } ) }}
Copy link
Contributor Author

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;
}
Copy link
Contributor

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.

https://github.com/AdoptOpenJDK/openjdk-test-tools/blob/cd800edf8d4b392d033611c4194d2707bd12acfb/test-result-summary-client/src/Build/BuildTable.jsx#L52

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>
@sophiaxu0424
Copy link
Contributor Author

@llxia I have updated the required changes, would you please take another review? Thanks.

aqa-test-tools automation moved this from Needs review to Reviewer approved Apr 4, 2019
Copy link
Contributor

@llxia llxia left a comment

Choose a reason for hiding this comment

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

LGTM

@llxia llxia merged commit d4102dd into adoptium:master Apr 4, 2019
aqa-test-tools automation moved this from Reviewer approved to Done Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants