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

HDDS-11105. Generate Robot report in container #6951

Merged
merged 8 commits into from
Aug 9, 2024

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

compose/testlib.sh runs Robot tests in Docker containers. However, it tries to generate test reports locally, which assumes Robot Framework is installed on the host. It fails if rebot is not found, even if all tests pass.

acceptance.sh installs Robot Framework if it's not already available. Therefore it can assume the command rebot is available for report generation.

To simplify local use of acceptance tests, testlib.sh could generate reports in an ozone-runner container, similarly to how tests are executed. Thus we can avoid the need to install Robot Framework.

https://issues.apache.org/jira/browse/HDDS-11105

How was this patch tested?

Downloaded acceptance artifacts from CI run and checked log.html:
https://github.com/adoroszlai/ozone/actions/runs/9953554917

@adoroszlai adoroszlai self-assigned this Jul 16, 2024
@adoroszlai adoroszlai requested a review from smengcl July 18, 2024 19:24
Copy link
Contributor

@sadanand48 sadanand48 left a comment

Choose a reason for hiding this comment

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

Downloaded acceptance artifacts from CI run and checked log.html:

This worked earlier too right ? I think the test should be to locally run a robot test via test-single.sh

hadoop-ozone/dev-support/checks/acceptance.sh Show resolved Hide resolved
@adoroszlai
Copy link
Contributor Author

Downloaded acceptance artifacts from CI run and checked log.html:

This worked earlier too right ?

Yes. However GitHub's runner doesn't have Robot Framework installed, we used to install it (install_robot). So the point of my test is to confirm that the report is generated correctly even after removing these installation steps.

I think the test should be to locally run a robot test via test-single.sh

$ cd hadoop-ozone/dist/target/ozone-1.5.0-SNAPSHOT/compose/ozone
$ OZONE_DATANODES=3 ./run.sh -d
$ ../test-single.sh scm basic/basic.robot
Using Docker Compose v2
==============================================================================
Basic :: Smoketest ozone cluster startup                                      
==============================================================================
Check webui static resources                                          | PASS |
------------------------------------------------------------------------------
Basic Freon smoketest                                                 | PASS |
------------------------------------------------------------------------------
Basic :: Smoketest ozone cluster startup                              | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
Output:  /tmp/smoketest/ozone/result/robot-1.xml
Successfully copied 16.4kB to result/
To use Ozone please mount ozone folder to /opt/hadoop
Log:     /rebot-output/log.html
Report:  /rebot-output/report.html
renamed 'result/tmp.4EzMdcfwHjrebot/log.html' -> 'result/log.html'
renamed 'result/tmp.4EzMdcfwHjrebot/report.html' -> 'result/report.html'

$ open result/log.html

Copy link
Contributor

@sadanand48 sadanand48 left a comment

Choose a reason for hiding this comment

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

Thanks @adoroszlai for the patch, LGTM.

@adoroszlai adoroszlai merged commit 387fd6b into apache:master Aug 9, 2024
25 checks passed
@adoroszlai adoroszlai deleted the HDDS-11105 branch August 9, 2024 19:13
@adoroszlai
Copy link
Contributor Author

Thanks @sadanand48 for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants