corso/docs/docs/developers/testing.md
Georgi Matev 9f6b1bc1b8
Docs structure and initial content (#658)
* Clean up tree structure and add proper logo

* Proper logo files

* Initial docs

* Pick up new page after merging main

* Apply suggestions from code review

Some nits

Co-authored-by: Niraj Tolia <ntolia@users.noreply.github.com>

* Quash a bunch of Vale prose linter errors, warnings, and suggestions.

* PR Review feedback
* Simplified mount folders
* Cleaned up windows container
* Hid `latest` release tag

* Review feedback: Link to repo page

* Better arrow symbol

Co-authored-by: Niraj Tolia <ntolia@users.noreply.github.com>

* Clarify sentence

* Update README.md

* Reframing focus to M365

* More linting

* Use only MD files

Co-authored-by: Niraj Tolia <ntolia@users.noreply.github.com>
2022-08-26 20:45:50 -07:00

57 lines
1.2 KiB
Markdown

# Running tests locally
## Prerequisites
- Set `CORSO_PASSWORD` environment variable
```bash
export CORSO_PASSWORD=<some password>
```
- Set AWS credential (needed for tests that use S3) environment variables
```bash
export AWS_ACCESS_KEY_ID="...."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_SESSION_TOKEN="..."
```
- Create a config file with the S3 bucket used for testing
```toml
bucket = '<bucket name>'
```
- Set `CORSO_TEST_CONFIG_FILE` to use the test config file
```bash
export CORSO_TEST_CONFIG_FILE=~/.corso_test.toml
```
- Set M365 Credentials environment variables
```bash
export TENANT_ID=<tenant>
export CLIENT_ID=<id>
export CLIENT_SECRET=<secret>
```
## Running tests
Standard `go test ./...` will run unit tests
Integration style tests run when enabled by setting the appropriate environment variable.
For example, `CORSO_CI_TESTS=true go test ./...`
The complete list of environment constants is available at
`.../src/internal/tester/integration_runners.go`.
## Advanced options
- To override the M365 user for tests, use `CORSO_M356_TEST_USER_ID`
```bash
export CORSO_M356_TEST_USER_ID="..."
```