Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Integration: drop the clipboard CI job and the GPU evidence test, for #5587

aionggb86f52572475
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 35db66d9e..ba8243353 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -289,40 +289,6 @@ jobs:
cargo nextest run --profile ci --workspace --locked --features heif --lib --bins --tests
-E 'package(photocraft-text) | package(photocraft-io) | package(photocraft-ui-egui)'
- # Keep clipboard regressions runnable when an unrelated workspace test fails.
- clipboard:
- name: clipboard regressions (${{ matrix.os }})
- if: github.event_name == 'pull_request'
- runs-on: ${{ matrix.os }}
- timeout-minutes: 45
- permissions:
- contents: read
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest, windows-latest]
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- with:
- persist-credentials: false
- - name: Install Linux system dependencies (egui/winit/rfd)
- if: runner.os == 'Linux'
- run: |
- sudo apt-get update
- sudo apt-get install -y --no-install-recommends \
- libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev \
- libgl1-mesa-dev libgtk-3-dev
- - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable
- - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- with:
- shared-key: test
- save-if: false
- - name: Clipboard state and regression tests
- run: cargo test -p photocraft-ui-egui --locked --lib 'clipboard_tests::'
- - name: Native Windows clipboard contention
- if: runner.os == 'Windows'
- run: cargo test -p photocraft --locked --bin photocraft services::tests::busy_native_clipboard_preserves_copied_shape -- --ignored --exact --test-threads=1
-
corpus:
timeout-minutes: 30
# Real-file corpus tests (cargo feature `corpus`), on every PR and on main. The corpora are
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index bb507334f..8bf2be90d 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -3059,56 +3059,6 @@ mod clipboard_tests {
type OsClip = Arc<Mutex<Option<(u32, u32, Vec<u8>)>>>;
- #[test]
- #[ignore = "renders clipboard error and retry evidence with a GPU adapter"]
- fn clipboard_error_and_retry_visual_evidence() {
- use std::sync::atomic::{AtomicBool, Ordering};
- let busy = Arc::new(AtomicBool::new(true));
- let unavailable = busy.clone();
- let os = OsClip::default();
- let (write, read) = (os.clone(), os);
- let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1200.0, 800.0)).with_max_steps(64).wgpu().build_eframe(move |cc| {
- PhotocraftApp::setup_context(&cc.egui_ctx, Default::default());
- let services = Services {
- clipboard_set_image: Some(Box::new(move |w, h, bytes| {
- *write.lock().unwrap() = Some((w, h, bytes.to_vec()));
- Ok(())
- })),
- clipboard_get_image: Some(Box::new(move || {
- if unavailable.load(Ordering::SeqCst) {
- Err("The native clipboard is not accessible due to being held by another party.".into())
- } else {
- Ok(read.lock().unwrap().clone())
- }
- })),
- ..Default::default()
- };
- let mut app = PhotocraftApp::new(Session::new(), services);
- app.run("file.new", serde_json::json!({"width": 400, "height": 300, "background": "white"})).unwrap();
- app.run("shape.create", serde_json::json!({"kind": "rect", "rect": [80, 60, 200, 120], "fill": "#3070c0"})).unwrap();
- app.run("edit.copy", serde_json::json!({})).unwrap();
- app.run("file.new", serde_json::json!({"width": 400, "height": 300, "background": "white"})).unwrap();
- app
- });
- let out = std::path::PathBuf::from(std::env::var_os("PHOTOCRAFT_CLIPBOARD_EVIDENCE").expect("evidence directory"));
- std::fs::create_dir_all(&out).unwrap();
- h.run_steps(8);
- let ctx = h.ctx.clone();
- assert!(crate::menus::invoke(h.state_mut(), &ctx, "edit.paste", serde_json::json!({})).is_err());
- h.run_steps(2);
- assert!(h.state().ui.status_error);
- h.render().unwrap().save(out.join("clipboard-busy.png")).unwrap();
- busy.store(false, Ordering::SeqCst);
- crate::menus::invoke(h.state_mut(), &ctx, "edit.paste", serde_json::json!({})).unwrap();
- h.run_steps(3);
- assert!(!h.state().ui.status_error);
- assert!(h.state().ui.status.is_empty(), "retry clears the clipboard error: {}", h.state().ui.status);
- // Direct harness mutations need a repaint after the command has cleared the error.
- h.ctx.request_repaint();
- h.run_steps(2);
- h.render().unwrap().save(out.join("clipboard-retry.png")).unwrap();
- }
-
#[test]
fn failed_clipboard_reads_preserve_editable_contents_until_retry() {
use std::sync::atomic::{AtomicBool, Ordering};