Skip to content

Commit

Permalink
fix stats when tag is unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
dkijania committed Nov 24, 2020
1 parent c318941 commit 1c2140f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 2 additions & 10 deletions testing/jormungandr-scenario-tests/src/scenario/repository/mod.rs
Expand Up @@ -76,21 +76,14 @@ impl ScenariosRepository {
pub fn scenarios_tagged_by(&self, tag: Tag) -> Vec<Scenario> {
match tag {
Tag::All => self.repository.clone(),
Tag::Unstable => self
.repository
.iter()
.cloned()
.filter(|x| x.has_tag(tag))
.collect(),
_ => self
.repository
.iter()
.cloned()
.filter(|x| x.has_tag(tag) && x.no_tag(Tag::Unstable))
.filter(|x| x.has_tag(tag))
.collect(),
}
}

fn should_run_all(&self) -> bool {
self.scenario.trim() == "*"
}
Expand All @@ -102,7 +95,7 @@ impl ScenariosRepository {
) -> ScenarioSuiteResult {
let mut suite_result = ScenarioSuiteResult::new();
for scenario_to_run in available_scenarios {
if scenario_to_run.tags().contains(&Tag::Unstable) {
if scenario_to_run.tags().contains(&Tag::Unstable) && self.tag != Tag::Unstable {
let scenario_result = ScenarioResult::ignored(scenario_to_run.name());

if self.report_unstable {
Expand All @@ -113,7 +106,6 @@ impl ScenariosRepository {

continue;
}

suite_result.push(self.run_single_scenario(
&scenario_to_run.name(),
&available_scenarios,
Expand Down
Expand Up @@ -25,10 +25,6 @@ impl Scenario {
self.tags.iter().any(|t| *t == tag)
}

pub fn no_tag(&self, tag: Tag) -> bool {
!self.has_tag(tag)
}

pub fn name(&self) -> String {
self.name.clone()
}
Expand Down

0 comments on commit 1c2140f

Please sign in to comment.