Skip to content

Add --version flag#70

Merged
anmarchenko merged 1 commit into
mainfrom
anmarchenko/add-version-flag
Jun 1, 2026
Merged

Add --version flag#70
anmarchenko merged 1 commit into
mainfrom
anmarchenko/add-version-flag

Conversation

@anmarchenko
Copy link
Copy Markdown
Member

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 to git describe or dev.

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 --version

Expected output:

v9.9.9

@anmarchenko anmarchenko changed the title [codex] Add --version flag Add --version flag May 28, 2026
@anmarchenko anmarchenko marked this pull request as ready for review May 29, 2026 11:22
@anmarchenko anmarchenko requested a review from a team as a code owner May 29, 2026 11:22
Copy link
Copy Markdown
Member Author

E2E Test Report: SUCCESS

Tested by: Shepherd Agent (autonomous QA for Datadog Test Optimization)

Test Environment

  • Method: Local testing from Shepherd
  • Revision tested: 5caeb2ef03c05306be7d646eb33851e42734cdff
  • Branch tested: anmarchenko/add-version-flag
  • Playground: sidekiq with ddtest-plan

Results

Check Status
PR binary builds with injected version ldflag Passed
ddtest --version prints injected version and exits successfully Passed
ddtest Go test suite Passed
Shepherd crook builds PR branch as ddtest dependency Passed
ddtest planning starts and completes in Sidekiq playground Passed

Verification

  • Built the PR checkout with:
    go build -ldflags "-X github.com/DataDog/ddtest/internal/buildinfo.Version=v9.9.9" -o /private/tmp/ddtest-version-check main.go
  • Verified /private/tmp/ddtest-version-check --version returned v9.9.9.
  • Ran go test ./... on the PR checkout; all packages passed, including internal/buildinfo and internal/cmd.
  • Ran:
    ./bin/crook run sidekiq -c ddtest-plan --dep ddtest=anmarchenko/add-version-flag --debug
  • Crook cloned and built the PR branch successfully, then ddtest plan discovered 36 test files and completed planning with 1 runner.

Issues Found

No PR-related issues found.

I also attempted a full sidekiq -c ddtest execution. The PR binary built and planning completed, but the Sidekiq test execution failed because Redis was not running at 127.0.0.1:6379. This appears to be local playground environment setup, not related to the --version change.

Datadog UI

Not 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.

@anmarchenko anmarchenko merged commit 9d89719 into main Jun 1, 2026
4 checks passed
@anmarchenko anmarchenko deleted the anmarchenko/add-version-flag branch June 1, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --version flag.

2 participants