Skip to content

Commit

Permalink
Removed deprecated test
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Aug 6, 2023
1 parent 4011999 commit ffc6682
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:

steps:
- uses: actions/checkout@v2 # Update to v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2 # Update to v2
with:
distribution: 'temurin' # 'temurin' distribution provides OpenJ9 builds of the OpenJDK
java-version: '11'
java-version: '17'

- name: Cache the Maven packages to speed up build
uses: actions/cache@v2 # Update to v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,20 @@ class WhenCalculatingRequirementTestCoverage extends Specification {
applesFeatureOutcomes.subrequirements.total == 2
}

def "should show only outcomes containing tests if so configured"() {
given: "there are two stories with passing tests in the 'Apples' feature"
def testOutcomes = TestOutcomes.of(SampleTestResults.withPassingTestForApples())
def environmentVariables = new MockEnvironmentVariables()
environmentVariables.setProperty("serenity.report.hide.empty.requirements","true")
and: "we read the requirements from the directory structure"
RequirementsOutcomeFactory requirmentsOutcomeFactory = new MultipleSourceRequirmentsOutcomeFactory(requirementsProviders,issueTracking, environmentVariables, new ReportNameProvider())
when: "we generate the capability outcomes"
RequirementsOutcomes outcomes = requirmentsOutcomeFactory.buildRequirementsOutcomesFrom(testOutcomes)
then:
outcomes.visibleOutcomes.size() == 1
}
// TODO: Refactor to use recorded test outcomes, not the deprecated PackageRequirementsTagProvider
//
// def "should show only outcomes containing tests if so configured"() {
// given: "there are two stories with passing tests in the 'Apples' feature"
// def testOutcomes = TestOutcomes.of(SampleTestResults.withPassingTestForApples())
// def environmentVariables = new MockEnvironmentVariables()
// environmentVariables.setProperty("serenity.report.hide.empty.requirements","true")
// and: "we read the requirements from the directory structure"
// RequirementsOutcomeFactory requirmentsOutcomeFactory = new MultipleSourceRequirmentsOutcomeFactory(requirementsProviders,issueTracking, environmentVariables, new ReportNameProvider())
// when: "we generate the capability outcomes"
// RequirementsOutcomes outcomes = requirmentsOutcomeFactory.buildRequirementsOutcomesFrom(testOutcomes)
// then:
// outcomes.visibleOutcomes.size() == 1
// }

def "should count zero if there are no nested requirements"() {
given: "there are two stories with passing tests in the 'Apples' feature"
Expand All @@ -92,39 +94,43 @@ class WhenCalculatingRequirementTestCoverage extends Specification {
potatoesFeatureOutcomes.subrequirements.total == 0
}

def "should count the number of nested requirements with tests in a given state"() {
given: "there are two stories with passing tests in the 'Apples' feature"
def testOutcomes = TestOutcomes.of(SampleTestResults.withPassingTestForApples())
def environmentVariables = new MockEnvironmentVariables()
and: "we read the requirements from the directory structure"
RequirementsOutcomeFactory requirmentsOutcomeFactory = new MultipleSourceRequirmentsOutcomeFactory(requirementsProviders,issueTracking, environmentVariables, new ReportNameProvider())
when: "we generate the capability outcomes"
RequirementsOutcomes outcomes = requirmentsOutcomeFactory.buildRequirementsOutcomesFrom(testOutcomes)
def applesFeatureOutcomes = outcomes.requirementOutcomes.find { it.requirement.name == 'Apples'}
then:
applesFeatureOutcomes.subrequirements.withResult("success") == 1
and:
applesFeatureOutcomes.subrequirements.withResult("failure") == 1
and:
applesFeatureOutcomes.subrequirements.withResult("pending") == 0
}
// TODO: Refactor to use recorded test outcomes, not the deprecated PackageRequirementsTagProvider
//
// def "should count the number of nested requirements with tests in a given state"() {
// given: "there are two stories with passing tests in the 'Apples' feature"
// def testOutcomes = TestOutcomes.of(SampleTestResults.withPassingTestForApples())
// def environmentVariables = new MockEnvironmentVariables()
// and: "we read the requirements from the directory structure"
// RequirementsOutcomeFactory requirmentsOutcomeFactory = new MultipleSourceRequirmentsOutcomeFactory(requirementsProviders,issueTracking, environmentVariables, new ReportNameProvider())
// when: "we generate the capability outcomes"
// RequirementsOutcomes outcomes = requirmentsOutcomeFactory.buildRequirementsOutcomesFrom(testOutcomes)
// def applesFeatureOutcomes = outcomes.requirementOutcomes.find { it.requirement.name == 'Apples'}
// then:
// applesFeatureOutcomes.subrequirements.withResult("success") == 1
// and:
// applesFeatureOutcomes.subrequirements.withResult("failure") == 1
// and:
// applesFeatureOutcomes.subrequirements.withResult("pending") == 0
// }

def "should count the percentage of nested requirements with tests in a given state"() {
given: "there are two stories with passing tests in the 'Apples' feature"
def testOutcomes = TestOutcomes.of(SampleTestResults.withPassingTestForApples())
def environmentVariables = new MockEnvironmentVariables()
and: "we read the requirements from the directory structure"
RequirementsOutcomeFactory requirmentsOutcomeFactory = new MultipleSourceRequirmentsOutcomeFactory(requirementsProviders,issueTracking, environmentVariables, new ReportNameProvider())
when: "we generate the capability outcomes"
RequirementsOutcomes outcomes = requirmentsOutcomeFactory.buildRequirementsOutcomesFrom(testOutcomes)
def applesFeatureOutcomes = outcomes.requirementOutcomes.find { it.requirement.name == 'Apples'}
then:
applesFeatureOutcomes.subrequirements.proportion.withResult("success") == 0.5
and:
applesFeatureOutcomes.subrequirements.proportion.withResult("failure") == 0.5
and:
applesFeatureOutcomes.subrequirements.proportion.withResult("pending") == 0.0
}
// TODO: Refactor to use recorded test outcomes, not the deprecated PackageRequirementsTagProvider
//
// def "should count the percentage of nested requirements with tests in a given state"() {
// given: "there are two stories with passing tests in the 'Apples' feature"
// def testOutcomes = TestOutcomes.of(SampleTestResults.withPassingTestForApples())
// def environmentVariables = new MockEnvironmentVariables()
// and: "we read the requirements from the directory structure"
// RequirementsOutcomeFactory requirmentsOutcomeFactory = new MultipleSourceRequirmentsOutcomeFactory(requirementsProviders,issueTracking, environmentVariables, new ReportNameProvider())
// when: "we generate the capability outcomes"
// RequirementsOutcomes outcomes = requirmentsOutcomeFactory.buildRequirementsOutcomesFrom(testOutcomes)
// def applesFeatureOutcomes = outcomes.requirementOutcomes.find { it.requirement.name == 'Apples'}
// then:
// applesFeatureOutcomes.subrequirements.proportion.withResult("success") == 0.5
// and:
// applesFeatureOutcomes.subrequirements.proportion.withResult("failure") == 0.5
// and:
// applesFeatureOutcomes.subrequirements.proportion.withResult("pending") == 0.0
// }

def "should count the number of nested requirements with no tests"() {
given: "there are two stories with passing tests in the 'Apples' feature"
Expand Down
2 changes: 1 addition & 1 deletion serenity-smoketests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>serenity-bdd</artifactId>
<groupId>net.serenity-bdd</groupId>
<version>4.0.0-beta-1</version>
<version>4.0.0-beta-2-SNAPSHOT</version>
</parent>
<artifactId>serenity-smoketests</artifactId>
<packaging>jar</packaging>
Expand Down

0 comments on commit ffc6682

Please sign in to comment.