Fix vaadin latest dep tests (#6506)

This commit is contained in:
Lauri Tulmin 2022-08-24 19:20:31 +03:00 committed by GitHub
parent a83e6ca652
commit b6d264e363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -69,7 +69,4 @@ dependencies {
add("vaadin14LatestTestImplementation", "com.vaadin:vaadin-spring-boot-starter:14.+")
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:+")
}

View File

@ -8,6 +8,7 @@ package test.vaadin
import com.vaadin.flow.server.Version
import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.sdk.trace.data.SpanData
abstract class AbstractVaadin16Test extends AbstractVaadinTest {
static final boolean VAADIN_17 = Version.majorVersion >= 4
@ -55,6 +56,7 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
childOf span(0)
}
int spanIndex = 2
sortHandlerSpans(spans, spanIndex, handlers)
handlers.each { handler ->
span(spanIndex++) {
name handler + ".handleRequest"
@ -73,6 +75,7 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
}
int spanIndex = 2
sortHandlerSpans(spans, spanIndex, handlers)
handlers.each { handler ->
span(spanIndex++) {
name handler + ".handleRequest"
@ -101,6 +104,7 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
childOf span(0)
}
int spanIndex = 2
sortHandlerSpans(spans, spanIndex, handlers)
handlers.each { handler ->
span(spanIndex++) {
name handler + ".handleRequest"
@ -133,6 +137,7 @@ abstract class AbstractVaadin16Test extends AbstractVaadinTest {
}
int spanIndex = 2
sortHandlerSpans(spans, spanIndex, handlers)
handlers.each { handler ->
span(spanIndex++) {
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)
})
}
}