For organizations with multiple teams, you can initialize a separate Momentic project for each team to isolate tests, environments, and settings. A group of projects is known as a workspace. Each Git repository should have at most one workspace.

Creating workspaces

To initialize a workspace, create a momentic.workspace.yaml file in the location where you want users to start the Momentic app. For most organizations, this should be the root of your Git repository. The workspace file currently supports a single projects key, which is an array of paths where Momentic should look for projects:

projects:
  - project-a
  - folder/*
  - apps/**/*

This workspace configuration would match all the following projects:

project-a/momentic.config.yaml
folder/momentic.config.yaml
apps/frontend/react-app/momentic.config.yaml

Conversely, the following folders would not be searched by Momentic:

node_modules/
folder/nested-folder/double-nested-folder
.git/123456788

Sharing between projects

Projects can be configured to share resources. For example, to share modules between two projects, create a shared folder to hold module definitions and add it to the include key of each Momentic project config YAML. Please see the file inclusion documentation for an example.

Using the local app with workspaces

When starting the local app in a workspace, Momentic will display a project picker for the user to choose which scope they wish to use. After selection, the local app will only display the tests, modules, and environments configured for that project.

Running tests with workspaces

When using the CLI to run tests or suites in a workspace, you must disambiguate which project you wish to use. You can do so in three ways:

Before running tests, use your terminal to navigate to the correct project. Projects are identified by the presence of a momentic.config.yaml file. example:

cd project-a
npx momentic@latest run my-test.yaml

We highly recommend the first choice so that your terminal can autocomplete file and folder paths correctly when you specify which tests to run. If using the --config or --filter options, your current working directory will be outside the project root, which can make specifying tests by file path cumbersome. If you wish to use these options, we recommend selecting tests using substring name matches only. Please see the run documentation for more information.

Was this page helpful?