Skip to content

dependencies pragma parsing is too strict #5426

@pablochacin

Description

@pablochacin

The Automatic dependency resolution supports the definition of dependency pragmas that define version constraints for the dependencies. The format is use k6 with <dependency>< constraints>

Currently, k6 parses this pragma only if the constraints are separated by a space from the dependency name:

"use k6 with k6/x/faker =v0.4.4"; ✔️
"use k6 with k6/x/faker=v0.4.4";

For example, running this script:

"use k6 with k6/x/faker=v0.4.0"; 

import faker from "k6/x/faker";

export default function () {
  console.log(faker.person.name());
}

Produces the following error:

ERRO[0000] Failed to provision a k6 binary with required dependencies. Please, make sure to report this issue by opening a bug report.  error="invalid build parameters: unknown dependency : k6/x/faker=v0.4.0"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions