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

Build Fails with all assertions passing #24

Open
tevyt opened this issue Jun 27, 2018 · 2 comments
Open

Build Fails with all assertions passing #24

tevyt opened this issue Jun 27, 2018 · 2 comments

Comments

@tevyt
Copy link

tevyt commented Jun 27, 2018

I set up a simple build configuration on TeamCity. There is a test script that contains only a duration assertion. If I select the option to fail the build if an assertion fails the build fails regardless of the actual assertion of the status. I'm using the latest version of the plugin with TeamCity 2017.2 with jmeter 4.0.

Metrics are being collected and graphs are being displayed as expected.

@tevyt tevyt changed the title Build Fails All assertions passing Build Fails with all assertions passing Jun 27, 2018
@joao-carloto
Copy link

Not sure if it's the same issue, But if I have the option to fail the build if an assertion fails, all builds will fail, even if no assertion is present on the JMeter test script

@joao-carloto
Copy link

joao-carloto commented Sep 13, 2018

This seems an issue similar to what was reported here: https://teamcity-support.jetbrains.com/hc/en-us/community/posts/208505885-Need-help-to-get-TeamCity-to-report-the-results-of-my-JMeter-tests-correctly
In this post the, "solution" was to format the .jtl file with an awk script.

In my case, since I'm using a Windows machine, I used the following power shell script and now the "assertions" option is working as expected.
Basically, I'm changing the position of the "success" column.

param(
[string]$source,
[string]$destination
)

$reader = [System.IO.File]::OpenText($source)
$writer = New-Object System.IO.StreamWriter $destination
for(;;) {
$line = $reader.ReadLine()
if ($null -eq $line) {
break
}
$data = $line.Split("t") $writer.WriteLine("{0}t{1}t{2}t{3}t{4}t{5}t{6}t{7}",
$data[0],
$data[1],
$data[2],
$data[7],
$data[3],
$data[4],
$data[5],
$data[6])
}
$reader.Close()
$writer.Close()

To notice that the resulting format (which works) is the following:
timeStamp elapsed label success responseCode responseMessage threadName dataType

Documentation mentions:
timeStamp elapsed label responseCode success responseMessage thread dataType

I had to dig in the Item.java file of this repository to check how the plugin actually works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants