Skip to content

Commit

Permalink
only run test for moonbitlang project
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Dec 13, 2024
1 parent 9b411c1 commit 02784b1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
9 changes: 7 additions & 2 deletions src/dashboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ pub enum MoonCommand {
}

impl MoonCommand {
pub fn args(&self) -> Vec<&str> {
pub fn args(&self, is_moonbit_community: bool) -> Vec<&str> {
match self {
MoonCommand::Check(backend) => vec!["check", "-q", "--target", backend.to_flag()],
MoonCommand::Build(backend) => vec!["build", "-q", "--target", backend.to_flag()],
MoonCommand::Test(backend) => {
vec!["test", "-q", "--target", backend.to_flag()]
// only run test for moonbit community project
if is_moonbit_community {
vec!["test", "-q", "--target", backend.to_flag()]
} else {
vec!["test", "-q", "--build-only", "--target", backend.to_flag()]
}
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,12 @@ fn stat_mooncake(
) -> Result<ExecuteResult, StatMooncakeError> {
let _ = run_moon(workdir, source, &["clean"]);

let r = run_moon(workdir, source, &cmd.args()).map_err(|e| StatMooncakeError::RunMoon(e));
let is_moonbit_community = match source {
MooncakeSource::MooncakesIO { name, .. } => name.contains("moonbitlang"),
MooncakeSource::Git { url, .. } => url.contains("moonbitlang") || url.contains("moonbit-community"),
};

let r = run_moon(workdir, source, &cmd.args(is_moonbit_community)).map_err(|e| StatMooncakeError::RunMoon(e));
let status = match r.as_ref() {
Ok(output) if output.success => Status::Success,
_ => Status::Failure,
Expand Down
13 changes: 5 additions & 8 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ const App = () => {
const bleedingSuccess = bleedingEntry.cbts.some(cbt => checkItemStatus(cbt, phase, backend));

if (stableSuccess && !bleedingSuccess) {
return `Regression detected: ${platform}'s ${backend} ${phase} passed in stable but failed in bleeding-edge`;
return `Regression detected: ${backend} ${phase} passed in stable but failed in bleeding`;
}
}
}
Expand Down Expand Up @@ -472,8 +472,7 @@ const App = () => {
const failurePlatforms = Array.from(results.entries()).filter(([_, success]) => !success).map(([platform]) => platform);

if (successPlatforms.length > 0 && failurePlatforms.length > 0) {
const version = useBleedingEdge ? "bleeding-edge" : "stable";
return `Platform inconsistency in ${version}: ${backend} ${phase} passed on ${successPlatforms.join(', ')} but failed on ${failurePlatforms.join(', ')}`;
return `Platform inconsistency: ${backend} ${phase} passed on ${successPlatforms.join(', ')} but failed on ${failurePlatforms.join(', ')}`;
}
}
}
Expand Down Expand Up @@ -505,8 +504,7 @@ const App = () => {
const failureBackends = backendResults.filter(r => !r.success).map(r => r.backend);

if (successBackends.length > 0 && failureBackends.length > 0) {
const version = useBleedingEdge ? "bleeding-edge" : "stable";
return `Backend inconsistency in ${version} on ${platform}: ${phase} passed on ${successBackends.join(', ')} but failed on ${failureBackends.join(', ')}`;
return `Backend inconsistency: ${phase} passed on ${successBackends.join(', ')} but failed on ${failureBackends.join(', ')}`;
}
}
}
Expand Down Expand Up @@ -538,8 +536,7 @@ const App = () => {
const failurePhases = phaseResults.filter(r => !r.success).map(r => r.phase);

if (successPhases.length > 0 && failurePhases.length > 0) {
const version = useBleedingEdge ? "bleeding-edge" : "stable";
return `Phase inconsistency in ${version} on ${platform}'s ${backend}: passed ${successPhases.join(', ')} but failed ${failurePhases.join(', ')}`;
return `Phase inconsistency: passed ${successPhases.join(', ')} but failed ${failurePhases.join(', ')}`;
}
}
}
Expand All @@ -553,7 +550,7 @@ const App = () => {
const bleedingSuccess = isAllSuccess(index, data, true);

if (stableSuccess && bleedingSuccess) {
return { text: "All tests passed in both stable and bleeding-edge on all platforms", status: 'success' };
return { text: "All passed", status: 'success' };
}

// 按优先级检查各种差异
Expand Down

0 comments on commit 02784b1

Please sign in to comment.