JMeter don't execute all request of my test plan - performance

This is my Test plan:
Test Plan
|- Thread Group A
| |- Login
| |- HTTP request1
| |- HTTP request2
| |- ForEach Controller
| |- HTTP request3
| |- HTTP request4
| |- ForEach Controller
| |- HTTP request5
When I run it, JMeter execute only Login and HTTP request1
In the view results tree :

Any chance you have Successes box ticked in the View Results Tree listener?
If yes, it might be the case your HTTP Request 2 sampler fails and doesn't produce anything for the ForEach Controller.
Try unticking Successes box
Inspect jmeter.log file (lives in "bin" folder of your JMeter installation) for any suspicious entries
Run your test in command-line non-GUI mode and check .jtl results file - it should have all Sample Results included

Related

Can't configure cypress in Laravel. cy.request () failed trying to load

Can't set up cypress in Laravel. I followed this example, but, unfortunately, everything breaks down at the initial stages. What could be wrong? First time I'm doing this.
Example I'm doing: https://github.com/laracasts/cypress.
Screenshots: Error 1 | Error 2
Env files: env.cypress | env | cypress.json

JMeter WebDriver Subsample labels not appearing in results

When using the WebDriver plugin for JMeter and using subsamples the labels that are set during the test do not appear in the results jtl file (and therefore the results tree/aggregate report etc.
WebDriver code (name = TestSampler):
WDS.sampleResult.subSampleStart('First SubSample')
...
WDS.sampleResult.subSampleEnd(true)
WDS.sampleResult.subSampleStart('Second SubSample')
...
WDS.sampleResult.subSampleEnd(true)
Desired outcome:
result.jtl file:
...
1603546255925,1000,First SubSample,,,ThreadGroup 1-1,text,true,,0,0,1,1,null,0,0,0
1603546257658,1000,Second SubSample,,,ThreadGroup 1-1,text,true,,0,0,1,1,null,0,0,0
Actual outcome:
result.jtl file:
...
1603546255925,1000,TestSampler-0,,,ThreadGroup 1-1,text,true,,0,0,1,1,null,0,0,0
1603546257658,1000,TestSampler-1,,,ThreadGroup 1-1,text,true,,0,0,1,1,null,0,0,0
note that the only difference is that the value passed to the ...subSampleStart(label) function appears in the result file instead of an indexed version of the sampler name.
Add the next line to user.properties file:
subresults.disable_renaming=true
Restart JMeter to pick the property up
Next time you will run your test you will see expected names
For GUI mode you can tick Functional Test Mode box on Test Plan level:
More information:
JMeter Bug 62550 - Modify SubResult Naming Policy
Apache JMeter Properties Customization Guide
Configuring JMeter

How to have code coverage for test packages in Go

I'm trying to generate the code coverage for my golang project.
My setup is as follows:
- my_project
| - my_package
| | - my_dev_file.go
| | - test
| | | - my_dev_file_test.go
This setup allows to test the code from the point of view of a client that would call the package, without knowing anything about its internal implementation. At the sale time, dev dirs and test dirs are clearly separated which enforces global readability of the project.
The test code looks like this:
import (
"..."
"testing"
"path-to/my_package"
"..."
)
func TestSomething(t *testing.T) {
t.Run("should do something", func(t *testing.T) {
my_package.MyStruct.DoSomething()
// test something...
})
}
This setup works fine as far as testing is concerned.
However, i can't seem to be able to generate a coverage report. Coverage is 0% whatever command i launch, starting with:
go test -coverprofile=coverage.out ./.../test
OK path-to/test 0.005s coverage: 0.0% of statements
OK other-path-to/test 0.007s coverage: 0.0% of statements
I'm looking for a way to generate proper code coverage without compromising the way the project is organized.
Is it possible to do so?
You should run
go test -coverprofile=coverage.out ./...

Unable to see Response Body in JMeter, View Results Tree listener

When I run a Http Request, to a page that should return a response body (I know it's working because I already tried in Postman). When I execute the sampler it's sends a 200 OK code, but the response body in the View Results Tree Listener, is empty. Why does this happen?
I use MAC OS, and I installed JMeter with Brew. I've already tried to add the following information in the user.properties file:
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true
jmeter.save.saveservice.samplerData=true
jmeter.save.saveservice.requestHeaders=true
jmeter.save.saveservice.url=true
jmeter.save.saveservice.responseHeaders=true
It looks like this:
I had this exact issue, and the final answer was to use either Java version 9 or in my case it was Java version 8. That fixed the issue and I am now able to see the response body and response headers.
The changes you've made don't have any impact onto View Results Tree listener output, they are only for .jtl results files.
Try the following:
Run your JMeter test in command-line non-GUI mode like
jmeter -n -t test.jmx -l result.xml
and open result.xml file with your faviourite text or XML viewer/editor. You should see something like:
<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<httpSample t="93" it="0" lt="93" ct="42" ts="1568029799118" s="true" lb="HTTP Request" rc="200" rm="OK" tn="Thread Group 1-1" dt="text" by="759" sby="139" ng="1" na="1">
<responseData class="java.lang.String">{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": false
}</responseData>
<java.net.URL>http://jsonplaceholder.typicode.com/todos/1</java.net.URL>
</httpSample>
</testResults>
where responseData tag contains XML-escaped response data. If there is some data in the file - most probably something is wrong with your JMeter installation, try re-installing it by downloading JMeter from the official website as the Brew package might be broken.
Check jmeter.log file contents, if anything goes wrong JMeter normally writes a log message with the results.
I see you didn't load the generated *.jtl file in your "View results Tree" panel. You should browse and open that file and then you can see the results. Remember, you must add the listener, run the tests in non-GUI mode once, and the *.jtl file would then contain the results. Open them here:
And I think the correct results are not shown.

Could not retrieve information from environment production source

I'm using puppet as my provisioner in one of my vagrant project. I'm trying to add a module for a custom bash_profile.
The module_path for puppet is set to:
puppet.module_path = "puppet/modules"
The class for my bash_profile module looks like this:
class bash_profile
{
file
{
"/home/vagrant/bash_profile":
ensure => present,
source => "puppet:///modules/bash_profile/files/bash_profile"
}
}
Here's the file structure for my puppet structure:
puppet
| manifests
| | phpbase.pp // my main manifest file that has includes for modules
| modules
| | bash_profile
| | | files
| | | | bash_profile // the actual bash_profile file I want to ensure is present on my VM
| | | manifests
| | | | init.pp // the init file included for the bash_profile class
When I run the provisioning for vagrant, I get the error
err: /Stage[main]/Bash_profile/File[/home/vagrant/bash_profile]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///modules/bash_profile/files/bash_profile at /tmp/vagrant-puppet-1/modules-0/bash_profile/manifests/init.pp:8
I'm not sure why it can't retrieve the information. The path seems to be correct. Can anyone see what I'm missing?
Yes, you are not supposed to include the literal files/ in the URL. Instead, it should just be
puppet:///modules/bash_profile/bash_profile
You may also receive this error with recurse => true if your module name is invalid. For instance, if you have this module structure:
modules
├── my-example
│   └── files
│   └── example
│   └── test.txt
and this resource:
file { "/tmp/example":
ensure => directory,
recurse => true,
source => "puppet:///modules/my-example/example",
}
you'll get this error:
==> default: Info: Could not find filesystem info for file 'my-example/example' in environment production
==> default: Error: /Stage[main]/Main/Node[default]/File[/tmp/example]: Could not evaluate: Could not retrieve information from environment production source(s) puppet:///my-example/example
The fix is to rename the module—for instance, naming it my_example fixes it. The rules for module names are documented but easy to miss.
Things to care about
The Puppet URI format puppet:///modules/name_of_module/filename
The fileserver directory to be present in the module directory
This video is an shows step-by-step guide to resolve the error

Resources