Jest Test On TeamCity - continuous-integration

I have a react application that uses Jest and jest-teamcity-reporter as a testResultsProcessor
my npm test scripts is as follow :
the problem is when i run my build in team city which contains test coverage, the test is running but i cannot see the test tab in the result and also the number of test passed.
in the logs i have the following errors :
Please note that i have other projects with the same template and i don't have a problem seeing the test tab and the metrics
finally here is my build steps defined in the template
Could you please help me with this problem.
Thank you.

You have to add the test result processor in your jest configuration object inside your package.json.
"testResultsProcessor": "jest-teamcity-reporter"
To test locally, you need to set a variable in command line : SET TEAMCITY_VERSION=1
You will see logs lines starting with ##teamcity and that's the metrics you're looking for.

Related

Why Cypress gives success after second attempt?

In my Cypress tests, I create some data in before block and then my test script is run that locates in it block. I checked business side flow and it seems like there is no error about app side. I just want to understand that why my test's result is success after second attempt. Does Cypress has this kind of solution to handle an error maybe?
Cypress has the ability to automatically retry any failed tests. I would check your Cypress configuration's value for retries.openMode.

Spring Boot Test - Reduce Console Output

We are acutally using Spring Boot 1.5.8 and as I can see, we haven't specified a specific logging framework. I'm responsible for JUnit tests as junior developer. We have about 17'000 Unit tests. When I run a lot of tests, IntelliJ can't or has performance issues with handling the console output. And I gave IntelliJ a lot of power ...
Now I adjusted the Log.LEVEL in application.yml to WARN, which works fine. But then I tried to get rid of the HTTP response & request output in the console. But even when I turn off the logging with
logging:
level:
root: WARN
in application.yml it still shows HTTP requests & responses like this:
this is filling up the console depending on the request with hundreds or thousand lines of in some cases unnecessary code!
I'm looking for an option to turn this off ... please help me. I was searching for a while, but couldn't find a answer. Probably I'm on a completely wrong road with looking after Spring Boot Logging. Thank you =)
Edit:
As an other example:
I get an error an the following console output. I just need the first lines of the start and the red (+ some additional) lines. As you can see on the scrollbar, this is just a small piece of the complete output! Acutally 7033 lines (!) are filled with HTTP request & responses like the one in the first picture.
Eek! You used:
logging:
level:
root: WARN
which is yaml format! (it would work just fine if you renamed your file application.yml)
I believe you need to express it like this:
logging.level.root=WARN
which is the correct way to express it in an application.properties file.
By chance I found the solution. I had to set print = MockMvcPrint.NONE in the #AutoConfigureMockMvc annotation. It seems like this collected the HTTP request & respones for each failed test and print everything whenever a test fails! This led to an tremendous output after some failures!

wercker how to show tests informations in the status badge

The only information I can show in my github repo is the build status
Is there a possible way to show additional information, like test coverage, skipped tests ... ?
Not at the moment. You can add the suggestion here

Teamcity jmeter Performance Metrics Calculation: Check reference values

I have setup TeamCity with JMeter plugin. Under Build Configuration -> Build Features, I selected 'Performance metrics calculation'. I can see the build log is cumulative with previous execution results. However, when checking for failure conditions in the build log for 404 or 500 status code, it always fails if at least one previous instance has these response codes. Without this, the build always says Pass even if there are couple of requests that fail with error codes.
Under 'Check reference values', is it possible to set reference values to check the metrics against responsecode for errors? The only available options are 'Average', '90% line' and 'Max'. Any insight into how I can add options to select and search for error response codes?
Screenshots attached for reference
Thank you.
TeamCity JMeter Performance Metrics Collection
The plugin is open source so theoretically you should be able to add required metric to check.
As a workaround I can suggest using Response Assertion to check response codes. If you need to test only "200" status code - it will be the matter of only one assertion (same level as HTTP Request samplers).
See How to Use JMeter Assertions in Three Easy Steps article for more details on conditionally failing JMeter requests

JUnit Scripts Does not run with JMeter

I have the JUNIT code in my eclipse
My workflow is as follows:
Login to an Web Application
Enter the userID and password.
Create some User
Log out
when i try to execute this script using the JMeter it could not succeeded.
MY JMeter does only launch the browser and get into my web application, after that it gets failed.
But my JUnit code works fine when execute using eclipse
Can some one help me in this?
Make sure that the correct Classname/Test Method is selected in the JUnit Request Sampler. Make sure errors are appended by checking the boxes as in the image below.
Use the fail() method to debug. Put it in your catch blocks or wherever needed.
If that seems too tedious to you then write your own mini logger (or use an existing one) and append all errors to a file. (Probably the best option).
Just throwing it out there: it is possible to use JOptionPane.showMessageDialog(null, e.toString()); to debug by adding the rt.jar from your jdk folder. This can get annoying though...
For setup or tutorial please see Jmeter Junit Issue

Resources