Skip to content

mockforge version 0.3.2 generate k6 scripts which is not working and throws error Unexpected token #79

@srikr

Description

@srikr

Description

I am seeing following error when running following mockforge command:

mockforge bench --spec billing_subscriptions_v1.json --target https://<any_server> --scenario constant --vus 50

Error:

time="2025-11-25T10:37:47+05:30" level=error msg="could not initialize 'bench-results/k6-script.js': could not load JS test 'file:///root/srikr/Tools/OpenAPISpec/bench-results/k6-script.js': file:///root/srikr/Too ls/OpenAPISpec/bench-results/k6-script.js: Line 6:12 Unexpected token . (and 19 more errors)" Error: k6 execution failed: k6 exited with status: exit status: 107

Steps to Reproduce

  1. Use the attached OpenAPI Spec(billing_subscriptions_v1.json)
  2. Install mockforge version 0.3.2 using command: cargo install mockforge-cli
  3. Run the command: mockforge bench --spec billing_subscriptions_v1.json --target https://<any_server> --scenario constant --vus 50
  4. This will throw above mentioned error

Expected Behavior

mockforge command should generate proper k6 javascript which should be able to run all type of openapi specs

Actual Behavior

Currently the problem seems like mockforge creates k6 javascript with variable names with dot that is not acceptable which is making k6 run failing

Version

v0.3.2

Rust Version

rustc 1.91.1 (ed61e7d7e 2025-11-07)

Operating System

Ubuntu 22.04

Additional Context

billing_subscriptions_v1.json

Checklist

  • I have searched existing issues for duplicates
  • I have included all relevant configuration files
  • I have included complete error messages
  • I am using the latest version of MockForge

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions