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 {
761
761
assert ! ( !dst. exists( ) ) ;
762
762
}
763
763
764
- #[ cfg( not( target_os = "macos" ) ) ]
764
+ // #[cfg(not(target_os = "macos"))]
765
765
#[ test]
766
766
#[ cfg( feature = "kaleido" ) ]
767
767
fn test_save_to_jpeg ( ) {
@@ -773,7 +773,7 @@ mod tests {
773
773
assert ! ( !dst. exists( ) ) ;
774
774
}
775
775
776
- #[ cfg( not( target_os = "macos" ) ) ]
776
+ // #[cfg(not(target_os = "macos"))]
777
777
#[ test]
778
778
#[ cfg( feature = "kaleido" ) ]
779
779
fn test_save_to_svg ( ) {
@@ -822,7 +822,7 @@ mod tests {
822
822
}
823
823
824
824
#[ test]
825
- #[ ignore] // Fails in the CI
825
+ // #[ignore] // Fails in the CI
826
826
#[ cfg( not( target_os = "macos" ) ) ]
827
827
#[ cfg( feature = "kaleido" ) ]
828
828
fn test_image_to_base64 ( ) {
@@ -851,7 +851,7 @@ mod tests {
851
851
}
852
852
853
853
#[ test]
854
- #[ ignore] // Fails in the CI
854
+ // #[ignore] // Fails in the CI
855
855
#[ cfg( not( target_os = "macos" ) ) ]
856
856
#[ cfg( feature = "kaleido" ) ]
857
857
fn test_image_to_svg_string ( ) {
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ impl Kaleido {
198
198
"--disable-software-rasterizer" ,
199
199
"--single-process" ,
200
200
"--disable-gpu" ,
201
- "--timeout 2000 " ,
201
+ "--no-sandbox " ,
202
202
] )
203
203
. stdin ( Stdio :: piped ( ) )
204
204
. stdout ( Stdio :: piped ( ) )
@@ -227,16 +227,29 @@ impl Kaleido {
227
227
let output_lines = BufReader :: new ( process. stdout . take ( ) . unwrap ( ) ) . lines ( ) ;
228
228
for line in output_lines. map_while ( Result :: ok) {
229
229
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
+ }
237
242
}
238
243
}
239
244
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
+
240
253
Ok ( String :: default ( ) )
241
254
}
242
255
}
You can’t perform that action at this time.
0 commit comments