Repository navigation
report test2json: add --description, --mode, --rerun and --rerun-of - #42
Open
DzmitryHumianiuk wants to merge 1 commit into
Open
DzmitryHumianiuk wants to merge 1 commit into
DzmitryHumianiuk wants to merge 1 commit into
Conversation
--mode accepts DEFAULT or DEBUG (case-insensitive) and is validated before anything is read or sent. --rerun reports into the latest launch with the same name, --rerun-of into the named launch (and implies --rerun). The launch id of the server's response is used for everything that follows: for a rerun it is the UUID of the original launch (ReportPortal 5.13.5+). Part of #26. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or 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
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.
Summary
Part of #26 (slice C2). Stacked on #29 (
fix/test2json-reporting); merge that first.report test2jsoncould only set the launch name and attributes. This adds the remaining launch options ofthe start request: description, mode and rerun.
Changes
--description(LAUNCH_DESCRIPTION): launch description.--mode(LAUNCH_MODE, defaultDEFAULT):DEFAULTorDEBUG, case-insensitive. Any other value failswith exit code 1 before the input is read or anything is sent.
--rerun(LAUNCH_RERUN): sendsrerun=true, so the server reports into the latest launch with the same name.--rerun-of <uuid>(LAUNCH_RERUN_OF): sendsrerun=trueandrerunOf. It implies--rerun, because theserver ignores
rerunOfwhenrerunis not set.--print-launch-uuidand
--quality-gate-check; it never uses the--rerun-ofvalue itself. A comment and a test pin this.reportportalskill: flag tables, environment variables, a paragraph on reruns.Behaviour change
None for existing invocations: the new flags are optional and the mode default is still
DEFAULT.Verification
go build ./... && go vet ./... && go test -race ./...: ok.go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0 run ./...: 0 issues.TestReportLaunch_LaunchOptions(request fields for defaults, description +debug,--rerun,--rerun-of; items carry the launch id of the response) andTestReportLaunch_InvalidModeFailsBeforeReporting.gorp-wave-c2-172939, deleted afterwards:--description "wave c2 check" --mode debug: the launch hasdescription,mode=DEBUG,rerun=false, statusFAILED, executionstotal 1, failed 1.--rerunwith the same name: the command printed the UUID of the first launch.--rerun-of <uuid>with a different--launchName: the same UUID again. The launch then hadrerun=true,status
PASSED, executionstotal 2, passed 2, and its name was unchanged. No second launch was created.--rerunwith a name that has no launch: the server answers404 {"errorCode":4041,…}and gorp exits 1.--mode nope:invalid --mode "nope": expected DEFAULT or DEBUG, exit 1, nothing sent.Investigation log
grep -n "json:" pkg/openapi/model_com_epam_reportportal_base_reporting_start_launch_rq.goshowsdescription,mode,rerun,rerunOf.develop,src/main/java/com/epam/reportportal/base/reporting/async/producer/LaunchStartProducer.java:58-60:if (request.isRerun()) request.setUuid(rerunHandler.getRerunLaunchUuid(rerunOf, name, projectId)).So
rerunOfwithoutrerundoes nothing, which is why--rerun-ofimplies--rerun.core/launch/rerun/RerunHandlerImpl.java:112-124(getRerunLaunchUuid): byrerunOfUUID within the project,otherwise the latest launch with that name; no match throws
LAUNCH_NOT_FOUND(404 / 4041). Mode is not part ofthe lookup.
reporter.go,startLaunch→entryID), so"always use the id from the response" needed no code change, only a test and a comment.
scratchpad/consilium2/server.md(row "Rerun") and was not re-checked at older tags.scratchpad/wave/live-c2.sh, output inscratchpad/wave/live/c2.log.Not verified
--modeforstart-launchin another branch.The helper here is named
test2jsonLaunchModeto avoid a clash; once both are merged they can share one.🤖 Generated with Claude Code