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

Extension of the ReportPortal plugin using API #2305

Merged
merged 7 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions spec/plans/report.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,47 @@ description:
web page, filter them via context attributes and get links
to detailed test output and other test information.
description:
Fill json with test results and other fmf data per each plan,
and send it to a Report Portal instance via its API.
Provide test results and fmf data per each plan,
and send it to a Report Portal instance via its API
with token, url and project name given.
example:
- |
# Set environment variables with the server url and token
export TMT_REPORT_REPORTPORTAL_URL=<url-to-RP-instance>
export TMT_REPORT_REPORTPORTAL_TOKEN=<token-from-RP-profile>
# Optionally set environment variables according to TMT_PLUGIN_REPORT_REPORTPORTAL_${OPTION}
export TMT_PLUGIN_REPORT_REPORTPORTAL_URL=${url-to-RP-instance}
export TMT_PLUGIN_REPORT_REPORTPORTAL_TOKEN=${token-from-RP-profile}
- |
# Enable ReportPortal report from the command line
# Enable ReportPortal report from the command line depending on the use case:

## Simple upload with all project, url endpoint and user token passed in command line
tmt run --all report --how reportportal --project=baseosqe --url="https://reportportal.xxx.com" --token="abc...789"

## Simple upload with url and token exported in environment variable
tmt run --all report --how reportportal --project=baseosqe
tmt run --all report --how reportportal --project=baseosqe --exclude-variables="^(TMT|PACKIT|TESTING_FARM).*"
tmt run --all report --how reportportal --project=baseosqe --launch=test_plan
tmt run --all report --how reportportal --project=baseosqe --url=... --token=...

## Upload with project name in fmf data, filtering out parameters (environemnt variables) that tend to be unique and break the history aggregation
tmt run --all report --how reportportal --exclude-variables="^(TMT|PACKIT|TESTING_FARM).*"

## Upload all plans as suites into one ReportPortal launch
tmt run --all report --how reportportal --suite-per-plan --launch=Errata --launch-description="..."

## Rerun the launch with suite structure for the test results to be uploaded into the latest launch with the same name as a new 'Retry' tab (mapping based on unique paths)
tmt run --all report --how reportportal --suite-per-plan --launch=Errata --launch-rerun

## Rerun the tmt run and append the new result logs under the previous one uploaded in ReportPortal (precise mapping)
tmt run --id run-012 --all report --how reportportal --again

## Additional upload of new suites into given launch with suite structure
tmt run --all report --how reportportal --suite-per-plan --upload-to-launch=4321

## Additional upload of new tests into given launch with non-suite structure
tmt run --all report --how reportportal --launch-per-plan --upload-to-launch=1234

## Additional upload of new tests into given suite
tmt run --all report --how reportportal --upload-to-suite=123456

## Upload Idle tests, then execute it and add result logs into prepared empty tests
tmt run discover report --how reportportal --defect-type=Idle
tmt run --last --all report --how reportportal --again
- |
# Use ReportPortal as the default report for given plan
report:
Expand Down
21 changes: 21 additions & 0 deletions tmt/schemas/report/reportportal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,27 @@ properties:
launch:
type: string

launch-description:
type: string

launch-per-plan:
type: boolean

suite-per-plan:
type: boolean

upload-to-launch:
type: string

upload-to-suite:
type: string

launch-rerun:
type: boolean

defect_type:
type: string

exclude-variables:
type: string

Expand Down
Loading
Loading