mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 16:27:33 -10:00
script_test.go's sandbox sets DEVVM_MESSAGES=names and DATA, VMS, RUN and CFG by default, and adds stub_reset, catg (the one file a glob matches), vm_name VAR NAME (the folder's VM) and project NAME [git]; script_cmds.txtar checks each. Every script is rewritten onto them, its assertions kept; TestCommandLines leaves the scripts' own commands out. mise run test runs scripts/test.sh: the tests as before, with the CLI tests' devvm built with -cover for every package (CLI_GOCOVERDIR), merged with the Go tests' counters by go tool covdata, then scripts/coverage.sh holds each package to testdata/coverage/<os>.txt. mise run coverage raises the baselines; coverage.txtar checks the comparison. The macOS baseline is recorded from this tree. Co-Authored-By: Claude Opus 5.5 <[email protected]>
49 lines
1.6 KiB
Plaintext
49 lines
1.6 KiB
Plaintext
# devvm _proxy: the network policy proxy, hidden. --help lists its flags.
|
|
exec devvm _proxy --help
|
|
stdout '-auth-file'
|
|
stdout '-listen'
|
|
! stderr .
|
|
exec devvm --help
|
|
! stdout _proxy
|
|
|
|
# The proxy refuses to run without the VM's password, or with an empty one.
|
|
! exec devvm _proxy -listen 127.0.0.1:0
|
|
stderr '^devvm: proxy_failed reason=-auth-file is required$'
|
|
! exec devvm _proxy --auth-file empty
|
|
stderr '^devvm: proxy_failed reason=empty is empty$'
|
|
! exec devvm _proxy -nope
|
|
stderr '^devvm: proxy_failed reason=flag provided but not defined: -nope$'
|
|
|
|
# -init-ca writes the CA and keeps it on the next run.
|
|
exec devvm _proxy -init-ca ca
|
|
exists ca/ca.pem ca/ca.key
|
|
grep 'BEGIN CERTIFICATE' ca/ca.pem
|
|
cp ca/ca.pem first.pem
|
|
exec devvm _proxy -init-ca ca
|
|
cmp ca/ca.pem first.pem
|
|
|
|
# -redact: secret-named values replaced, their paths on stderr.
|
|
stdin settings.json
|
|
exec devvm _proxy -redact json
|
|
stdout '"apiKey": "devvm-redacted"'
|
|
stdout '"baseURL": "https://x"'
|
|
! stdout dummy-key
|
|
stderr '^provider.options.apiKey$'
|
|
|
|
# -login -login-vm: the VM's copy holds placeholders, and what it copies as
|
|
# it is is warned about.
|
|
exec devvm _proxy -login codex -login-file auth.json -login-vm
|
|
stdout '"OPENAI_API_KEY": "sk-devvm-proxy-managed-codex"'
|
|
stdout '"extra": "x"'
|
|
! stdout sk-real
|
|
stderr '^devvm: codex_login_kept keys=extra$'
|
|
exec devvm _proxy -login codex -login-file auth.json -login-bindings -login-hosts
|
|
stdout '^api.openai.com:443$'
|
|
|
|
-- empty --
|
|
|
|
-- settings.json --
|
|
{"provider": {"options": {"apiKey": "dummy-key", "baseURL": "https://x"}}}
|
|
-- auth.json --
|
|
{"OPENAI_API_KEY": "sk-real", "extra": "x"}
|