mirror of
https://github.com/storytold/effectcraft.git
synced 2026-12-05 21:43:10 -05:00
fix(automation): green Linux gate
- Test token files are owner-only on Unix, as the app writes them; the shared client refuses a token others can read. - render.frame with base64 and write returns the bytes it wrote again; only replies that write nothing are compressed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
5a5ecaf5d7
commit
60d19bfe94
2 files changed
+8
-4
No files matched your search
@@ -62,6 +62,12 @@ fn fake_window(token: String) -> (u16, Arc<Mutex<Vec<String>>>) {
|
||||
/// Publishes a window on `port` in `dir` as the app does, its token file holding `token`.
|
||||
fn publish(dir: &Path, port: u16, token: &str) {
|
||||
std::fs::write(dir.join(TOKEN_FILE), token).unwrap();
|
||||
// Owner-only, as the app writes it: the client refuses a token others can read.
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
std::fs::set_permissions(dir.join(TOKEN_FILE), std::fs::Permissions::from_mode(0o600)).unwrap();
|
||||
}
|
||||
write_connection(dir, &Connection::new(port, dir.join(TOKEN_FILE), "EffectCraft test")).unwrap();
|
||||
}
|
||||
|
||||
|
||||
@@ -884,11 +884,9 @@ fn render_frame(app: &EffectcraftApp, p: &Value) -> Outcome {
|
||||
.and_then(Value::as_str)
|
||||
.map(str::to_string)
|
||||
.unwrap_or_else(|| std::env::temp_dir().join(format!("effectcraft-frame-{}.png", std::process::id())).to_string_lossy().to_string());
|
||||
// Written and inline: the reply carries the bytes the file holds.
|
||||
if inline {
|
||||
out["png"] = match inline_png(&rgba, w, h) {
|
||||
Ok(png) => json!(png),
|
||||
Err(e) => return err(e),
|
||||
};
|
||||
out["png"] = json!(base64(&png));
|
||||
}
|
||||
match s.write_output_guarded(&guard, &path, &png) {
|
||||
Ok(()) => {
|
||||
|
||||
Reference in new issue
Block a user