Skip to content

[ci-gap][test-effectiveness] Unit-test the k6 gate-defining JavaScript (tests/Load/utils) #375

Description

@claude

Current score → target

Test effectiveness / performance-gate integrity: 4/5 → 5/5.

Defect class prevented

The blocking performance gate going vacuously green: k6 raises no error when thresholds are absent, so a regression in threshold construction silently disables the entire perf gate.

Evidence

  • The gate's semantics live in ~1,291 lines of untested JS: tests/Load/utils/ (thresholdsBuilder.js, scenariosBuilder.js 91 ln, utils.js 248 ln, LoadTestConfigManager.js, shared-data loaders).
  • ThresholdsBuilder already contains a silent-disable branch: K6_SKIP_DURATION_THRESHOLDS swaps p(99)<X for the always-true max>=0. A bug in that env parsing, in tag naming (test_type: vs scenario:), or a build() returning {} = every k6 run passes with zero enforcement.
  • tests/Load/package.json's test script is a no-op stub asserting "Tests run at workspace root" — while the root package.json is literally {}. Documented intent, no implementation.
  • Only lint ever touches these files, via Super-Linter with continue-on-error: true.

Proposed fix

node --test (zero new deps) specs for: ThresholdsBuilder (threshold shape per scenario; skip-flag behavior both ways; non-empty output asserted), ScenariosBuilder, and config-manager parsing. Wire as a job in load-tests.yml gating the shards, path-filtered on tests/Load/** with a skip-fallback:

k6-config-tests:
  timeout-minutes: 5
  steps:
    - uses: actions/checkout@<sha>
    - run: cd tests/Load && node --test utils/__tests__/
load-tests-sharded:
  needs: [k6-config-tests]

Effort

M

Acceptance criteria

  • Unit tests cover thresholds/scenarios/config builders incl. both K6_SKIP_DURATION_THRESHOLDS branches and a non-empty-thresholds assertion
  • Job blocks the load-test shards; the package.json stub is replaced by the real test script
  • Proven: a seeded bug making ThresholdsBuilder.build() return {} fails the new tests

Filed by an automated CI/CD verification-coverage audit (OpenSSF Scorecard baseline: aggregate 6.0/10, local mode — SAST 0, Fuzzing 0, Token-Permissions 0, Pinned-Dependencies 5, Vulnerabilities 4). Audit method: inventory → gap analysis → git-history evidence mining → 3-iteration adversarial critique loop.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciContinuous integration pipelineenhancementNew feature or requestqualityQuality engineering / verification coveragetest-effectivenessMutation/property-based/fuzz testing depth

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions