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

Dasboard does not display data using setup() function #185

Closed
EmpreLuc opened this issue May 10, 2024 · 6 comments · Fixed by #186
Closed

Dasboard does not display data using setup() function #185

EmpreLuc opened this issue May 10, 2024 · 6 comments · Fixed by #186
Assignees
Labels
bug Something isn't working

Comments

@EmpreLuc
Copy link

Brief summary

When execute test with 'export default setup()' the dashboard does not shows data.

k6 version

v0.50.0

xk6-dashboard version

v0.7.3-alpha.1

OS

Windows 11

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Executing with export default function setup()
image
image
image
image

Executing without export default function setup()
image
image
image

Expected behaviour

That dashboard shows data with export default function setup()

Actual behaviour

When execute test with 'export default setup()' the dashboard does not shows data.

@EmpreLuc EmpreLuc added the bug Something isn't working label May 10, 2024
@EmpreLuc
Copy link
Author

@szkiba

@szkiba
Copy link
Collaborator

szkiba commented May 17, 2024

Hi @EmpreLuc ,

I tried to reproduce it, but it didn't work for me. Could you send me a zip file that contains everything for reproduction?
By the way, the problem is probably not the presence of the setup function (it is more complicated than that)

@EmpreLuc
Copy link
Author

EmpreLuc commented May 17, 2024

Hi @szkiba ,

The test I tried is the next:

`import { check } from "k6";
import http from "k6/http";

export const options = {
"executor": "ramping-vus",
"startVUs": 0,
"stages": [
{ "duration": "2m", "target": 10 },
{ "duration": "5m", "target": 10 },
{ "duration": "2m", "target": 0 }
]
}

export function setup() {
console.log('Example print'));
}

export default function() {
let res = http.get("https://test.loadimpact.com/");
check(res, {
"is status 200": (r) => r.status === 200
});
};
`

Project.zip

xk6-dashboard builded with next command:
xk6 build v0.51.0 --with github.com/grafana/[email protected]

the command to execute the test:
./k6 run -o 'web-dashboard=open=true&report=test-result.html' ./tests\restful-api\test.js

before this comment I tried to upgrade k6 to v0.51.0 but have same result, when the stup function is on the test the dashboard doesnt show graphics, but when comment the setup the graphics appears.

@szkiba szkiba self-assigned this May 22, 2024
@szkiba
Copy link
Collaborator

szkiba commented May 22, 2024

Hi @EmpreLuc , Thanks for the example script. I managed to find the problem and the fix is almost complete. I will merge soon and then make a release.

@szkiba szkiba mentioned this issue May 22, 2024
@szkiba szkiba linked a pull request May 22, 2024 that will close this issue
szkiba added a commit that referenced this issue May 22, 2024
@EmpreLuc
Copy link
Author

Thank you @szkiba!

@szkiba
Copy link
Collaborator

szkiba commented May 22, 2024

@EmpreLuc,Thank you for your help.
Version v0.7.3 contains the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants