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

chore: update README #621

Merged
merged 2 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
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: 16 additions & 0 deletions .envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export GOOGLE_CLOUD_PROJECT="project-name"

export MYSQL_CONNECTION_NAME="project:region:instance"
export MYSQL_USER="mysql-user"
export MYSQL_PASS="mysql-password"
export MYSQL_DB="mysql-db-name"

export POSTGRES_CONNECTION_NAME="project:region:instance"
export POSTGRES_USER="postgres-user"
export POSTGRES_PASS="postgres-password"
export POSTGRES_DB="postgres-db-name"

export SQLSERVER_CONNECTION_NAME="project:region:instance"
export SQLSERVER_USER="sqlserver-user"
export SQLSERVER_PASS="sqlserver-password"
export SQLSERVER_DB="sqlserver-db-name"
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

## Table of contents
* [Opening an issue](#opening-an-issue)
* [How to run tests](#how-to-run-tests)
* [Contributor License Agreements](#contributor-license-agreements)
* [Contributor Code of Conduct](#contributor-code-of-conduct)

Expand Down Expand Up @@ -72,6 +73,50 @@ expect to be impacted, as well as its severity. As a rule of thumb:
</tr>
</table>

## How to run tests

The test suite includes both unit and integration tests. For macOS and Linux,
there is a depenency on [FUSE][] that must be present on the system.

### Test Dependencies

When running tests on macOS and Linux, users will need to first install
[FUSE][]. Windows users may skip this step.

On Debian, use:

```
sudo apt-get install fuse
```

On macOS, use:

```
brew install --cask osxfuse
```

### How to run just unit tests

```
go test -tags=skip_sqlserver,skip_mysql,skip_postgres ./...
```

### How to run all tests

To run all integration tests, users will need a Google Cloud project with a
MySQL, PostgreSQL, and SQL Server database. Note: Pull Requests will run these
tests and as a result may be skipped locally if necessary.

A sample `.envrc.example` file is included in the root directory which documents
which environment variables must be set to run the integration tests. Copy this
example file to `.envrc` at the root of the project, supply all the correct
values for each variable, source the file (`source .envrc`, or consider using
[direnv][]), and then run:

```
go test ./...
```

## Contributor License Agreements

Open-source software licensing is a wonderful arrangement that benefits
Expand Down Expand Up @@ -142,3 +187,6 @@ maintainers.
This Code of Conduct is adapted from the [Contributor
Covenant](http://contributor-covenant.org), version 1.2.0, available at
[http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)

[FUSE]: https://www.kernel.org/doc/html/latest/filesystems/fuse.html
[direnv]: https://direnv.net/
Loading