Skip to content

Commit

Permalink
Move memory exhaustion out of full
Browse files Browse the repository at this point in the history
This test will always on Windows because its docker engine does not yet
support the `State.OOMKilled` flag. We move it out of `full` and into
its own minicrater run (which is disabled on Windows).
  • Loading branch information
ecstatic-morse committed Jul 19, 2019
1 parent 4932104 commit 3e8dab2
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 16 deletions.
3 changes: 2 additions & 1 deletion tests/minicrater/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ impl MinicraterRun {

#[macro_export]
macro_rules! minicrater {
($($name:ident $opts:tt,)*) => {
($( $(#[$cfg:meta])* $name:ident $opts:tt,)*) => {
$(
#[test]
#[ignore]
$(#[$cfg])*
fn $name() {
use $crate::minicrater::driver::MinicraterRun;
MinicraterRun $opts.execute();
Expand Down
1 change: 1 addition & 0 deletions tests/minicrater/full/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ build-log-max-lines = 1000
[github-repos]

[local-crates]
memory-hungry = { skip = true }
24 changes: 9 additions & 15 deletions tests/minicrater/full/results.expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,6 @@
],
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/clippy-warn"
},
{
"name": "memory-hungry (local)",
"res": "spurious-fixed",
"runs": [
{
"log": "stable/local/memory-hungry",
"res": "build-fail:oom"
},
{
"log": "beta/local/memory-hungry",
"res": "test-fail:oom"
}
],
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/memory-hungry"
},
{
"name": "missing-examples (local)",
"res": "test-pass",
Expand Down Expand Up @@ -179,6 +164,15 @@
}
],
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/yanked-deps"
},
{
"name": "memory-hungry (local)",
"res": "skipped",
"runs": [
null,
null
],
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/memory-hungry"
}
]
}
7 changes: 7 additions & 0 deletions tests/minicrater/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,11 @@ minicrater! {
toolchains: &["stable", "stable+rustflags=-Dclippy::all"],
..Default::default()
},

#[cfg(not(windows))] // `State.OOMKilled` is not set on Windows
resource_exhaustion {
ex: "resource-exhaustion",
crate_select: "demo",
..Default::default()
},
}
24 changes: 24 additions & 0 deletions tests/minicrater/resource-exhaustion/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[server.bot-acl]
rust-teams = true
github = ["pietroalbini"]

[server.labels]
remove = "^S-"
experiment-queued = "S-waiting-on-crater"
experiment-completed = "S-waiting-on-review"

[demo-crates]
crates = []
github-repos = []
local-crates = ["build-pass", "memory-hungry"]

[sandbox]
memory-limit = "512M"
build-log-max-size = "2M"
build-log-max-lines = 1000

[crates]

[github-repos]

[local-crates]
34 changes: 34 additions & 0 deletions tests/minicrater/resource-exhaustion/results.expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"crates": [
{
"name": "build-pass (local)",
"res": "test-pass",
"runs": [
{
"log": "stable/local/build-pass",
"res": "test-pass"
},
{
"log": "beta/local/build-pass",
"res": "test-pass"
}
],
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/build-pass"
},
{
"name": "memory-hungry (local)",
"res": "spurious-fixed",
"runs": [
{
"log": "stable/local/memory-hungry",
"res": "build-fail:oom"
},
{
"log": "beta/local/memory-hungry",
"res": "test-fail:oom"
}
],
"url": "https://github.com/rust-lang-nursery/crater/tree/master/local-crates/memory-hungry"
}
]
}

0 comments on commit 3e8dab2

Please sign in to comment.