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

Checks & Groups : checks in subgroups are not aggregated #34

Open
cbo44 opened this issue Feb 12, 2022 · 2 comments
Open

Checks & Groups : checks in subgroups are not aggregated #34

cbo44 opened this issue Feb 12, 2022 · 2 comments

Comments

@cbo44
Copy link

cbo44 commented Feb 12, 2022

Checks from subgroups should be aggregated at group level.

  • the "Checks stats" shows 4 checks
    image

  • But only 2 checks are reported on the "Checks and Groups" tab

image

  • code to reproduce :
import http from 'k6/http';
import { check, group } from 'k6';
import { htmlReport } from "https://raw.githubusercontent.com/benc-uk/k6-reporter/2.3.1/dist/bundle.js";
import {  textSummary } from 'https://jslib.k6.io/k6-summary/0.0.1/index.js';

export const options = {
  stages: [
    { target: 1, duration: '2s', },
  ]
}
  

export default function go() {
  group('Group 1', function () {
    const response = http.get('https://test.k6.io');
    check(response, {
      'Group 1: is status 200': (r) => r.status === 200,
    });
    group('Group 1.1', function () {
     
      check(response, {
        'Group 1.1: is status 200': (r) => r.status === 200,
      });
    })
  });
}

export function handleSummary(data) {
  console.info('Preparing the end-of-test summary...');
  return {
    "summary.html": htmlReport(data),
    'stdout': textSummary(data, { indent: ' ', enableColors: true }), // Show the text summary to stdout...
  };

}
  • run output :
$ k6 run sub-groups.js

          /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

  execution: local
     script: sub-groups.js
     output: -

  scenarios: (100.00%) 1 scenario, 1 max VUs, 32s max duration (incl. graceful stop):
           * default: Up to 1 looping VUs for 2s over 1 stages (gracefulRampDown: 30s, gracefulStop: 30s)


running (03.0s), 0/1 VUs, 2 complete and 0 interrupted iterations
default ✓ [======================================] 0/1 VUs  2s
INFO[0003] Preparing the end-of-test summary...          source=console
INFO[0003] [k6-reporter v2.3.0] Generating HTML summary report  source=console
     █ Group 1

       ✓ Group 1: is status 200

       █ Group 1.1

         ✓ Group 1.1: is status 200

     checks.........................: 100.00% ✓ 4       ✗ 0
     data_received..................: 28 kB   9.4 kB/s
     data_sent......................: 616 B   207 B/s
     group_duration.................: avg=744.84ms min=0s    med=593.27ms max=1.79s    p(90)=1.61s    p(95)=1.7s
     http_req_blocked...............: avg=230.07ms min=0s    med=230.07ms max=460.14ms p(90)=414.12ms p(95)=437.13ms
     http_req_connecting............: avg=65.45ms  min=0s    med=65.45ms  max=130.9ms  p(90)=117.81ms p(95)=124.36ms
     http_req_duration..............: avg=1.25s    min=1.18s med=1.25s    max=1.33s    p(90)=1.31s    p(95)=1.32s
       { expected_response:true }...: avg=1.25s    min=1.18s med=1.25s    max=1.33s    p(90)=1.31s    p(95)=1.32s
     http_req_failed................: 0.00%   ✓ 0       ✗ 2
     http_req_receiving.............: avg=9.2ms    min=0s    med=9.2ms    max=18.4ms   p(90)=16.56ms  p(95)=17.48ms
     http_req_sending...............: avg=358.85µs min=0s    med=358.85µs max=717.7µs  p(90)=645.92µs p(95)=681.81µs
     http_req_tls_handshaking.......: avg=134.34ms min=0s    med=134.34ms max=268.69ms p(90)=241.82ms p(95)=255.25ms
     http_req_waiting...............: avg=1.24s    min=1.16s med=1.24s    max=1.33s    p(90)=1.31s    p(95)=1.32s
     http_reqs......................: 2       0.67081/s
     iteration_duration.............: avg=1.48s    min=1.18s med=1.48s    max=1.79s    p(90)=1.73s    p(95)=1.76s
     iterations.....................: 2       0.67081/s
     vus............................: 1       min=1     max=1
     vus_max........................: 1       min=1     max=1
  • version
$ k6 version
k6 v0.36.0 (2022-01-24T09:50:03+0000/ff3f8df, go1.17.6, windows/amd64)
@BlackBulletBrony
Copy link

Hello! I found another problem that is probably related to this problem. Here is the script code:

import http from 'k6/http';
import {group,check} from 'k6';
import {textSummary} from 'https://jslib.k6.io/k6-summary/0.0.1/index.js';
import {htmlReport} from 'https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js';
export const options={
	stages:[
		{target:1,duration:'0.1s'}
	]
};
export default function Test() {
	group('1. Test',function () {
		group('1.1. Test',function () { 
			let response=http.get('https://test.k6.io');
			check(response,{'Test check':(r) => r.status===200})
		})
	})
};
export function handleSummary(data) {
	return {
		"result.html":htmlReport(data),
		stdout: textSummary(data,{indent:" ",enableColors:true}),
	}
};

As a result on the "Checks & Groups" tab, there are no checks in the html report, even from parent groups:
image
Module developers, I ask you to fix this problem, please.

@fentas
Copy link

fentas commented Sep 21, 2022

I took 20 minutes and tried around.
Here is an example of how to solve it: fentas@c10fc88

I also added PR #41 for bootstrap theme. It is switchable with the option template: 'bootstrap'

dunno if this repo is still maintained.

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

3 participants