Draft
Conversation
9106fd9 to
d1544cb
Compare
Copies all of captain-cli's internal/ packages (~111 source files) into internal/captain/, preserving directory structure. Also copies version.go and test fixtures needed by the test suite. All imports rewritten from github.com/rwx-research/captain-cli/internal/ to github.com/rwx-cloud/cli/internal/captain/. One test path adjusted for the extra directory depth (fs/local_test.go ../../go.mod -> ../../../go.mod).
Adds direct dependencies required by the absorbed captain packages: zap (logging), gomega/ginkgo (testing), shellwords, doublestar (globs), stripansi, semver, wordwrap, sync, and others. Go version remains 1.24 as the captain code does not require 1.25 features.
Removes functions and tests that were only used by the captain CLI commands we don't need (add, remove, quarantine, update): - parseFlags, AddFlake, AddQuarantine, RemoveFlake, RemoveQuarantine, UploadTestResults, UpdateTestResults and all associated tests
d1544cb to
fe5fef0
Compare
Ports the captain-cli run command as `rwx test run`, including: - Test suite execution with retries, result uploads, and partitioning - Config file discovery and parsing (.captain/config.yaml) - Captain error handling bridge in main.go - Access token resolution from file backend - Auto-derivation of git metadata for local runs - Identity recipes for framework detection Also includes all internal captain package updates needed to rename Captain references to RWX and wire up env var fallbacks (RWX_TEST_ with CAPTAIN_ backwards compatibility).
Adds `rwx test results parse` to parse test result files into RWX v1 JSON, and `rwx test results merge` to combine partitioned test results into a single file.
Adds `rwx test partition` to split tests across partitions using historical timing data or round-robin distribution.
Ginkgo v2 rejects `go test -parallel`, so captain tests are split into their own CI task without the flag while non-captain tests retain `-parallel 4` for performance.
fe5fef0 to
2eef374
Compare
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.
Note: 66,682 lines are isolated in the first commit, which is a straight copy from the Captain repo's internal package.
Tentative next steps are to migrate RWX's own use of
captain runto userwx test runon an unstable build of the CLI before releasing this.Summary
Ports the captain-cli command layer into the RWX CLI under
rwx test, rebranding all user-facing references from "Captain" to "rwx test" / "RWX", and cleaning up integration issues.Key changes:
internal/captain/and registers them asrwx testsubcommands.captain/to.rwx/test/(e.g..captain/config.yml→.rwx/test/config.yml)CAPTAIN_*environment variables toRWX_TEST_*with backwards-compatible fallbacksinternal/captain/backend/local/), thecloud.disabledconfig option, the--update-stored-resultsflag, and all OSS fallback code are dropped.rwx testnow requires an RWX access token — users who need OSS mode should stay on the original captain CLI.rwx test parse results→rwx test results parseandrwx test merge→rwx test results mergerwx logintokens work with test commandsCommand migration
Run a test suite
Run with test results file
Parse test results
Merge partitioned results
Partition a test suite
Config file
Environment variables
CAPTAIN_SUITE_IDRWX_TEST_SUITE_IDCAPTAIN_SHARWX_TEST_SHACAPTAIN_BRANCHRWX_TEST_BRANCHCAPTAIN_WHORWX_TEST_WHOCAPTAIN_COMMIT_MESSAGERWX_TEST_COMMIT_MESSAGECAPTAIN_BUILD_URLRWX_TEST_BUILD_URLCAPTAIN_TITLERWX_TEST_TITLECAPTAIN_DELIMITERRWX_TEST_DELIMITERAll
CAPTAIN_*env vars continue to work as fallbacks for backwards compatibility.Test plan
Command surface
rwx --helpdoes not showtestas a visible subcommandrwx test --helpshowsrun,partition,resultssubcommands; noadd,remove,update, orquarantinerwx test results --helpshowsparseandmergesubcommandsadd,remove,update,quarantine) are not registeredPersistentPreRunE skip for test subcommands
rwx test run --help,rwx test partition --help,rwx test results parse --help,rwx test results merge --helpall produce help output without Docker/SSH/API init errors (even withRWX_ACCESS_TOKENunset)rwx run --help) still run root init normallyAccess token resolution
rwx logintoken is picked up by test commands withoutRWX_ACCESS_TOKENsetRWX_ACCESS_TOKENenv var overrides the stored tokenRWX_ACCESS_TOKENor runrwx loginOSS mode removed
--update-stored-resultsflag onrwx test runcloud.disabledin config file produces a parse error (unknown field)internal/captain/backend/local/deleted)Auto-derive git metadata
--who,--branch,--shaauto-derives values from the local repo--who,--sha,--branchflags override auto-derived valuesBranding — "Captain" references removed
CAPTAIN_*env var names remain for backwards compat)User-Agent header
--test-debugoutput showsrwx-cli/devuser-agent, notcaptain-cli/unsetrwx test results parserwx test results mergerwx test partitionConfig file discovery
.rwx/test/config.yamland applies suite config--config-fileflag works for explicit config path.rwx/test/)Error handling
--suite-idproduces a formatted errorexit 42→ exit code 42)Environment variable migration
CAPTAIN_*env vars still work whenRWX_TEST_*are unsetRegression
rwx --help,rwx run --help,rwx login --helpare unaffectedgo test ./internal/... ./cmd/...passes