dockertest 0.4 (#406)

* Updates to modern dockertest

* More updates to latest dockertest

* Update Cargo.lock to dockertest with handle restored

* clippy coordinator tests

* clippy full-stack tests

* Remove kayabaNerve branch for official repo's latest commit hash

* Update serai-client, remove reliance on the existence of a handle fn

* Don't use the hex encoding of unique_id in dockertests

Gets our hostnames just below 64 bytes, resolving test failures on at least
Debian-based systems.

* Use Network::Isolated for all dockertest instances

* Correct error from prior commit's edits
This commit is contained in:
Luke Parker
2023-10-23 06:59:38 -04:00
committed by GitHub
parent 0d23964762
commit c4bdbdde11
17 changed files with 178 additions and 196 deletions

View File

@@ -4,7 +4,7 @@ pub fn reproducibly_builds() {
use rand_core::{RngCore, OsRng};
use dockertest::{PullPolicy, Image, Composition, DockerTest};
use dockertest::{PullPolicy, Image, TestBodySpecification, DockerTest};
const RUNS: usize = 3;
const TIMEOUT: u16 = 180 * 60; // 3 hours
@@ -16,14 +16,14 @@ pub fn reproducibly_builds() {
OsRng.fill_bytes(id);
}
let mut test = DockerTest::new();
let mut test = DockerTest::new().with_network(dockertest::Network::Isolated);
for id in &ids {
test.add_composition(
Composition::with_image(
test.provide_container(
TestBodySpecification::with_image(
Image::with_repository("serai-dev-runtime").pull_policy(PullPolicy::Never),
)
.with_container_name(format!("runtime-build-{}", hex::encode(id)))
.with_cmd(vec![
.set_handle(format!("runtime-build-{}", hex::encode(id)))
.replace_cmd(vec![
"sh".to_string(),
"-c".to_string(),
// Sleep for a minute after building to prevent the container from closing before we