How to send Junit test results to InfluxDB - reporting

Currently, I've some tests suite in place with me using Junit 5. Wanted to send the test result metrics to Grafana. I'm thinking of sending the test results to Influx db and re-route it to Grafana at the end. Is there a way to use Sunfire XML file to achieve this use case?

I am planning to do the same, and I found this on the web.
https://medium.com/detesters/how-to-store-junit-tests-in-an-influxdb-7faf63dd562a
I will do more research and am thinking of creating a junit5 extension to do this. If I have a solution, I will post it here.

Related

Xray Cloud test execution status

Is there a way to obtain the status of every test (passed or failed) of a test execution using API REST in Xray Cloud?
I have a Jira Cloud with Xray where I import a Junit XML and I want to be able to get a file with the status of the test imported
For that purpose you need to use Xray Cloud's GraphQL API.
Here are some code examples for that:
in JavaScript
in Python
You can actually use different GraphQL functions for that but the getTestExecutions may be the most appropriate one.
You'll need to specify that you want the testRuns object on the results.

Start a springboot project for each test case

We are developing test cases for a micro service using Spring Boot. One of the requirement is that for each Junit test case we need to:
start the project
test a unit case and
then stop the project .
I feel this is an anti pattern, but this is the requirement.
I looked around internet but couldn't find a solution for the same. I was able to start a web server but it provided no response and this might be because the project is not assigned to the server.
Does anyone have any idea on how this can be achieved?
PS: We don't want to use Mockito
Before hand i want to make clear that this a very bad practice and should be avoided. This approach does not implement unit tests concept correctly because you are testing an entire system up, so JUnit wouldn't be the correct tool.
I pocked around and i don't seem to find a Runner that may be able to do this (does not surprise me although), the most similar Runner may be SpringJUnit4ClassRunner which provides you a complete Spring context in your test space, but won't go live with the application.
An approach i'd suggest if you really want to go with this is to use tools like REST Assured to do End-to-End API layer tests against the live application, but this implies that you have to find another way to start the app, and then point the REST Assured tests to that started app. Maybe a shell script that starts the app and then starts the REST Assured tests suits, then when the suit ends put down the server.
I highly suggest you to chat with your product/management teams to avoid this kind of stuff since the tests will take FOREVER to run and you will be polluting your local or remote DBs if you are persisting data or other systems through REST or SOAP calls.

Unit tests for Parse Cloud Code?

I have an application which uses Cloud Code as backend. Is there any way to write unit tests for Parse Cloud Code?
Try this:How to use unit tests with parse cloud code
You can write various set of cloud functions to perform the tests you want to run. You can then call them via the REST API or execute them in a scheduled background Job.

Spring load testing

I've implemented a testing unit using spring (mock mvc), and I'm looking for a tool to run this unit in many threads/processes (so it will act as load testing for my server). I've seen applications like the grinder and jmeter but I don't want to re-write the entire unit, but just to use the existing one. Any ideas?
JMeter is able to execute existing JUnit tests via JUnit Request sampler, all you need to do is to drop jar(s) with your test along with dependencies somewhere in JMeter classpath and restart JMeter. Once done you'll be able to see your classes and methods in JUnit Request sampler dropdown and execute them in multithreaded manner.
See How to Use JUnit With JMeter guide for more detailed instructions and explanations.

Is there a Web-UI out there for creating test's using htmlunit?

I want to be able to create the test's inside the Web-UI instead of writing them in code. Also i want to automate the tests and have extensive reporting.
I am restricted to htmlunit because the websites i am testing are testable with htmlunit.
You can define the test steps in other ways, see WebDriver recorder, WebTest and Wetator.
There is Spring MVC Test HtmlUnit also.

Resources