Skip to content

Bug: testfold -e <env> without suite names fails with 'No matching suites found' #30

@witqq

Description

@witqq

Bug

Running testfold -e remote (or any environment) without explicitly listing suite names fails:

$ testfold -e remote
Error: No matching suites found:

Root Cause

In cli/args.js, suites is set to args._ (minimist positional args), which returns [] for no positional args.

In orchestrator.js:35-41:

const suitesToRun = suiteNames
    ? this.config.suites.filter((s) => suiteNames.includes(s.name) || ...)
    : this.config.suites;

Empty array [] is truthy in JavaScript, so it enters the filter branch and .includes() on an empty array always returns false → no suites match → error.

Expected Behavior

testfold -e remote should run all configured suites with the remote environment, same as testfold without -e.

Fix

Change the check from suiteNames to suiteNames?.length > 0:

const suitesToRun = suiteNames?.length > 0
    ? this.config.suites.filter(...)
    : this.config.suites;

Same fix needed in the error message condition below.

Workaround

Explicitly list all suites:

"test": "testfold unit workflow integration api e2e mcp-tools -e remote"

Versions

  • testfold: 0.3.0
  • Node: 20

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions