Add --version flag#70
Merged
Merged
Conversation
Member
Author
E2E Test Report: SUCCESSTested by: Shepherd Agent (autonomous QA for Datadog Test Optimization) Test Environment
Results
Verification
Issues FoundNo PR-related issues found. I also attempted a full Datadog UINot applicable for this PR. The changed behavior is local CLI version output, and the planning-only validation intentionally does not emit test-cycle events. This E2E test was performed by Shepherd - autonomous QA agent for Datadog Test Optimization. |
gnufede
approved these changes
Jun 1, 2026
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.
What
Adds
ddtest --version, which prints the current ddtest version and exits successfully. Release and pre-release builds now embed the GitHub release name into the generated binaries, while local builds fall back togit describeordev.Why
CI jobs need a portable way to verify that they are running the expected ddtest binary before executing tests. This makes version checks consistent across runners and installation methods.
Fixes #69.
E2E testing
Build a temporary binary with an injected version and confirm the flag output:
go build -ldflags "-X github.com/DataDog/ddtest/internal/buildinfo.Version=v9.9.9" -o /private/tmp/ddtest-version-check main.go /private/tmp/ddtest-version-check --versionExpected output: