first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
@@ -1,6 +1,10 @@
use crate::Event;
use std::io::Write;
use std::path::Path;
use std::time::Duration;
use instant::Instant;
use std::{io::Write, path::Path, time::Duration};
use crate::Event;
/// Well-known key used to store the `ActionLog` inside `StepDataMap`.
pub const ACTION_LOG_KEY: &str = "action_log";
@@ -1,10 +1,10 @@
use crate::platform::CapturedFrame;
use std::path::Path;
use std::sync::{Arc, Mutex};
use image::ImageEncoder;
use instant::Instant;
use std::{
path::Path,
sync::{Arc, Mutex},
};
use crate::platform::CapturedFrame;
/// The lifecycle state of the capture recorder / capture loop.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+23 -24
View File
@@ -1,34 +1,33 @@
use super::{
action_log::{self, ActionLog, ACTION_LOG_KEY},
artifacts::{self, TestArtifacts, ARTIFACTS_KEY},
overlay::{OverlayLog, OVERLAY_LOG_KEY},
step::{run_step, AssertionOutcome, StepDataMap, TestStep},
video_recorder::{self, VideoRecorder, VIDEO_RECORDER_KEY},
RootDir, TestSetupUtils,
};
use super::action_log::{self, ActionLog, ACTION_LOG_KEY};
use super::artifacts::{self, TestArtifacts, ARTIFACTS_KEY};
use super::overlay::{OverlayLog, OVERLAY_LOG_KEY};
use super::step::{run_step, AssertionOutcome, StepDataMap, TestStep};
use super::video_recorder::{self, VideoRecorder, VIDEO_RECORDER_KEY};
use super::{RootDir, TestSetupUtils};
const RUNTIME_TAG_FAILED_STEP_GROUP_NAME: &str = "failed_step_group_name";
const RUNTIME_TAG_FAILED_ASSERTION_NAME: &str = "failed_assertion_name";
pub const RUNTIME_TAG_FAILURE_REASON: &str = "failure_reason";
#[cfg(feature = "integration_tests")]
use crate::r#async::Timer;
use crate::{
integration::step::PersistedDataMap, platform::TerminationMode, r#async::FutureExt as _, App,
WindowId,
};
use futures::{Future, FutureExt};
use instant::{Duration, Instant};
use std::backtrace::BacktraceStatus;
use std::collections::VecDeque;
use std::panic::AssertUnwindSafe;
use std::path::PathBuf;
use std::pin::Pin;
use std::sync::atomic::AtomicBool;
#[cfg(not(target_family = "wasm"))]
use std::sync::atomic::Ordering;
use std::{
backtrace::BacktraceStatus,
collections::VecDeque,
panic::AssertUnwindSafe,
path::PathBuf,
pin::Pin,
sync::{atomic::AtomicBool, Arc},
};
use std::sync::Arc;
use futures::{Future, FutureExt};
use instant::{Duration, Instant};
use crate::integration::step::PersistedDataMap;
use crate::platform::TerminationMode;
use crate::r#async::FutureExt as _;
#[cfg(feature = "integration_tests")]
use crate::r#async::Timer;
use crate::{App, WindowId};
pub type SetupFn = Box<dyn FnMut(&mut TestSetupUtils) + 'static>;
pub type OnFinishFn = Box<
+5 -8
View File
@@ -1,11 +1,8 @@
use std::{
collections::HashSet,
env,
ffi::OsStr,
fs,
io::ErrorKind,
path::{Path, PathBuf},
};
use std::collections::HashSet;
use std::ffi::OsStr;
use std::io::ErrorKind;
use std::path::{Path, PathBuf};
use std::{env, fs};
mod action_log;
mod artifacts;
+13 -17
View File
@@ -1,21 +1,17 @@
use super::{action_log, overlay, TestSetupUtils};
use crate::keymap::PerPlatformKeystroke;
use crate::platform::OperatingSystem;
use crate::{
event::{Event, KeyEventDetails},
keymap::Keystroke,
platform::Window,
r#async::Timer,
App, WindowId,
};
use std::any::Any;
use std::backtrace::Backtrace;
use std::collections::{HashMap, VecDeque};
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::Duration;
use instant::Instant;
use std::{
any::Any,
backtrace::Backtrace,
collections::{HashMap, VecDeque},
sync::atomic::{AtomicBool, Ordering},
time::Duration,
};
use super::{action_log, overlay, TestSetupUtils};
use crate::event::{Event, KeyEventDetails};
use crate::keymap::{Keystroke, PerPlatformKeystroke};
use crate::platform::{OperatingSystem, Window};
use crate::r#async::Timer;
use crate::{App, WindowId};
const MAX_WAKEUPS_PER_SECOND: u64 = 60;
const THROTTLE_PERIOD: Duration = Duration::from_micros(1000 * 1000 / MAX_WAKEUPS_PER_SECOND);
@@ -1,14 +1,12 @@
use crate::platform::CapturedFrame;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex};
use image::ImageEncoder;
#[cfg(feature = "integration_tests")]
use instant::Instant;
use std::{
path::{Path, PathBuf},
sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex,
},
};
use crate::platform::CapturedFrame;
/// Well-known key used to store the `VideoRecorder` inside `StepDataMap`.
pub const VIDEO_RECORDER_KEY: &str = "video_recorder";
@@ -172,11 +170,13 @@ fn encode_to_mp4(
frames: &[TimestampedFrame],
overlay_log: Option<&super::overlay::OverlayLog>,
) -> anyhow::Result<()> {
use super::overlay::OverlayState;
use std::io::Cursor;
use minimp4::Mp4Muxer;
use openh264::encoder::Encoder;
use openh264::formats::{RgbSliceU8, YUVBuffer};
use std::io::Cursor;
use super::overlay::OverlayState;
const TARGET_FPS: u32 = 60;
const FRAME_DURATION_MS: u128 = 1000 / TARGET_FPS as u128;
@@ -291,9 +291,10 @@ fn save_frames_as_pngs(output_path: &Path, frames: &[TimestampedFrame]) -> anyho
/// `state.stopped` is set the loop exits cleanly.
#[cfg(feature = "integration_tests")]
pub async fn run_capture_loop(app: crate::App, state: CaptureLoopState) {
use crate::r#async::Timer;
use std::time::Duration;
use crate::r#async::Timer;
loop {
Timer::after(Duration::from_millis(16)).await;