-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable BigQuery connection test (closes #11)
- Loading branch information
Showing
7 changed files
with
535 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,15 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- uses: TimonVS/[email protected] | ||
if: github.event_name == 'pull_request' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: cachix/install-nix-action@v17 | ||
- uses: cachix/cachix-action@v10 | ||
- uses: cachix/cachix-action@v12 | ||
with: | ||
name: cachix-action | ||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,31 +9,47 @@ Conntest is a command-line utility for validating connections to Snowplow-suppor | |
## Running | ||
|
||
To check your database connection, run: | ||
|
||
```shell | ||
conntest check --dsn your://database/uri --retry-times 0 --tags 'aTag=value;anotherTag=value' | ||
``` | ||
|
||
### Example | ||
|
||
For Snowflake:- | ||
|
||
```shell | ||
$ conntest check --tags aTag=value --dsn snowflake://lorem:[email protected]/lorem?account=ab01234&ocspFailOpen=true&protocol=https®ion=eu-central-1&role=SNOWPLOW_LOADER_ROLE&schema=SNOWPLOW&validateDefaultParameters=true&warehouse=COMPUTE_WH | ||
|
||
{"id":"b732dd11-428d-4063-aa35-118e0e8ab51f","name":"fabric:warehouse-connection-check","version":1,"emittedBy":"conntest","timestamp":"2022-10-10T08:36:27.832840488Z","data":{"host":"abcdefg-ab01234.snowflakecomputing.com","complete":false,"messages":["HTTP Response code: 500"],"tags":{"aTag":"value"},"attempts":1}} | ||
``` | ||
|
||
For BigQuery:- | ||
|
||
```shell | ||
conntest check --dsn bigquery://:@engineering-sandbox/testantonis --retry-times 0 --tags 'aTag=value;anotherTag=value' | ||
|
||
{"id":"1a71a92e-60b0-4061-b32b-47588faae105","name":"fabric:warehouse-connection-check","version":1,"emittedBy":"conntest","timestamp":"2024-03-27T19:11:40.703468Z","data":{"host":"engineering-sandbox","complete":true,"messages":[],"tags":{"aTag":"value","anotherTag":"value"},"attempts":0}} | ||
``` | ||
|
||
## Development | ||
|
||
This repo uses nix to provide [reproducible development environment](https://nixos.org/guides/ad-hoc-developer-environments.html). To make use of the provided setup: | ||
|
||
1. Install `nix`: | ||
|
||
```shell | ||
sh <(curl -L https://nixos.org/nix/install) | ||
``` | ||
|
||
2. Enable experimental flags | ||
``` shell | ||
|
||
```shell | ||
mkdir -p ~/.config/nix && echo 'experimental-features = nix-command flakes' > ~/.config/nix/nix.conf | ||
``` | ||
|
||
3. Enter development environment | ||
|
||
```shell | ||
nix develop | ||
``` | ||
|
@@ -42,7 +58,8 @@ nix develop | |
> If you want the convenience of getting the development environment upon `cd` into directory use [direnv](https://direnv.net) | ||
4. Develop | ||
``` | ||
|
||
```shell | ||
# format | ||
go fmt ./... | ||
# build | ||
|
@@ -53,10 +70,9 @@ go test -v ./... -test.short | |
go test -v ./... | ||
``` | ||
|
||
|
||
### Copyright and license | ||
|
||
Conntest is copyright 2022-2022 Snowplow Analytics Ltd. | ||
Conntest is copyright 2022-2024 Snowplow Analytics Ltd. | ||
|
||
Licensed under the **[Apache License, Version 2.0][license]** (the "License"); | ||
you may not use this software except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.