mirror of
https://github.com/storytold/craft-libs.git
synced 2026-10-13 23:17:44 +00:00
Require Windows CI to exercise the paused print queue
This commit is contained in:
1 parent
b71ad7c8f1
commit
c15c501567
3 files changed
+12
-1
No files matched your search
@@ -23,4 +23,12 @@ jobs:
|
||||
components: rustfmt, clippy
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-print --all-targets -- -D warnings
|
||||
- name: Prepare the Windows test driver
|
||||
if: runner.os == 'Windows'
|
||||
shell: powershell
|
||||
run: |
|
||||
Start-Service Spooler
|
||||
Add-PrinterDriver -Name 'Generic / Text Only'
|
||||
- run: cargo test -p craft-print --locked -- --nocapture
|
||||
env:
|
||||
CRAFT_PRINT_REQUIRE_QUEUE: ${{ runner.os == 'Windows' && '1' || '0' }}
|
||||
@@ -40,7 +40,9 @@ printer parsing, PPD options and argument mapping. On Windows it also parses the
|
||||
PowerShell, checks physical sheet geometry, duplex and raster bounds without hardware,
|
||||
renders a mixed-orientation PDF through WinRT, and attempts submission to a temporary paused
|
||||
queue. The queue portion explicitly skips if the driver or administrative rights are absent;
|
||||
rendering and geometry tests do not skip. Physical printer fidelity remains a hardware check.
|
||||
rendering and geometry tests do not skip. Windows CI installs the inbox test driver and sets
|
||||
`CRAFT_PRINT_REQUIRE_QUEUE=1`, making queue preparation/submission mandatory on its runner.
|
||||
Physical printer fidelity remains a hardware check.
|
||||
|
||||
The cross-platform GitHub Actions workflow is defined in `.github/workflows/print.yml`.
|
||||
It runs formatting, Clippy and this crate's own tests on Windows, Linux and macOS when print
|
||||
|
||||
@@ -261,6 +261,7 @@ fn the_print_script_renders_the_job_and_reaches_the_spooler() {
|
||||
&[("CRAFT_TEST_PRINTER", name)],
|
||||
);
|
||||
if let Err(why) = added {
|
||||
assert_ne!(std::env::var("CRAFT_PRINT_REQUIRE_QUEUE").as_deref(), Ok("1"), "CI requires a prepared paused printer: {why}");
|
||||
eprintln!("skipping the real print: the test printer could not be prepared: {why}");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user