Implement WASI initial cwd configuration#13468
Conversation
| let mut common_options = CommonOptions::try_parse_from(["test", "-Scwd=/sandbox"]).unwrap(); | ||
| common_options.configure().unwrap(); | ||
| assert_eq!(common_options.wasi.cwd.as_deref(), Some("/sandbox")); |
There was a problem hiding this comment.
For this it's best to skip the test here and rely on testing in cli_tests.rs instead. Given that, can you remove this?
There was a problem hiding this comment.
Makes sense, thanks for the guidance. I’ll remove these low-level checks and keep the coverage at the CLI/end-to-end level.
| let ctx = WasiCtxBuilder::new().initial_cwd("/sandbox").build(); | ||
| assert_eq!(ctx.cli.initial_cwd.as_deref(), Some("/sandbox")); | ||
| } | ||
| } |
There was a problem hiding this comment.
There's no need to add these tests, we don't typically test at this micro-level of granularity. The end-to-end tests are fine. (it becomes extremely onerous to refactor if tests are there for every possible behavior and implementation detail of a function)
There was a problem hiding this comment.
thanks. I’ll remove these micro-level tests and keep the behavior covered at the end-to-end level.
This implements the missing configuration path for wasi:cli/environment.initial-cwd discussed in #9695.
Summary:
Tests: