How to showDiff using pm.expect assertion in Postman - postman

I am trying to show the when a pm.expect assertion fails the diff between the actual and expected. I see when there is a failure in the console the showDiff: false reported. I would like to set this flag to true. I have looked and searched for how to set this flag but I haven't been able to find the answer. I am guessing I just have looked in the right place. So to summarize I want to output to the console the assertion diff and I am looking for the flag or how to set the showDiff bool to true for my assertions in Postman. Thank you.

Related

How can I get more information when debugging a contract violation that checks for equality

I have the following Eiffel code. I am doing test-driven-design with contracts.
check
sorter.sorted (<<1>>).is_equal (<<1>>)
end
The code correctly detects that my sort returns the wrong value. However it would be nice to see what sorted returned. I can see that it is too late as is_equals consumes both values, and returns false, before the check throws the exception.
I have seen in other testing frameworks they have a special is_equal for the test framework. That allows better feedback. e.g.
check_equal(expected, value_under_test)
Is there anything like this in eiffel?
I would suggest looking at library testing. In particular, class EQA_COMMONLY_USED_ASSERTIONS has feature assert_equal that seems to do what you want to:
assert_equal (a_tag: READABLE_STRING_GENERAL; expected, actual: detachable ANY)
-- Check that `expected ~ actual'.
The original example would then look like
assert_equal ("Is array sorted?", sorter.sorted (<<1>>), <<1>>)
Note that check statements are not "debug" statements:
check statements are to ensure the correctness (i.e. trigger on errors), while debug statements help to understand what's going on.
To debug your code once a check failed, you would add debug statements that output information before the check triggers.

google-cloud-build PyPi 400 errors

I am currently receiving 400 errors when invoking the list_builds() method (seen here: https://googleapis.dev/python/cloudbuild/latest/gapic/v1/api.html?highlight=list_builds#google.cloud.devtools.cloudbuild_v1.CloudBuildClient.list_builds)
The following command works using gcloud:
gcloud builds list --filter="status=FAILURE"
However, the following API call returns google.api_core.exceptions.InvalidArgument: 400 Error processing filter expression
for element in client.list_builds("REDACTED", filter_="status=FAILURE"):
# process element
pass
I'm guessing I'm missing something very obvious and simple here but I can't exactly figure out what I'm doing wrong
The correct way to pass in the filter string to the API call includes using double apostrophes around the actual text like so:
filter_='status="FAILURE"'
Unsure of whether or not this will be changed in the future, but this is the same behavior for passing it in via the REST API here: https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds/list
e.g specifiying status=FAILURE will fail, but status="FAILURE" returns a 200 response.
welcome to Stack O! So I'm just spitballing here, but the docs say that the Filter string is "The raw filter text to constrain the results."
When you filter a Cloud Build in the console, the "raw filter text" in the UI says Status : Failed - you could try:
--filter="Status : Failed"
--filter="Status: Failed"
--filter="Status:Failed"
Alternately, it might be the string in the URL, the formatting of which is too bananapants for Stack O's robots to handle, so I can't paste it here, but it starts with f and ends with Failed:
The key here is that you have an equal sign in your string, as well as Failure instead of Failed - changing one or both of those might do the trick.
Hope this helps!

Trouble Adding Publishing Action to append to an existing big query table?

I have a dataflow flow that appends to an existing bigquery table which has been working for the last few weeks. When i run it now it gives me the error "Cannot run job. Please reload the page and try again." and won't even start the job.
After trying a lot of things, i made a copy of the flow and when the publishing action is creating a new csv file, it works but when i try to
Add a publishing action to an existing big query table,it keeps giving me another bizarre error "SyntaxError: Unexpected token C in JSON at position 0".
I have no idea what is happening since everything used to work perfectly and i made no changes whatsoever.
I am not adding anything new, but I want to give you an answer.
It seems that one of your JSON inputs may be malformed. Try logging it to see what's the problem - and also try skipping malformed JSON strings.
As mentioned in past comments, I suggest to check your logs in StackDriver to find out why are you getting the:
"Cannot run job. Please reload the page and try again."
Also if you can retrieve more information about the error from those logs, It'd be useful to assist you further.
Besides the above, maybe we can solve this issue easier by only just checking the json format, here I put an easy third party json validator and here you can check where you have the error in your json.

Use of if controller for check condition in jmeter

I need to add a check condition for the search result page that, if a search result is found, the script should run further otherwise it should stop on the same step.
This is my Condition in if controller:
${__javaScript("${depdate}"=! null)}
Here depdate is the regex parameter. If search results are found then its value will be null otherwise it will display content. It's a part of a json string.
I have put all further step in the if controller, but not success. Can anyone help me out of this? What is the reason that this is not working.
What is wrong here with what I am performing?
The reason is that your "${depdate}" will never be null.
If ${depdate} variable is set - it will be variable value
If ${depdate} variable is not set - it will be default value (which is ${depdate}
Demo:
So change your expression to be `${__javaScript(vars.get("depdate") != null)} and everything should start working fine.
See How to Use JMeter's 'IF' Controller and get Pie guide for more information on using IF conditions in your JMeter test.

Customize CakePHP Test Suite Messages

I want to confirm that, is this possible to customize Cakephp test suite(Unit Testing) message to our desired message on success & failed by default? It shows the following message
Now i want to customize time duration micro second to second by rounding function & also change Passed message to success OR my own message. How can i achieved this goal?
Thanx in Advance
Within ./lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php you can modify how the TestSuite reports stats.
I'm using a different version of CakePHP, but for me, Line 151 is this:
echo '<p><strong>Time:</strong> ' . $result->time() . ' seconds</p>';
You can take the $result->time() and run it through whatever PHP functions you want to get the output you're after. For that matter $result is set during your test cases is it not?