MCPcopy Create free account
hub / github.com/Qovery/engine / test_pull

Function test_pull

lib-engine/src/cmd/docker.rs:1060–1100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1058
1059 #[test]
1060 fn test_pull() {
1061 let docker = Docker::new(None).unwrap();
1062
1063 // Invalid image should fails
1064 let image = ContainerImage::new(
1065 Url::parse("https://public.ecr.aws").unwrap(),
1066 "r3m4q3r9/pub-mirror-debian".to_string(),
1067 vec!["1.0".to_string()],
1068 );
1069 let ret = docker.pull(
1070 &image,
1071 &mut |msg| println!("{msg}"),
1072 &mut |msg| eprintln!("{msg}"),
1073 &CommandKiller::never(),
1074 );
1075 assert!(ret.is_err());
1076
1077 // Valid image should be ok
1078 let image = ContainerImage::new(
1079 Url::parse("https://public.ecr.aws").unwrap(),
1080 "r3m4q3r9/pub-mirror-debian".to_string(),
1081 vec!["11.6-ci".to_string()],
1082 );
1083
1084 let ret = docker.pull(
1085 &image,
1086 &mut |msg| println!("{msg}"),
1087 &mut |msg| eprintln!("{msg}"),
1088 &CommandKiller::never(),
1089 );
1090 assert!(ret.is_ok());
1091
1092 // Should timeout
1093 let ret = docker.pull(
1094 &image,
1095 &mut |msg| println!("{msg}"),
1096 &mut |msg| eprintln!("{msg}"),
1097 &CommandKiller::from_timeout(Duration::from_secs(0)),
1098 );
1099 assert!(matches!(ret, Err(DockerError::Timeout { .. })));
1100 }
1101
1102 #[test]
1103 fn test_buildkit_build() {

Callers

nothing calls this directly

Calls 1

pullMethod · 0.80

Tested by

no test coverage detected