File tree Expand file tree Collapse file tree 2 files changed +25
-12
lines changed
Expand file tree Collapse file tree 2 files changed +25
-12
lines changed Original file line number Diff line number Diff line change @@ -761,7 +761,7 @@ mod tests {
761761 assert ! ( !dst. exists( ) ) ;
762762 }
763763
764- #[ cfg( not( target_os = "macos" ) ) ]
764+ // #[cfg(not(target_os = "macos"))]
765765 #[ test]
766766 #[ cfg( feature = "kaleido" ) ]
767767 fn test_save_to_jpeg ( ) {
@@ -773,7 +773,7 @@ mod tests {
773773 assert ! ( !dst. exists( ) ) ;
774774 }
775775
776- #[ cfg( not( target_os = "macos" ) ) ]
776+ // #[cfg(not(target_os = "macos"))]
777777 #[ test]
778778 #[ cfg( feature = "kaleido" ) ]
779779 fn test_save_to_svg ( ) {
@@ -822,7 +822,7 @@ mod tests {
822822 }
823823
824824 #[ test]
825- #[ ignore] // Fails in the CI
825+ // #[ignore] // Fails in the CI
826826 #[ cfg( not( target_os = "macos" ) ) ]
827827 #[ cfg( feature = "kaleido" ) ]
828828 fn test_image_to_base64 ( ) {
@@ -851,7 +851,7 @@ mod tests {
851851 }
852852
853853 #[ test]
854- #[ ignore] // Fails in the CI
854+ // #[ignore] // Fails in the CI
855855 #[ cfg( not( target_os = "macos" ) ) ]
856856 #[ cfg( feature = "kaleido" ) ]
857857 fn test_image_to_svg_string ( ) {
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ impl Kaleido {
198198 "--disable-software-rasterizer" ,
199199 "--single-process" ,
200200 "--disable-gpu" ,
201- "--timeout 2000 " ,
201+ "--no-sandbox " ,
202202 ] )
203203 . stdin ( Stdio :: piped ( ) )
204204 . stdout ( Stdio :: piped ( ) )
@@ -227,16 +227,29 @@ impl Kaleido {
227227 let output_lines = BufReader :: new ( process. stdout . take ( ) . unwrap ( ) ) . lines ( ) ;
228228 for line in output_lines. map_while ( Result :: ok) {
229229 let res = KaleidoResult :: from ( line. as_str ( ) ) ;
230- if let Some ( image_data) = res. result {
231- // TODO: this should be refactored
232- // The assumption is that KaleidoResult contains a single image.
233- // We should end the loop on the first valid one.
234- // If that is not the case, prior implementation would have returned the last
235- // valid image
236- return Ok ( image_data) ;
230+ match res. result {
231+ Some ( image_data) => {
232+ // TODO: this should be refactored
233+ // The assumption is that KaleidoResult contains a single image.
234+ // We should end the loop on the first valid one.
235+ // If that is not the case, prior implementation would have returned the last
236+ // valid image
237+ return Ok ( image_data) ;
238+ }
239+ None => {
240+ println ! ( "empty line from Kaleido" ) ;
241+ }
237242 }
238243 }
239244
245+ // Don't eat up Kaleido/Chromiu erros but show them in the terminal
246+ let stderr = process. stderr . take ( ) . unwrap ( ) ;
247+ let stderr_lines = BufReader :: new ( stderr) . lines ( ) ;
248+ for line in stderr_lines {
249+ let line = line. unwrap ( ) ;
250+ eprintln ! ( "{}" , line) ;
251+ }
252+
240253 Ok ( String :: default ( ) )
241254 }
242255}
You can’t perform that action at this time.
0 commit comments