-
Notifications
You must be signed in to change notification settings - Fork 36
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
defect #2451038 Octane cannot correctly open test run report #291
Conversation
- Created logic so that the test report URL is correct when running tests on different machines inside the same Job
List<Node> nodes = new ArrayList<>(); | ||
|
||
allWorkspaces.forEach(workspace-> nodes.add(JenkinsUtils.getCurrentNode(workspace))); | ||
nodes.forEach(node -> this.nodeNames.add(node != null && !node.getNodeName().isEmpty() ? node.getNodeName() : "")); |
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 seems that there is case when node name is empty as far as I remember it a case when UFT is run on Jenkins machine itself and not on one of it's agents, can you please try to check if your code covers case the UFT test run with not agents?
Secondly instead of define array and fill it up there more convenient way to do it in Java like this
allWorkspaces.stream().filter(workspace-> nodes.add(JenkinsUtils.getCurrentNode(workspace)).map(workspace-> JenkinsUtils.getCurrentNode(workspace))).collect(collectors.toList())
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.
Indeed, when running on the Jenkins machine itself, the node name remains empty. I tested the behavior, and the reports URLs are created correctly in this case, with the path to the 'artifacts' folder from the Jenkins machine.
For the second part, I changed the code accordingly. Please let me know if I missed something.
cleanedTestName = optional.get(); | ||
createdTests.remove(cleanedTestName); | ||
String nodeTestString = optional.get(); | ||
String node = nodeTestString.split("/")[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.
can you please add check before split that you have "/" exist to prevent unplanned errors
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.
Added the check.
- Created logic so that the test report URL is correct when running tests on different machines inside the same Job +added additional checks and reformats
Please Make sure these boxes are checked before submitting your pull request - Thanks ahead!