jojochuang commented on code in PR #323: URL: https://github.com/apache/ozone-site/pull/323#discussion_r2767417159
########## docs/08-developer-guide/03-test/03-acceptance-tests.md: ########## @@ -1,7 +1,164 @@ # Acceptance Tests -**TODO:** File a subtask under [HDDS-9861](https://issues.apache.org/jira/browse/HDDS-9861) and complete this page or section. +Acceptance tests validate the complete Ozone system from an end-user perspective. They deploy and test Ozone in a containerized environment that closely resembles real-world deployments. -- Scope (what should be acceptance tested) -- Directory layout of acceptance tests -- Running tests locally. +## Scope and Purpose + +Acceptance tests serve as the final validation layer in Ozone's testing strategy: + +- **Unit Tests**: Test individual classes in isolation +- **Integration** Tests: Test component interactions using in-memory clusters +- **Acceptance Tests**: Test the entire system as deployed in containers + +Acceptance tests are ideal for: + +- End-to-end workflows +- API compliance (especially S3) +- Security configurations +- System behavior under various conditions +- External interfaces and integrations + +## Testing Framework + +Ozone uses [Robot Framework](https://robotframework.org/) for acceptance testing. Robot Framework is a generic test automation framework that uses a keyword-driven approach to testing. + +You can run acceptance tests in any environment after [installing robot framework](https://github.com/robotframework/robotframework/blob/master/INSTALL.rst) + +### Key Features + +- Human-readable test syntax +- Extensive test libraries +- Test case organization by feature +- Detailed test reports +- Ability to create custom keywords + +## Directory Structure + +Acceptance tests are located in the `hadoop-ozone/dist/src/main/smoketest/` directory. + +```text +smoketest/ +├── basic/ # Basic functionality tests +├── s3/ # S3 gateway tests +├── security/ # Security and authentication tests +├── recon/ # Recon service tests +├── ozone-lib/ # Shared libraries and utilities +├── commonlib.robot # Common test keywords +└── compose/ # Docker Compose test environment + ├── ozone/ # Ozone-specific test configurations + ├── security/ # Secure test configurations + └── ha/ # HA test configurations +``` + +## Test Structure + +Robot Framework tests are written in `test_name.robot` files with a structured format: + +```text +*** Settings *** +Documentation Test Ozone volume operations +Library OperatingSystems +Resource ../ozone-lib/shell.robot + +*** Variables *** +${volume} vol1 + +*** Test Cases *** +Create Volume + Execute ozone sh volume create /${volume} + Execute ozone sh volume list + Should contain ${OUTPUT} ${volume} + +Delete Volume + Execute ozone sh volume delete /${volume} + Execute ozone sh volume list + Should not contain ${OUTPUT} ${volume} +``` + +## Running Tests Locally + +You can run acceptance tests in several ways: + +### Method 1: Using Docker Compose + +```bash +# Go to the compose directory +cd hadoop-ozone/dist/src/main/compose/ + +# Run all tests +./test-all.sh + +# Run single test +docker-compose up -d +# wait.... +./test-single.sh scm basic/basic.robot +``` + +### Method 2: Against a Running Cluster + +```bash +# Set environment variables to point to your cluster +export OZONE_OM_SERVICE_ID=om-service-test1 +export OZONE_OM_INTERNAL_SERVICE_ID=om-internal-service-test1 +export OZONE_OM_ADDRESS=ozonemanager.example.com:9862 +export OZONE_ADMINISTRATORS=admin + +# Run the Robot Framework tests directly +cd hadoop-ozone/dist/src/main/smoketest +robot basic/basic.robot +``` + +### Method 3: Using Maven + +```bash +# Run acceptance tests with Maven +cd hadoop-ozone +mvn verify -Pacceptance +``` Review Comment: I'm not sure about method 2 and method 3. Seem to come from nowhere. The env variables in method 2 does not seem to work. The acceptance profile in method 3 does not exist. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
