RSDK-13980: Enable cli windows tests#6022
Conversation
…onfig+TestLocalBuild+test_copy_python_template platform-aware
…ror substring match Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…e test infra failures Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…est skip Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…55 dir Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…oken tunnel test, restore gitattributes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…evert noisy copy_local close Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2577cb5 to
7cd39ac
Compare
| @@ -0,0 +1 @@ | |||
| *.md text eol=lf | |||
There was a problem hiding this comment.
Windows GitHub Actions runners default to core.autocrlf=true, which converts LF → CRLF on checkout. CRLF adds 1 byte per line. So a 167-char file checked out on Linux becomes ~171 chars on Windows, and the test fails the byte-count assertions
There was a problem hiding this comment.
windows test will fail without it
| filePath := utils.ResolveFile(dataFileName) | ||
| _, err = os.ReadFile(filePath) | ||
| test.That(t, err, test.ShouldBeError, fmt.Errorf("open %s: no such file or directory", filePath)) | ||
| test.That(t, errors.Is(err, fs.ErrNotExist), test.ShouldBeTrue) |
There was a problem hiding this comment.
windows has slightly diff error string, so just check errNotExist instead of specific string
| if err != nil { | ||
| return errors.Wrapf(err, "failed to create %s", manifestPath) | ||
| } | ||
| defer func() { vutils.UncheckedError(manifestFile.Close()) }() |
There was a problem hiding this comment.
on windows, all open files need to be explicitly closed
| filepath: "non_existent_file.md", | ||
| shouldContain: []string{}, | ||
| shouldErrorWith: "failed to read markdown file at non_existent_file.md: open non_existent_file.md: no such file or directory", | ||
| shouldErrorWith: "failed to read markdown file at non_existent_file.md: open non_existent_file.md:", |
There was a problem hiding this comment.
windows different error string
| expectedName := "viam-labs_test-module_from_reload" | ||
| expectedVersion := "latest-with-prerelease" | ||
| remoteReloadPath := ".viam/packages-local/viam-labs_test-module_from_reload-module.tar.gz" | ||
| expectedEntrypoint, err := filepath.Abs(manifest.Entrypoint) |
There was a problem hiding this comment.
forward slash issues on windows
| err = closeErr | ||
| } | ||
| }() | ||
| if err := f.Close(); err != nil { |
There was a problem hiding this comment.
need to close before removing
| ac.baseURL, _, err = utils.ParseBaseURL(ac.conf.BaseURL, false) | ||
| test.That(t, err, test.ShouldBeNil) | ||
|
|
||
| ac.dialOverride = func(ctx context.Context, fqdn string, rpcOpts []rpc.DialOption, logger logging.Logger) (*client.RobotClient, error) { |
There was a problem hiding this comment.
TestShellFileCopy/from/single_file (540.05s) hangs with
rpc/dial.go:144 trying mDNS {"address":"99823048-4cba-4b40-823e-a26f7362d4a3"}
rpc/server.go:550 mDNS setup failed; continuing with mDNS disabled {"error":"no positive MTU found"}
by adding this, we can skip the mDNS setup that will likely fail on windows and go straight to direct grpc with the actual robot data from the test
| // the manifest contains a: | ||
| // "setup": "./setup.sh" | ||
| // and a "build": "make build" | ||
| manifestPath := createTestManifest(t, "", nil) |
There was a problem hiding this comment.
default test manifest is set up for mac, need windows specifics like .bat instead of .sh
This PR enables cli in the windows testing suite and then fixes some of the tests to make it work for windows. This PR only fixes tests, not broken implementations, and I added skips to tests with the jira ticket documenting that the original command doesn't work.
Testing using the github workflow that enables it:
https://github.com/viamrobotics/rdk/actions/runs/26180155038