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

on 4th time this check is evaluated, it throws an undefined #128

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

minoseah629
Copy link
Contributor

image

1

image

2

image

3

image

4

image

@thim81
Copy link
Collaborator

thim81 commented Jun 11, 2024

Hi @minoseah629

Thanks for reporting this.

Could you share which version of K6 you are using?

@minoseah629
Copy link
Contributor Author

ill share this was a problem prior to running any k6 command:

k6.exe v0.51.0 (commit/33d3caa7d1, go1.22.3, windows/amd64)

@thim81
Copy link
Collaborator

thim81 commented Jun 12, 2024

Would it be possible to share how to reproduce the issue?
I want to figure why exec becomes undefined.

@thim81
Copy link
Collaborator

thim81 commented Jun 12, 2024

Your PR looks good since it improves the JavaScript safety with the optional chaining, but it is strange that exec becomes undefined.

@minoseah629
Copy link
Contributor Author

i cannot share the exact postman collection json. I have exported my postman collection yesterday. this is what I observed:

  1. A good test that has an exec but with an list of 1 string that's empty.
image
  1. Postman has been updated to incorporate a package concept: https://learning.postman.com/docs/tests-and-scripts/write-scripts/package-library/

  2. The specific request I see is somehow the usage of packages (even though the script is empty and not using a package), the script does not have an empty exec as expected:

image image
  1. This specific request is the only one like this.

@thim81
Copy link
Collaborator

thim81 commented Jun 12, 2024

@minoseah629 Thanks again for sharing this detailed info and the screenshots. It will allow us to rebuild a Postman collection to reproduce the mentioned cases and add some tests to cover this from the future.

Give me a bit of time to process this all and reproduce it, that will allow your PR to land properly and covered.

@minoseah629
Copy link
Contributor Author

minoseah629 commented Jun 12, 2024

sounds good.

sorry for not generating unit tests. i am not good with javascript compared to c# experience.

@thim81
Copy link
Collaborator

thim81 commented Jun 12, 2024

@minoseah629 I was not expecting unit tests, I'm already very happy with all your input and the PR.

@thim81
Copy link
Collaborator

thim81 commented Jun 12, 2024

I have not been able to reproduce it, but the PR changes are useful for a safer JS.

Did it solve your problem?

@thim81 thim81 merged commit 199700c into apideck-libraries:main Jun 12, 2024
1 check failed
@thim81
Copy link
Collaborator

thim81 commented Jun 13, 2024

hi @minoseah629

We just released v1.10.0 of postman-to-k6 cli.
It includes your PR and some more improvements and additional tests (WIP).

Thanks for your contribution. Let me know if your issue is resolved or still occurring.

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

Successfully merging this pull request may close these issues.

2 participants