Add bazel rules for jstestfuzz

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc1
    • Affects Version/s: None
    • Component/s: Bazel
    • None
    • DevProd Test Infrastructure
    • Fully Compatible
    • DevProd Test Infra 2026-07-14
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Adds rules to setup and run `jstestfuzz` within bazel, enable hermetic `resmoke_suite_test`s for fuzzer suites.

      This includes:
      1. A repository rule for cloning `10gen/jstestfuzz`, which can be pinned to a commit temporarily via `--repo_env=JSTESTFUZZ_COMMIT=abc123`. The latest commit to master is used by default, as is the status quo for jstestfuzz.
      2. To support cloning in Evergreen, an access token is written to the active user's `~/.gitconfig` during `"setup bazel (credentials, bazelrc)"` (renamed from `"get engflow creds"`), like:
      ```
      [url "https://x-access-token:<TOKEN>@github.com/10gen/jstestfuzz.git"]
      insteadOf = https://github.com/10gen/jstestfuzz.git
      ```
      3. Modification of `resmoke_shim.py` to spare the seed and commit hash, enabling exact reproduction.
      4. A rule that runs `jstestfuzz` to generate Javascript tests. Usage is like:
      ```

      1. This rule's output is 10 generated javascript tests, consumed as `srcs` below.
        jstestfuzz_generate(
        name = "jstestfuzz_generated",
        npm_command = "jstestfuzz",
        num_generated_files = 10,
        )

      resmoke_suite_test(
      name = "jstestfuzz",
      srcs = [":jstestfuzz_generated"], # <-- `jstestfuzz_generate` target goes in `srcs`
      config = ":suites/jstestfuzz.yml",
      deps = [
      "//src/mongo/db:mongod",
      "//src/mongo/shell:mongo",
      ],
      )
      ```

            Assignee:
            Sean Lyons
            Reporter:
            Sean Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: