Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand docs about testing #1251

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ Runs after the top-level `yarn install`. This ensures `./packages/plexus` builds

`tsc-lint-debug` is for diagnosing problems with linking, resolving files, or aliases in TypeScript code. It lists the files involved in the compilation.

### `test`
`test` runs tests for all packages.

Note that `./packages/plexus` does not yet have any tests, as tracked in issue [#340](https://github.com/jaegertracing/jaeger-ui/issues/340).

`./packages/jaeger-ui` uses [Jest](https://jestjs.io/) for testing. It can be useful to directly run tests for that package by running `yarn test` from its directory, rather than the repository root.

Tests for React components in `./packages/jaeger-ui` make extensive use of Jest's [snapshot testing](https://jestjs.io/docs/28.x/snapshot-testing) functionality. These snapshots can be regenerated by running `yarn test -u` from the package directory to regenerate all snapshots,
or `yarn test -u --testNamePattern <test name>` to regenerate snapshots for a subset of tests only.

### `husky` . `hooks` . `pre-commit`

Runs the `lint` and `test` scripts.
Expand All @@ -67,9 +77,11 @@ Pretty basic.

Note: This configuration is extended by `./packages/plexus/.eslintrc.js`.

## `.travis.yml`
## `.github/workflows`
Holds GitHub Actions workflows used in CI and in release.

Currently `./packages/plexus` doesn't have any tests... But, when it does, `.travis.yml` needs to be updated to send coverage info for all `./packages/*` to codecov.io. ([Ticket](https://github.com/jaegertracing/jaeger-ui/issues/340))
CodeCov is integrated into the unit tests workflow to report coverage data from `./packages/jaeger-ui`.
When unit tests are added to Plexus, this integration will need to be updated to gather coverage data for Plexus as well.

[`yarn install --frozen-lockfile`](https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-frozen-lockfile) ensures installs in CI fail if they would typically mutate the lockfile.

Expand Down