Resolving "Could not find project root" error in test configuration

Last updated: September 16, 2025

If you're encountering a "Could not find project root" error when running tests, this typically indicates that the project_root path specified in your config.yml file cannot be located within your repository structure.

Understanding the project_root path

The project_root in your test configuration should specify the relative path from your repository root to the directory containing your test files. This path should not include the repository name itself.

How to fix the issue

  1. Identify your repository structure: First, determine the full path to your test directory from the repository root.

  2. Update the project_root path: In your config.yml file, set the project_root to the relative path from the repository root, excluding the repository name.

Example

If your repository structure looks like this:

terraform/
├── modules/
│   └── other/
│       └── examples/
│           └── basic-usage/
└── config.yaml

And your repository name is "terraform", the correct project_root should be:

project_root: modules/other/examples/basic-usage

Note: Do not include the repository name ("terraform" in this example) in the project_root path, as the path should be relative to the repository root directory.

Common mistakes to avoid

  • Including the repository name in the path (e.g., terraform/modules/other/examples/basic-usage)

  • Using only partial paths that don't reflect the full directory structure from the repository root

After updating your config.yml with the correct project_root path, your tests should run successfully.