k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Test summary check filter

Open Doomann opened this issue 1 year ago • 4 comments

Feature Description

I suggest an upgrade for summary, after test if you have hundreds of checks, you should be able to filter the failed ones, so you don't have to scroll all the way up and look up for the failed check.

Suggested Solution (optional)

flag when starting test or options that can be but in options object in the test, to filter checks after the tests, like: checkFilter: failed|success|all all - by default

Already existing or connected issues / PRs (optional)

No response

Doomann avatar Jul 16 '24 08:07 Doomann

Hey @Doomann 👋🏻

We're currently looking into improving the end of test summary, as well as stabilizing the json export format. Could you provide us an example (even half-baked and completely experimental) that demonstrates the user-experience you have in mind? That would be super useful to ensure we're aligned on the problem we're trying to solve, and the potential solution you're envisioning 🙇🏻

oleiade avatar Jul 16 '24 09:07 oleiade

Example

Hi @oleiade

Alright, let's say I have a big test, and there is a lot of checks, and lets say some scenario failed, like you can see here: image

And now I have to scroll up and look for the group where that check failed, and it's easier in the editor when I notice red color somewhere, but like in github actions it's very hard to find failed check.

Demonstration

I want to be able to filter checks, like this maybe:

export K6_BROWSER_ARGS='no-sandbox'; \
export K6_CHECK_FILTER='failed'; \ <---- Like this
	k6 run src/test.js

or even like this:

image

And then in the test output I'd like to see only the checks, that i wanted to see, so now failed:

image

Even better option would be is to being able show only failed checks when some of them fails, and show all succeded if all of them succeds. Or maybe sort them and failed ones should be at the bottom :)

Doomann avatar Jul 17 '24 12:07 Doomann

Hi, @oleiade any updates on this? Can I expect this being added in future?

Doomann avatar Jul 22 '24 14:07 Doomann

Hey @Doomann

Thanks a lot for putting this whole example together. Much appreciated 🎉

My understanding now is that your goal would be to instruct k6 whether or not to display checks based on their result (passed/failed). Is that correct?

We haven't considered it so far, but we will definitely explore it as we aim to revamp the end-of-test summary soon.

In order to manage expectations, regardless of whether we decide to address this feature or not, I don't expect this is something that would land in k6 short-term 🙇‍♂️

oleiade avatar Jul 22 '24 14:07 oleiade