这是indexloc提供的服务,不要输入任何密码
Skip to content

Directories named test or tests are ignored #1143

@kraenhansen

Description

@kraenhansen

What version of Turborepo are you using?

1.2.5

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Mac

Describe the Bug

I have a repo with a sub-package named tests and I'm experiencing issues running scripts in it using turbo run.
Basically it seems turbo completely ignores the existence of it.
While building the repro, I found the same behaviour when the directory is named test.

I suspect this is the offending source-code: https://github.com/vercel/turborepo/blob/main/cli/internal/context/context.go#L385-L386

I've narrowed it down to this PR, first released as turbo@1.0.15 and verified the bug does not appear on turbo@1.0.14.

Expected Behavior

I'd expect Turbo to recognise any directory matched by the workspaces array of the root package.json.

If this is indeed intended behaviour I would expect this being explicitly called out on Docs / Troubleshooting and perhaps Docs / Guides / Migrate from Lerna (since that was a perfectly valid configuration with Lerna).

To Reproduce

See https://github.com/kraenhansen/turbo-test-issue for a complete reproduction.

Steps it takes:

  1. Create a mono-repo with three sub-packages explicitly mentioned in the root's package.json, two of which should have their directories named test and tests respectively.
  2. Add a build script to all of the sub-packages.
  3. Initialize a turbo.json with a pipeline containing "build": { "dependsOn": ["^build"] }.
  4. Try running the build command (use --dry-run to keep things clean) and notice how the test and tests packages are not listed in "Packages in Scope".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions