Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snippet Injection Smoke Test #8655

Merged
merged 9 commits into from
Jun 7, 2023
Prev Previous commit
Next Next commit
add corner case for tomcat 7
  • Loading branch information
siyuniu-ms committed Jun 7, 2023
commit 07fe2d3f03e1a4aa883fde26d62d24d8e1edf961
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,18 @@ abstract class AppServerTest extends SmokeTest {

responseBody.contains("<script>console.log(hi)</script>")

traces.countSpansByKind(Span.SpanKind.SPAN_KIND_SERVER) == 1

traces.countSpansByName('GET /app/jsp') == 1

if (expectServerSpan()){
traces.countSpansByKind(Span.SpanKind.SPAN_KIND_SERVER) == 1
traces.countSpansByName('GET /app/jsp') == 1
}
where:
[appServer, jdk] << getTestParams()
}

protected boolean expectServerSpan() {
true
}

protected String getSpanName(String path) {
switch (path) {
case "/app/greeting":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ abstract class TomcatSmokeTest extends AppServerTest {
protected TargetWaitStrategy getWaitStrategy() {
return new TargetWaitStrategy.Log(Duration.ofMinutes(1), ".*Server startup in.*")
}

@Override
protected boolean expectServerSpan() {
if (this.serverVersion == "7.0.109") {
return false
}
return true
}
}

@AppServer(version = "7.0.109", jdk = "8")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,6 @@ abstract class WildflySmokeTest extends AppServerTest {
return new TargetWaitStrategy.Log(Duration.ofMinutes(1), ".*started in.*")
}

@Unroll
def "JSP smoke test on WildFly"() {
when:
def response = client().get("/app/jsp").aggregate().join()
TraceInspector traces = new TraceInspector(waitForTraces())
String responseBody = response.contentUtf8()

then:
response.status().isSuccess()
responseBody.contains("Successful JSP test")

traces.countSpansByKind(Span.SpanKind.SPAN_KIND_SERVER) == 1

traces.countSpansByName('GET /app/jsp') == 1

where:
[appServer, jdk] << getTestParams()
}
}

@AppServer(version = "13.0.0.Final", jdk = "8")
Expand Down
Loading