Skip to content

Commit

Permalink
Merge pull request #5644 from telstra/test/gradle-retry-rename_parame…
Browse files Browse the repository at this point in the history
…terized_method

[TEST]: 5633: Gradle retry: Updating tests name
  • Loading branch information
IvanChupin authored May 8, 2024
2 parents 304ac77 + f346ff4 commit fc395cc
Show file tree
Hide file tree
Showing 20 changed files with 185 additions and 224 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import org.springframework.web.client.HttpClientErrorException
import spock.lang.Narrative
import spock.lang.See
import spock.lang.Shared
import spock.lang.Unroll

import javax.inject.Provider

Expand Down Expand Up @@ -160,8 +159,7 @@ class FlowCrudSpec extends HealthCheckSpecification {
srcDstStr = "src:${topology.find(flow.source.switchId).hwSwString}->dst:${topology.find(flow.destination.switchId).hwSwString}"
}

@Unroll("Able to create a second flow if #data.description")
def "Able to create multiple flows on certain combinations of switch-port-vlans"() {
def "Able to create multiple flows with #data.description"() {
given: "Two potential flows that should not conflict"
Tuple2<FlowRequestV2, FlowRequestV2> flows = data.getNotConflictingFlows()

Expand Down Expand Up @@ -337,7 +335,7 @@ class FlowCrudSpec extends HealthCheckSpecification {
}

@Tags([TOPOLOGY_DEPENDENT, SMOKE_SWITCHES])
def "Able to create single switch single port flow with different vlan (#flow.source.switchId)"(
def "Able to create single switch single port flow with different vlan (#flow.source.switchId.description)"(
FlowRequestV2 flow) {
given: "A flow"
flowHelperV2.addFlow(flow)
Expand Down Expand Up @@ -389,8 +387,7 @@ class FlowCrudSpec extends HealthCheckSpecification {
~/It is not allowed to create one-switch flow for the same ports and VLANs/).matches(error)
}

@Unroll("Unable to create flow with #data.conflict")
def "Unable to create flow with conflicting vlans or flow IDs"() {
def "Unable to create flow with conflict data (#data.conflict)"() {
given: "A potential flow"
def (Switch srcSwitch, Switch dstSwitch) = topology.activeSwitches
def flow = flowHelperV2.randomFlow(srcSwitch, dstSwitch)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
package org.openkilda.functionaltests.spec.flows

import com.google.common.collect.Sets
import groovy.util.logging.Slf4j
import org.apache.kafka.clients.producer.KafkaProducer
import org.apache.kafka.clients.producer.ProducerRecord
import org.openkilda.functionaltests.HealthCheckSpecification
import static org.openkilda.functionaltests.extension.tags.Tag.ISL_PROPS_DB_RESET
import static org.openkilda.functionaltests.extension.tags.Tag.ISL_RECOVER_ON_FAIL
import static org.openkilda.functionaltests.extension.tags.Tag.SWITCH_RECOVER_ON_FAIL
import static groovyx.gpars.GParsPool.withPool
import static org.junit.jupiter.api.Assumptions.assumeTrue
import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY
import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT
import static org.openkilda.functionaltests.extension.tags.Tag.VIRTUAL
import static org.openkilda.functionaltests.model.cleanup.CleanupActionType.RESET_ISLS_COST
import static org.openkilda.messaging.info.event.IslChangeType.DISCOVERED
import static org.openkilda.messaging.info.event.IslChangeType.MOVED
import static org.openkilda.model.MeterId.MIN_FLOW_METER_ID
import static org.openkilda.testing.Constants.WAIT_OFFSET
import static org.openkilda.testing.service.floodlight.model.FloodlightConnectMode.RW
import static org.openkilda.testing.tools.KafkaUtils.buildMessage

import org.openkilda.functionaltests.error.flow.FlowNotCreatedExpectedError
import org.openkilda.functionaltests.error.flow.FlowNotCreatedWithConflictExpectedError
import org.openkilda.functionaltests.error.flow.FlowNotCreatedWithMissingPathExpectedError
import org.openkilda.functionaltests.error.flow.FlowNotDeletedExpectedError
import org.openkilda.functionaltests.error.flow.FlowNotUpdatedExpectedError
import org.openkilda.functionaltests.error.flow.FlowNotUpdatedWithConflictExpectedError
import org.openkilda.functionaltests.HealthCheckSpecification
import org.openkilda.functionaltests.extension.tags.Tags
import org.openkilda.functionaltests.helpers.PathHelper
import org.openkilda.functionaltests.helpers.Wrappers
Expand All @@ -31,6 +43,11 @@ import org.openkilda.testing.model.topology.TopologyDefinition.Switch
import org.openkilda.testing.service.traffexam.FlowNotApplicableException
import org.openkilda.testing.service.traffexam.TraffExamService
import org.openkilda.testing.tools.FlowTrafficExamBuilder

import com.google.common.collect.Sets
import groovy.util.logging.Slf4j
import org.apache.kafka.clients.producer.KafkaProducer
import org.apache.kafka.clients.producer.ProducerRecord
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.beans.factory.annotation.Value
Expand All @@ -39,26 +56,9 @@ import spock.lang.Ignore
import spock.lang.Narrative
import spock.lang.See
import spock.lang.Shared
import spock.lang.Unroll

import javax.inject.Provider
import java.time.Instant

import static groovyx.gpars.GParsPool.withPool
import static org.junit.jupiter.api.Assumptions.assumeTrue
import static org.openkilda.functionaltests.extension.tags.Tag.ISL_PROPS_DB_RESET
import static org.openkilda.functionaltests.extension.tags.Tag.ISL_RECOVER_ON_FAIL
import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY
import static org.openkilda.functionaltests.extension.tags.Tag.SWITCH_RECOVER_ON_FAIL
import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT
import static org.openkilda.functionaltests.extension.tags.Tag.VIRTUAL
import static org.openkilda.functionaltests.model.cleanup.CleanupActionType.RESET_ISLS_COST
import static org.openkilda.messaging.info.event.IslChangeType.DISCOVERED
import static org.openkilda.messaging.info.event.IslChangeType.MOVED
import static org.openkilda.model.MeterId.MIN_FLOW_METER_ID
import static org.openkilda.testing.Constants.WAIT_OFFSET
import static org.openkilda.testing.service.floodlight.model.FloodlightConnectMode.RW
import static org.openkilda.testing.tools.KafkaUtils.buildMessage
import javax.inject.Provider

@Slf4j
@See(["https://github.com/telstra/open-kilda/blob/develop/docs/design/usecase/flow-crud-create-full.png",
Expand Down Expand Up @@ -149,8 +149,7 @@ class FlowCrudV1Spec extends HealthCheckSpecification {
srcDstStr = "src:${topology.find(flow.source.datapath).hwSwString}->dst:${topology.find(flow.destination.datapath).hwSwString}"
}

@Unroll("Able to create a second flow if #data.description")
def "Able to create multiple flows on certain combinations of switch-port-vlans"() {
def "Able to create multiple flows with #data.description"() {
given: "Two potential flows that should not conflict"
Tuple2<FlowPayload, FlowPayload> flows = data.getNotConflictingFlows()

Expand Down Expand Up @@ -326,7 +325,7 @@ class FlowCrudV1Spec extends HealthCheckSpecification {
}

@Tags([TOPOLOGY_DEPENDENT])
def "Able to create single switch single port flow with different vlan (#flow.source.datapath)"(FlowPayload flow) {
def "Able to create single switch single port flow with different vlan (#flow.source.getSwitchDpId().description)"(FlowPayload flow) {
given: "A flow"
flowHelper.addFlow(flow)

Expand Down Expand Up @@ -377,8 +376,7 @@ class FlowCrudV1Spec extends HealthCheckSpecification {
~/It is not allowed to create one-switch flow for the same ports and VLANs/).matches(error)
}

@Unroll("Unable to create flow with #data.conflict")
def "Unable to create flow with conflicting vlans or flow IDs"() {
def "Unable to create flow with conflict data (#data.conflict)"() {
given: "A potential flow"
def (Switch srcSwitch, Switch dstSwitch) = topology.activeSwitches
def flow = flowHelper.randomFlow(srcSwitch, dstSwitch)
Expand Down Expand Up @@ -412,8 +410,7 @@ class FlowCrudV1Spec extends HealthCheckSpecification {
]
}

@Unroll("Unable to update flow (#data.conflict)")
def "Unable to update flow when there are conflicting vlans"() {
def "Unable to update flow when there are conflicting vlans((#data.conflict))"() {
given: "Two potential flows"
def (Switch srcSwitch, Switch dstSwitch) = topology.activeSwitches
def flow1 = flowHelper.randomFlow(srcSwitch, dstSwitch, false)
Expand Down Expand Up @@ -866,7 +863,7 @@ are not connected to the controller/).matches(exc)
}

/**
* Get list of all unique flows without transit switch (neighboring switches), permute by vlan presence.
* Get list of all unique flows without transit switch (neighboring switches), permute by vlan presence.
* By unique flows it considers combinations of unique src/dst switch descriptions and OF versions.
*/
def getFlowsWithoutTransitSwitch() {
Expand Down Expand Up @@ -894,7 +891,7 @@ are not connected to the controller/).matches(exc)
}

/**
* Get list of all unique flows with transit switch (not neighboring switches), permute by vlan presence.
* Get list of all unique flows with transit switch (not neighboring switches), permute by vlan presence.
* By unique flows it considers combinations of unique src/dst switch descriptions and OF versions.
*/
def getFlowsWithTransitSwitch() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
package org.openkilda.functionaltests.spec.flows

import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs
import static org.junit.jupiter.api.Assumptions.assumeTrue
import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY
import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE
import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT
import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_UNICAST_RULE
import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_UNICAST_VXLAN_RULE_COOKIE
import static org.openkilda.testing.Constants.STATS_LOGGING_TIMEOUT
import static org.openkilda.testing.Constants.WAIT_OFFSET
import static spock.util.matcher.HamcrestSupport.expect

import org.openkilda.functionaltests.HealthCheckSpecification
import org.openkilda.functionaltests.error.flow.FlowNotCreatedExpectedError
import org.openkilda.functionaltests.extension.tags.IterationTag
Expand All @@ -18,18 +29,6 @@ import org.springframework.beans.factory.annotation.Value
import org.springframework.web.client.HttpClientErrorException
import spock.lang.Narrative
import spock.lang.See
import spock.lang.Unroll

import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs
import static org.junit.jupiter.api.Assumptions.assumeTrue
import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY
import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE
import static org.openkilda.functionaltests.extension.tags.Tag.TOPOLOGY_DEPENDENT
import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_UNICAST_RULE
import static org.openkilda.testing.Constants.DefaultRule.VERIFICATION_UNICAST_VXLAN_RULE_COOKIE
import static org.openkilda.testing.Constants.STATS_LOGGING_TIMEOUT
import static org.openkilda.testing.Constants.WAIT_OFFSET
import static spock.util.matcher.HamcrestSupport.expect

@See("https://github.com/telstra/open-kilda/tree/develop/docs/design/flow-ping")
@Narrative("""
Expand All @@ -43,9 +42,8 @@ class FlowPingSpec extends HealthCheckSpecification {
@Value('${flow.ping.interval}')
int pingInterval

@Unroll("Able to ping a flow with vlan between switches #swPair.toString()")
@Tags([TOPOLOGY_DEPENDENT])
def "Able to ping a flow with vlan"(Switch srcSwitch, Switch dstSwitch) {
def "Able to ping a flow with vlan between #switchPairDescription"(Switch srcSwitch, Switch dstSwitch) {
given: "A flow with random vlan"
def flow = flowHelperV2.randomFlow(srcSwitch, dstSwitch)
flow.encapsulationType= FlowEncapsulationType.TRANSIT_VLAN
Expand Down Expand Up @@ -83,10 +81,9 @@ class FlowPingSpec extends HealthCheckSpecification {

where:
[srcSwitch, dstSwitch] << ofSwitchCombinations
swPair = new SwitchPair(src: srcSwitch, dst: dstSwitch, paths: [])
switchPairDescription = "src[$srcSwitch.description $srcSwitch.ofVersion]-dst[$dstSwitch.description $dstSwitch.ofVersion]"
}

@Unroll("Able to ping a flow with vxlan between switches #swPair.toString()")
@Tags([TOPOLOGY_DEPENDENT])
def "Able to ping a flow with vxlan"() {
given: "A flow with random vxlan"
Expand Down Expand Up @@ -121,9 +118,8 @@ class FlowPingSpec extends HealthCheckSpecification {
}
}

@Unroll("Able to ping a flow with no vlan between switches #swPair.toString()")
@Tags([TOPOLOGY_DEPENDENT])
def "Able to ping a flow with no vlan"(Switch srcSwitch, Switch dstSwitch) {
def "Able to ping a flow with no vlan between #switchPairDescription"(Switch srcSwitch, Switch dstSwitch) {
given: "A flow with no vlan"
def flow = flowHelperV2.randomFlow(srcSwitch, dstSwitch)
flow.source.vlanId = 0
Expand All @@ -144,12 +140,12 @@ class FlowPingSpec extends HealthCheckSpecification {

where:
[srcSwitch, dstSwitch] << ofSwitchCombinations
swPair = new SwitchPair(src: srcSwitch, dst: dstSwitch, paths: [])
switchPairDescription = "src[$srcSwitch.description $srcSwitch.ofVersion]-dst[$dstSwitch.description $dstSwitch.ofVersion]"

}

@Unroll("Flow ping can detect a broken #description")
@IterationTag(tags = [SMOKE], iterationNameRegex = /forward path/)
def "Flow ping can detect a broken path for a vlan flow"() {
def "Flow ping can detect a broken path(#description) for a vlan flow"() {
given: "A flow with at least 1 a-switch link"
def switches = topology.activeSwitches.findAll { !it.centec && it.ofVersion != "OF_12" }
List<List<PathNode>> allPaths = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.client.HttpClientErrorException
import spock.lang.See
import spock.lang.Shared
import spock.lang.Unroll

import javax.inject.Provider
import java.util.regex.Pattern
Expand Down Expand Up @@ -705,8 +704,7 @@ class MirrorEndpointsSpec extends HealthCheckSpecification {
}

@Tags([LOW_PRIORITY])
@Unroll("#testData.testName, #testData.mirrorPoint.mirrorPointDirection")
def "Test possible error scenarios during mirror point creation"(MirrorErrorTestData testData) {
def "Test possible error scenarios during mirror point creation: [#testData.testName, #testData.mirrorPoint.mirrorPointDirection]"(MirrorErrorTestData testData) {
given: "A flow"
def flow = testData.flow
flowHelperV2.addFlow(flow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import org.openkilda.testing.model.topology.TopologyDefinition.Isl
import org.springframework.web.client.HttpClientErrorException
import spock.lang.Narrative
import spock.lang.Shared
import spock.lang.Unroll

import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs
import static org.assertj.core.api.Assertions.assertThat
Expand Down Expand Up @@ -562,8 +561,7 @@ class PartialUpdateSpec extends HealthCheckSpecification {
]
}

@Unroll("Unable to partial update flow (#data.conflict)")
def "Unable to partial update flow when there are conflicting vlans"() {
def "Unable to partial update flow when there are conflicting vlans (#data.conflict)"() {
given: "Two potential flows"
def swPair = switchPairs.all().random()
def flow1 = flowHelperV2.randomFlow(swPair, false)
Expand Down Expand Up @@ -696,8 +694,7 @@ class PartialUpdateSpec extends HealthCheckSpecification {
}
}

@Unroll("Unable to partial update flow (maxLatency #maxLatencyAfter and maxLatencyTier2 #maxLatencyT2After)")
def "Unable to partial update flow with maxLatency incorrect value"() {
def "Unable to partial update flow with maxLatency incorrect value(#description)"() {
given: "Two potential flows"
def flow = flowHelperV2.randomFlow(switchPairs.all().random()).tap {
maxLatency = maxLatencyBefore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GrpcCommonSpec extends GrpcBaseSpecification {
sw << getNoviflowSwitches()
}

def "Able to get switch packet in out stats"() {
def "Able to get switch packet in out stats on the #switches.hwSwString (#switches.description) switch"() {
when: "Get switch packet in out stats"
def response = grpc.getPacketInOutStats(switches.address)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class LinkSpec extends HealthCheckSpecification {
getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | null | "dst_port"
}
def "Get links with specifying query parameters"() {
def "Get links with specifying query parameters: #description"() {
when: "Get links with specifying query parameters"
def links = northbound.getLinks(srcSwId, srcSwPort, dstSwId, dstSwPort)
Expand All @@ -477,12 +477,12 @@ class LinkSpec extends HealthCheckSpecification {
}
where:
srcSwId | srcSwPort | dstSwId | dstSwPort
null | null | null | null
getIsl().srcSwitch.dpId | null | null | null
getIsl().srcSwitch.dpId | getIsl().srcPort | null | null
getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | null
getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | getIsl().dstPort
description | srcSwId | srcSwPort | dstSwId | dstSwPort
"without params" | null | null | null | null
"with src(swId)" | getIsl().srcSwitch.dpId | null | null | null
"with src(swId+port)" | getIsl().srcSwitch.dpId | getIsl().srcPort | null | null
"with src(swId+port) and dst(swId)" | getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | null
"with src(swId+port) and dst(swId+port)" | getIsl().srcSwitch.dpId | getIsl().srcPort | getIsl().dstSwitch.dpId | getIsl().dstPort
}
def "Get links with specifying NOT existing query parameters (#item doesn't exist)"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import org.openkilda.northbound.dto.v1.switches.SwitchPropertiesDto
import org.openkilda.testing.model.topology.TopologyDefinition.Switch
import org.openkilda.testing.service.northbound.NorthboundService
import org.springframework.web.client.HttpClientErrorException
import spock.lang.Unroll

import static org.openkilda.functionaltests.extension.tags.Tag.LOW_PRIORITY
import static org.openkilda.functionaltests.extension.tags.Tag.SMOKE
Expand Down Expand Up @@ -81,7 +80,6 @@ class PathsSpec extends HealthCheckSpecification {
}

@Tags(LOW_PRIORITY)
@Unroll
def "Unable to get paths for #problemDescription"() {
when: "Try to get paths between #problemDescription"
switchPair(topology.getSwitches().first(), northbound).getPathsFromApi()
Expand Down Expand Up @@ -144,7 +142,6 @@ class PathsSpec extends HealthCheckSpecification {
}

@Tags(LOW_PRIORITY)
@Unroll
def "Protected path is #isIncludedString included into path list if #isIncludedString requested"() {
given: "Two switches with potential protected path"
def switchPair = switchPairs.all()
Expand Down
Loading

0 comments on commit fc395cc

Please sign in to comment.