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

defect #2451038 Octane cannot correctly open test run report #291

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

andreibangau99
Copy link
Collaborator

  • Created logic so that the test report URL is correct when running tests on different machines inside the same Job

Please Make sure these boxes are checked before submitting your pull request - Thanks ahead!

  • Proper pull request title - concise and clear for others.
  • Proper pull request short description - clear and concise (as it should appear in the Jira ticket) for other developers and users.
  • Proper Jira ticket - Number, Link in pull request description.
  • The PR can is merged on your machine without any conflicts.
  • The PR can is built on your machine without any (new) warnings.
  • The PR passed sanity tests by you / QA / DevTest / Good Samaritan.
  • Add unit tests with new features.
  • If you added any dependency to the POM - Please update grount

- 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() : ""));

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

Copy link
Collaborator Author

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];

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

Copy link
Collaborator Author

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
@andreibangau99 andreibangau99 merged commit 219f05e into octane-dev-latest Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants