Clarify toolstate names. Move publish.py to a more convenient location.

This commit is contained in:
kennytm 2017-12-22 01:16:21 +08:00
parent d7488c3089
commit 44954ab52d
No known key found for this signature in database
GPG Key ID: FEF6C8051D0E013C
6 changed files with 13 additions and 12 deletions

View File

@ -188,7 +188,7 @@ matrix:
script:
MESSAGE_FILE=$(mktemp -t msg.XXXXXX);
. src/ci/docker/x86_64-gnu-tools/repo.sh;
commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/ci/docker/x86_64-gnu-tools/publish.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE"
commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE"
env:
global:

View File

@ -256,7 +256,7 @@ fn run(self, builder: &Builder) {
builder.add_rustc_lib_path(compiler, &mut cargo);
if try_run(build, &mut cargo) {
build.save_toolstate("rls", ToolState::Testing);
build.save_toolstate("rls", ToolState::TestPass);
}
}
}
@ -302,7 +302,7 @@ fn run(self, builder: &Builder) {
builder.add_rustc_lib_path(compiler, &mut cargo);
if try_run(build, &mut cargo) {
build.save_toolstate("rustfmt", ToolState::Testing);
build.save_toolstate("rustfmt", ToolState::TestPass);
}
}
}
@ -352,7 +352,7 @@ fn run(self, builder: &Builder) {
builder.add_rustc_lib_path(compiler, &mut cargo);
if try_run(build, &mut cargo) {
build.save_toolstate("miri", ToolState::Testing);
build.save_toolstate("miri", ToolState::TestPass);
}
} else {
eprintln!("failed to test miri: could not build");
@ -407,7 +407,7 @@ fn run(self, builder: &Builder) {
builder.add_rustc_lib_path(compiler, &mut cargo);
if try_run(build, &mut cargo) {
build.save_toolstate("clippy-driver", ToolState::Testing);
build.save_toolstate("clippy-driver", ToolState::TestPass);
}
} else {
eprintln!("failed to test clippy: could not build");

View File

@ -116,9 +116,9 @@ fn run(self, builder: &Builder) -> Option<PathBuf> {
let mut cargo = prepare_tool_cargo(builder, compiler, target, "build", path);
let is_expected = build.try_run(&mut cargo);
build.save_toolstate(tool, if is_expected {
ToolState::Compiling
ToolState::TestFail
} else {
ToolState::Broken
ToolState::BuildFail
});
if !is_expected {

View File

@ -9,19 +9,20 @@
// except according to those terms.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
/// Whether a tool can be compiled, tested or neither
pub enum ToolState {
/// The tool compiles successfully, but the test suite fails
Compiling = 1,
TestFail = 1,
/// The tool compiles successfully and its test suite passes
Testing = 2,
TestPass = 2,
/// The tool can't even be compiled
Broken = 0,
BuildFail = 0,
}
impl Default for ToolState {
fn default() -> Self {
// err on the safe side
ToolState::Broken
ToolState::BuildFail
}
}

View File

@ -41,6 +41,6 @@ $COMMIT\t$(cat "$TOOLSTATE_FILE")
exit 0
fi
if grep -q 'Broken\|Compiling' "$TOOLSTATE_FILE"; then
if grep -q fail "$TOOLSTATE_FILE"; then
exit 4
fi