question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] Assertions vs. Checks UI

See original GitHub issue

Given this test definition:

testDefinition:
- selector: span[name = "POST /pokemon/import"]
  assertions:
  - tracetest.span.duration <= 50ms
  - http.status_code = 200
  - tracetest.response.body contains 52
- selector: span[name = "queue.synchronizePokemon send"]
  assertions:
  - messaging.payload contains 52

I read this as "I have two tests or checks. In this first test / check I am asserting 3 things (ie. I have 3 assertions).

However the UI flips these definitions and calls the assertions above, checks. So according to the UI, I have 2 assertions. Assertion 1 contains 3 checks and assertion 2 contains 1 check.

Can someone clarify which was round is correct?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jorgeepccommented, Aug 8, 2022

I agree with @agardnerIT in the following structure:

Test – has a set of checks – with a selector – that can match multiple spans – and apply multiple assertions against these selected spans

In my mind, an assertion is one single affirmation, and most test tools use that term with a similar meaning.

Maybe we can find a new word for check that makes it easier to understand the concept of selector + assertions. Any idea?

1reaction
agardnerITcommented, Aug 7, 2022

Perhaps for above: I have one test. The test consists of two checks defined by one selector for each test. Check #1 contains 3 assertions. Check #2 contains one assertion.

Sidenote - the UI doesn’t opinionated on when a “check” fails (ie. if all 3 assertions fail, is the “check” assumed to have failed?)

Read more comments on GitHub >

github_iconTop Results From Across the Web

what is the difference between triggers, assertions and ...
Both CHECK and ASSERTION are database constraints defined by the SQL standards. An important distinction is that a CHECK is applied to a ......
Read more >
which is better, using Assert[] or manual checks on ...
Like in other programming languages, such as C or Java, assertions are used to catch errors in the logic of your code.
Read more >
Difference between Assertions and Triggers in DBMS
DBMS always checks the assertion whenever modifications are done in the corresponding table. Syntax –. CREATE ASSERTION [ assertion_name ] CHECK ...
Read more >
Assert and Verify Methods in Selenium
In Selenium, Asserts are validations or checkpoints for an application. Assertions state confidently that application behavior is working as ...
Read more >
Python's assert: Debug and Test Your Code Like a Pro
These checks are known as assertions, and you can use them to test if certain assumptions remain true while you're developing your code....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found