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

Add integration tests for Hilla support #219

Open
heruan opened this issue May 17, 2023 · 0 comments
Open

Add integration tests for Hilla support #219

heruan opened this issue May 17, 2023 · 0 comments
Assignees
Labels

Comments

@heruan
Copy link
Member

heruan commented May 17, 2023

Now that we have a Hilla module for backend and frontend observability, we need to verify that data is exported correctly.

We can approach this in the same way we did for flow, using the OTLP exported and a MockServer instance:

@ExtendWith(MockServerExtension.class)
@MockServerSettings(ports = { MainViewIT.EXPORTER_ENDPOINT_PORT })
public class MainViewIT extends AbstractViewIT {
static final int EXPORTER_ENDPOINT_PORT = 4318;
private static final int AWAIT_TIMEOUT = 15;
private ClientAndServer collector;
@BeforeEach
public void navigateToView(ClientAndServer collector) throws Exception {
this.collector = collector;
this.collector.when(request()).respond(response().withStatusCode(200));
// Wait for the view to be rendered
waitUntil(driver -> $(H1Element.class).exists());
}
@BrowserTest
public void verifyExportedTraces() {
await().atMost(AWAIT_TIMEOUT, TimeUnit.SECONDS).untilAsserted(() -> {
var requests = collector.retrieveRecordedRequests(request());
var spans = extractSpansFromRequests(requests);
assertThat(spans).extracting(Span::getName)
.contains("SessionRequestHandler.handleRequest");
});
}

@heruan heruan added the testing label May 17, 2023
@heruan heruan linked a pull request Jun 20, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants