docs(CONTRIBUTING): add scrip tests section

This commit is contained in:
Joe Previte 2021-09-29 14:53:25 -07:00
parent 1b80244af7
commit 4e310b4985
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24
1 changed files with 28 additions and 16 deletions

View File

@ -1,7 +1,9 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
# Contributing # Contributing
- [Contributing](#contributing)
- [Requirements](#requirements) - [Requirements](#requirements)
- [Creating pull requests](#creating-pull-requests) - [Creating pull requests](#creating-pull-requests)
- [Commits and commit history](#commits-and-commit-history) - [Commits and commit history](#commits-and-commit-history)
@ -10,6 +12,7 @@
- [Build](#build) - [Build](#build)
- [Test](#test) - [Test](#test)
- [Unit tests](#unit-tests) - [Unit tests](#unit-tests)
- [Script tests](#script-tests)
- [Integration tests](#integration-tests) - [Integration tests](#integration-tests)
- [End-to-end tests](#end-to-end-tests) - [End-to-end tests](#end-to-end-tests)
- [Structure](#structure) - [Structure](#structure)
@ -129,13 +132,14 @@ yarn package
> If you need your builds to support older distros, run the build commands > If you need your builds to support older distros, run the build commands
> inside a Docker container with all the build requirements installed. > inside a Docker container with all the build requirements installed.
### Test ## Test
There are three kinds of tests in code-server: There are four kinds of tests in code-server:
1. Unit tests 1. Unit tests
2. Integration tests 2. Script tests
3. End-to-end tests 3. Integration tests
4. End-to-end tests
### Unit tests ### Unit tests
@ -146,6 +150,14 @@ These live under [test/unit](../test/unit).
We use unit tests for functions and things that can be tested in isolation. The file structure is modeled closely after `/src` so it's easy for people to know where test files should live. We use unit tests for functions and things that can be tested in isolation. The file structure is modeled closely after `/src` so it's easy for people to know where test files should live.
### Script tests
Our script tests are written in bash and run using [bats](https://github.com/bats-core/bats-core).
These tests live under `test/scripts`.
We use these to test anything related to our scripts (most of which live under `ci`).
### Integration tests ### Integration tests
These are a work in progress. We build code-server and run a script called These are a work in progress. We build code-server and run a script called