docs: update testing docs with storybook and master-dry-run/ (#19465)

This commit is contained in:
Juliana Peña 2021-03-25 19:03:01 -07:00 committed by GitHub
parent f670a0b8bf
commit d48cf327ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 12 deletions

View File

@ -74,14 +74,6 @@ Examples:
- Tests that call our search API to test the behavior of our entire search system.
- Tests that validate UI behavior in the browser while mocking out all network requests so no backend is required.
#### Running integration tests
Integration tests are run everytime a branch is merged into main, but it is possible to run them manually:
- Create a branch with the `master-dry-run/` prefix, example: `master-dry-run/my-feature`
- Push it on Github
- Look for that branch on [Buildkite](https://buildkite.com/sourcegraph/sourcegraph)
### End-to-end tests (e2e)
E2e tests test our entire product from the perspective of a user. We try to use them sparingly. Instead, we prefer to get as much confidence as possible from our [unit tests](#unit-tests) and [integration tests](#integration-tests).
@ -103,9 +95,11 @@ Examples:
### Visual testing
We use [Percy](https://percy.io/) to detect visual changes in Sourcegraph features. You may need permissions to update screenshots if your feature introduces visual changes. Post a message in #dev-chat that you need access to Percy, and someone will add you to our organization (you will also receive an invitation via e-mail). _Do not_ create an account on Percy before receiving the invitation: as Percy has been acquired by BrowserStack, if you create an account outside of the invitation flow, you will end up with a BrowserStack account that cannot be added to a Percy organization.
Visual testing is useful to catch visual regressions and verify designs for new features. [More info about visual testing philosophy](testing_web_code.md#visual-regressions)
Once you've been invited to the Sourcegraph organization and created a Percy account, you should then link it to your GitHub account.
We use [Chromatic Storybook](https://www.chromatic.com/) to detect visual changes in specific React components. Post a message in #dev-chat that you need access to Chromatic, and someone will add you to our organization (you will also receive an invitation via e-mail). You should sign into Chromatic with your GitHub account. If a PR you author has visual changes, a UI Review in Chromatic will be generated. It is recommended that a designer approves the UI review.
We use [Percy](https://percy.io/) to detect visual changes in Sourcegraph features during browser-based tests (client integration tests and end-to-end tests). You may need permissions to update screenshots if your feature introduces visual changes. Post a message in #dev-chat that you need access to Percy, and someone will add you to our organization (you will also receive an invitation via e-mail). _Do not_ create an account on Percy before receiving the invitation: as Percy has been acquired by BrowserStack, if you create an account outside of the invitation flow, you will end up with a BrowserStack account that cannot be added to a Percy organization. Once you've been invited to the Sourcegraph organization and created a Percy account, you should then link it to your GitHub account.
## Ownership

View File

@ -23,8 +23,8 @@ These categories may be more or less important depending on the piece of UI.
### Visual regressions
A visual regression is a bug where the component behaves correctly, but no longer looks as intended.
We use Percy screenshot tests to catch these.
Percy can take screenshots in end-to-end tests, integration tests and in Storybooks.
We use Percy screenshot tests and Chromatic Storybook tests to catch these.
Percy can take screenshots in end-to-end tests and client integration tests. Chromatic can take screenshots in Storybook tests.
Storybook tests can be seen as a form of unit test for a component.
Any story that is added to our codebase is automatically screenshotted on every CI build (but only in its initial state).

View File

@ -320,6 +320,10 @@ include:
- Dockerfile linter (hadolint)
- Check whether the Go module folders are "tidy" (go mod tidy)
### Running backend integration and end-to-end tests in CI
For pull requests, only a limited set of tests are run in CI. If you would like to run the full `main` test suite in a PR, including backend integration tests, e2e, and qa, you can name your branch with the prefix `master-dry-run/` and this will run all the tests that will be ran when the PR is checked into `main`.
## Release testing
To manually test against a Kubernetes cluster, use https://k8s.sgdev.org.