Fix vaadin latest dep tests (#6506)
This commit is contained in:
parent
a83e6ca652
commit
b6d264e363
|
@ -69,7 +69,4 @@ dependencies {
|
||||||
|
|
||||||
add("vaadin14LatestTestImplementation", "com.vaadin:vaadin-spring-boot-starter:14.+")
|
add("vaadin14LatestTestImplementation", "com.vaadin:vaadin-spring-boot-starter:14.+")
|
||||||
add("latestDepTestImplementation", "com.vaadin:vaadin-spring-boot-starter:+")
|
add("latestDepTestImplementation", "com.vaadin:vaadin-spring-boot-starter:+")
|
||||||
// to work around https://github.com/vaadin/flow/issues/13952
|
|
||||||
// can be removed after a new version of vaadin-spring-boot-starter has been released
|
|
||||||
add("latestDepTestImplementation", "com.vaadin:flow-server:+")
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ package test.vaadin
|
||||||
|
|
||||||
import com.vaadin.flow.server.Version
|
import com.vaadin.flow.server.Version
|
||||||
import io.opentelemetry.api.trace.SpanKind
|
import io.opentelemetry.api.trace.SpanKind
|
||||||
|
import io.opentelemetry.sdk.trace.data.SpanData
|
||||||
|
|
||||||
abstract class AbstractVaadin16Test extends AbstractVaadinTest {
|
abstract class AbstractVaadin16Test extends AbstractVaadinTest {
|
||||||
static final boolean VAADIN_17 = Version.majorVersion >= 4
|
static final boolean VAADIN_17 = Version.majorVersion >= 4
|
||||||
|
@ -55,6 +56,7 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
|
||||||
childOf span(0)
|
childOf span(0)
|
||||||
}
|
}
|
||||||
int spanIndex = 2
|
int spanIndex = 2
|
||||||
|
sortHandlerSpans(spans, spanIndex, handlers)
|
||||||
handlers.each { handler ->
|
handlers.each { handler ->
|
||||||
span(spanIndex++) {
|
span(spanIndex++) {
|
||||||
name handler + ".handleRequest"
|
name handler + ".handleRequest"
|
||||||
|
@ -73,6 +75,7 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
int spanIndex = 2
|
int spanIndex = 2
|
||||||
|
sortHandlerSpans(spans, spanIndex, handlers)
|
||||||
handlers.each { handler ->
|
handlers.each { handler ->
|
||||||
span(spanIndex++) {
|
span(spanIndex++) {
|
||||||
name handler + ".handleRequest"
|
name handler + ".handleRequest"
|
||||||
|
@ -101,6 +104,7 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
|
||||||
childOf span(0)
|
childOf span(0)
|
||||||
}
|
}
|
||||||
int spanIndex = 2
|
int spanIndex = 2
|
||||||
|
sortHandlerSpans(spans, spanIndex, handlers)
|
||||||
handlers.each { handler ->
|
handlers.each { handler ->
|
||||||
span(spanIndex++) {
|
span(spanIndex++) {
|
||||||
name handler + ".handleRequest"
|
name handler + ".handleRequest"
|
||||||
|
@ -133,6 +137,7 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
int spanIndex = 2
|
int spanIndex = 2
|
||||||
|
sortHandlerSpans(spans, spanIndex, handlers)
|
||||||
handlers.each { handler ->
|
handlers.each { handler ->
|
||||||
span(spanIndex++) {
|
span(spanIndex++) {
|
||||||
name handler + ".handleRequest"
|
name handler + ".handleRequest"
|
||||||
|
@ -149,4 +154,12 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void sortHandlerSpans(List<SpanData> spans, int startIndex, List<String> handlers) {
|
||||||
|
spans.subList(startIndex, startIndex + handlers.size()).sort({
|
||||||
|
// strip .handleRequest from span name to get the handler name
|
||||||
|
def handlerName = it.name.substring(0, it.name.indexOf('.'))
|
||||||
|
return handlers.indexOf(handlerName)
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue