-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add test report #48
Open
nirs
wants to merge
10
commits into
RamenDR:main
Choose a base branch
from
nirs:report
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add test report #48
+854
−98
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59aef42
to
743d16a
Compare
46406bc
to
c2cf7be
Compare
parikshithb
approved these changes
Mar 21, 2025
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.
Tried this out locally, Looks great !!!
Changes in latest version:
|
rakeshgm
approved these changes
Mar 21, 2025
Setup and Cleanup are are important concepts for a test command. Make them a method on the command type. This cleans up the code, and will make it easier to update the command report in the next changes. Signed-off-by: Nir Soffer <[email protected]>
Signed-off-by: Nir Soffer <[email protected]>
This is useful to report multiple errors, required when running multiple tests, or when we need to report non-fatal errors that do not fail the entire run. Signed-off-by: Nir Soffer <[email protected]>
The report package provides the common part of a report, used by all reports. Specific reports (e.g. test report) will add more info to the report. The common report includes information about the host and about ramenctl. This should aid in debugging issues related to the host or to specific ramenctl build. Example report yaml: host: arch: arm64 cpus: 12 os: darwin name: test-run ramenctl: commit: 78fc3c5420fb1c78f006a0dadd0c82bc9cf14883 version: v0.1.0-3-g78fc3c5 Signed-off-by: Nir Soffer <[email protected]>
Add Config and Status fields to Test. When a test fails, we mark the test as failed. The Config and Status will be used to report the test result. Signed-off-by: Nir Soffer <[email protected]>
The test.Report adds tests specific info, describing a test run or clean. The report adds: - Name: "test-run" or "test-clean" - Status: "passed" if all tests passed, "failed" if setup failed, or some tests failed. - Summary: Count of passed, failed, and skipped tests - Steps: list of steps ran. We have 3 steps: - Setup: run once before the tests during a test run command - Tests: run once after setup during a test run command - Cleanup: run once after the tests during a test clean command. Example report for test run: host: arch: arm64 cpus: 12 os: darwin name: test-run ramenctl: commit: 78fc3c5420fb1c78f006a0dadd0c82bc9cf14883 version: v0.1.0-3-g78fc3c5 status: passed steps: - name: setup status: passed - name: tests status: passed tests: - deployer: appset pvcSpec: rbd status: passed workload: deploy summary: failed: 0 passed: 1 skipped: 0 Signed-off-by: Nir Soffer <[email protected]>
Reports are stored in the command output directory using "command-name.yaml". This makes it easy to create reports from any command. I'm thinking about keeping all reports in single file as a stream of yaml documents, but let's start with something simple. Signed-off-by: Nir Soffer <[email protected]>
This matches better the command behavior. For test run: 1. Run setup 2. Run tests For test clean: 1. Clean tests 2. Run cleanup The natural place for running or cleaning a test seems to be the test command. already used to run the setup and cleanup steps. This will also make it easier to integrate the test report in the next step. This makes is easier to handle test failure and support running multiple tests in parallel. Signed-off-by: Nir Soffer <[email protected]>
Previously if a test step (setup, cleanup, test) failed, we returned an error to signal the failure. This aborts the entire test and the top level command code was logging the error to the console and exit. This scheme does not work for complicated flow such as running multiple test in parallel, of for handling multiple errors (e.g. failure to write a test report after test step failed). Change the interface so failed step log the error to the console and logfile and return false, signaling that the operation failed and we need to abort the test. Previously we log the test success message in the top level command, but this does not allow logging useful info when tests are finished, such as number of passed and failed tests. Move the log to the test package. When a test complete, it returns either a Command.Failed() error, or call Command.Passed(). These methods will be used to write the test report and report more info about the test. Signed-off-by: Nir Soffer <[email protected]>
Since both run and clean commands need to store a report create a report when creating a command. Modify Setup(), Cleanup() and RunTest() to update the report when the operation completes. Modify Failed() and Passed() to write the report to the output directory, and report test summary in the failure or success message. Signed-off-by: Nir Soffer <[email protected]>
Changes in last version:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add test report for test-run and test-clean commands. When a test run or
clean is completed, we write a yaml report with the name of the command.
The report include information about the host, ramenctl, and the test
command.
Example test run command
Example test clean command
Example report
Report contents
test-run.yaml
test-clean.yaml
Report tarball
test.tar.gz
Fixes #34
Fixes #40