Files
medusa-store/integration-tests
Patrick 86f9455d00 test: allow integration-tests to leverage workspaces optimizations (#2727)
### What
Leverage yarn workspaces and Turborepo for integration-tests in order to accelerate development and reduce DevX complexity.

### Why
The current solution for running integration tests requires using `medusa-dev-cli` in order to publish packages to a local npm repository. The package where the command is executed will have its package.json altered for any known medusa dependency in order to install from the local npm. The process is taxing on the host machine resources and prevents rapid iterations when working with integration tests.

For more information, see documentation: f0cc1b324c/docs/content/usage/local-development.md (run-api-integration-tests)

### How
By declaring `integeration-tests/**/*` as a workspace, Turborepo can now be leveraged to build and run integration test as if there were packages. The build process will take care of interdependency between package in order to ensure local dependency are met.

In addition, within each integration-tests "packages", we can declare local dependencies as "*" which will translate to using the one that is part of the current build, regardless of the dependency's version number. No more fiddling with version numbers.

Github actions pertaining to integration-tests have been streamlined to use the new behavior.

The integration-tests packages have been marked as `private:true` in order to avoid publishing them to the public npm registry.

### Testing
```
cd root-of-medusajs-medusa-repo/
yarn install
yarn build
yarn test:integration:api
yarn test:integration:plugins
```

After a code change, `yarn build` must be run before re-running an integration test, which is the same procedure as for unit tests.

Resolves: CORE-845
2022-12-08 14:57:16 +00:00
..
2022-02-24 20:14:09 +01:00