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

Test pr 1211 #1268

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d3aaee0
try to recreate the issue with UUID to solve #1209
ChronosMasterOfAllTime Sep 19, 2024
478b593
[AB#1669514] fix UUID
ChronosMasterOfAllTime Sep 19, 2024
b76c390
[AB#1669514] remove commented code
ChronosMasterOfAllTime Sep 19, 2024
018095b
[AB#1669514] alternate approach; more generalized
ChronosMasterOfAllTime Sep 20, 2024
f5808c4
[AB#1669514] add stringer safe check; driver valuer check too
ChronosMasterOfAllTime Sep 20, 2024
cd4468a
[AB#1669514] Fix some comments
ChronosMasterOfAllTime Sep 20, 2024
38b21cd
[AB#1669514] simplify stringer check
ChronosMasterOfAllTime Sep 20, 2024
e81bbf3
[AB#1669514] simplify valuer
ChronosMasterOfAllTime Sep 20, 2024
8eb0367
[AB#1669514] move the driver valuer short circuit above the other typ…
ChronosMasterOfAllTime Sep 20, 2024
c3303c5
[AB#1669514] dont run stringer on everything arrays
ChronosMasterOfAllTime Sep 20, 2024
14bc235
[AB#1669514] add array check too
ChronosMasterOfAllTime Sep 20, 2024
22af12d
[AB#1669514] jsonFmtStr and ignore debug binary
ChronosMasterOfAllTime Sep 20, 2024
9d00074
[AB#1669514] make it simpler
ChronosMasterOfAllTime Sep 20, 2024
15d3892
[AB#1669514] revert that change; wont handle complex types
ChronosMasterOfAllTime Sep 20, 2024
ab8cfff
[AB#1669514] add test for SQL Null time
ChronosMasterOfAllTime Sep 23, 2024
1b28c16
[AB#1669514] make it simpler and mayyybe easier to understand
ChronosMasterOfAllTime Oct 8, 2024
fe4f737
[AB#1669514] even simpler
ChronosMasterOfAllTime Oct 8, 2024
28e3e72
[AB#1669514] nil safety on err
ChronosMasterOfAllTime Oct 10, 2024
aa8f8c2
[AB#1669514] more complete converter checks
ChronosMasterOfAllTime Oct 10, 2024
97e988f
[AB#1669514] structured read test
ChronosMasterOfAllTime Nov 19, 2024
8458787
[AB#1669514] structured r/w tests
ChronosMasterOfAllTime Nov 19, 2024
532d2f7
[AB#1669514] driver test?
ChronosMasterOfAllTime Nov 19, 2024
bdbab90
[AB#1669514] fix driver test
ChronosMasterOfAllTime Nov 19, 2024
393eb56
[AB#1669514] not quite right, but structured driver test is almost done
ChronosMasterOfAllTime Nov 19, 2024
e7e805c
[AB#1669514] no hard dependencies on googleUUID
ChronosMasterOfAllTime Nov 20, 2024
dd80100
[AB#1669514] move type to test file so it's not bundled
ChronosMasterOfAllTime Nov 20, 2024
bf927a4
[AB#1669514] dont commit the commented query too large to print error
ChronosMasterOfAllTime Nov 20, 2024
16d2c23
[AB#1669514] debug mode for local help
ChronosMasterOfAllTime Nov 20, 2024
5a71ba0
[AB#1669514] bump checkout; fix typo in yaml
ChronosMasterOfAllTime Nov 20, 2024
cf0c850
[AB#1669514] Notes in bind_uploader
ChronosMasterOfAllTime Nov 20, 2024
2742ee7
[AB#1669514] data.Message fix
ChronosMasterOfAllTime Nov 21, 2024
d3b224a
[AB#1669514] revert atoierr
ChronosMasterOfAllTime Nov 21, 2024
dd72c7c
[AB#1669514] JSON test vs basic type
ChronosMasterOfAllTime Nov 21, 2024
a15a02a
[AB#1669514] arrow test
ChronosMasterOfAllTime Nov 21, 2024
c2dd9c0
[AB#1669514] fix array binding
ChronosMasterOfAllTime Nov 22, 2024
a1137f8
[AB#1669514] make it slightly faster by using nlogn complexity
ChronosMasterOfAllTime Nov 22, 2024
9f4877c
back to 100K
ChronosMasterOfAllTime Nov 22, 2024
b14e863
[AB#1669514] simplify if check in test
ChronosMasterOfAllTime Nov 22, 2024
a9416a5
[AB#1669514] More performant sort
ChronosMasterOfAllTime Nov 22, 2024
f829845
[AB#1669514] use internal assert method
ChronosMasterOfAllTime Nov 22, 2024
f829ed9
[AB#1669514] fix errors; tests will still fail
ChronosMasterOfAllTime Dec 2, 2024
e508b9e
[AB#1669514] type assertions on casts in tests to avoid panics
ChronosMasterOfAllTime Dec 2, 2024
ae1fcab
[AB#1669514] Fixes
sfc-gh-pfus Dec 4, 2024
0a002c8
[AB#1669514] move json transform check to function to keep it in a si…
ChronosMasterOfAllTime Dec 6, 2024
e89206f
[AB#1669514] add to readme and update it for debug mode
ChronosMasterOfAllTime Dec 6, 2024
3830f56
[AB#1669514] Linter fix
ChronosMasterOfAllTime Dec 9, 2024
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
34 changes: 17 additions & 17 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: Build and Test

on:
push:
braches:
- master
tags:
- v*
pull_request:
branches:
- master
- SNOW-*
schedule:
- cron: '7 3 * * *'
workflow_dispatch:
inputs:
goTestParams:
default:
description: "Parameters passed to go test"
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
- SNOW-*
schedule:
- cron: '7 3 * * *'
workflow_dispatch:
inputs:
goTestParams:
default:
description: 'Parameters passed to go test'

concurrency:
# older builds for the same pull request numer or branch should be cancelled
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: './go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
.vscode/
parameters*.json
parameters*.bat
*.p8
Expand All @@ -11,6 +12,8 @@ wss-golang-agent.config
wss-unified-agent.jar
whitesource/
*.swp
cp.out
__debug_bin*

# exclude vendor
vendor
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ This driver currently does not support GCP regional endpoints. Please ensure tha
Snowflake provides a set of sample programs to test with. Set the environment variable ``$GOPATH`` to the top directory of your workspace, e.g., ``~/go`` and make certain to
include ``$GOPATH/bin`` in the environment variable ``$PATH``. Run the ``make`` command to build all sample programs.

```
```sh
make install
```

In the following example, the program ``select1.go`` is built and installed in ``$GOPATH/bin`` and can be run from the command line:

```
```sh
SNOWFLAKE_TEST_ACCOUNT=<your_account> \
SNOWFLAKE_TEST_USER=<your_user> \
SNOWFLAKE_TEST_PASSWORD=<your_password> \
Expand All @@ -79,7 +79,7 @@ The developer notes are hosted with the source code on [GitHub](https://github.c

Set the Snowflake connection info in ``parameters.json``:

```
```json
{
"testconnection": {
"SNOWFLAKE_TEST_USER": "<your_user>",
Expand All @@ -88,21 +88,25 @@ Set the Snowflake connection info in ``parameters.json``:
"SNOWFLAKE_TEST_WAREHOUSE": "<your_warehouse>",
"SNOWFLAKE_TEST_DATABASE": "<your_database>",
"SNOWFLAKE_TEST_SCHEMA": "<your_schema>",
"SNOWFLAKE_TEST_ROLE": "<your_role>"
"SNOWFLAKE_TEST_ROLE": "<your_role>",
"SNOWFLAKE_TEST_DEBUG": "false"
}
}
```

Install [jq](https://stedolan.github.io/jq) so that the parameters can get parsed correctly, and run ``make test`` in your Go development environment:

```
```sh
make test
```

### Setting debug mode during tests
This is for debugging Large SQL statements (greater than 300 characters). If you want to enable debug mode, set `SNOWFLAKE_TEST_DEBUG` to `true` in `parameters.json`, or export it in your shell instance.

## customizing Logging Tags

If you would like to ensure that certain tags are always present in the logs, `RegisterClientLogContextHook` can be used in your init function. See example below.
```
```go
import "github.com/snowflakedb/gosnowflake"

func init() {
Expand All @@ -116,7 +120,7 @@ func init() {

## Setting Log Level
If you want to change the log level, `SetLogLevel` can be used in your init function like this:
```
```go
import "github.com/snowflakedb/gosnowflake"

func init() {
Expand All @@ -138,15 +142,15 @@ The following is a list of options you can pass in to set the level from least t

Configure your testing environment as described above and run ``make cov``. The coverage percentage will be printed on the console when the testing completes.

```
```sh
make cov
```

For more detailed analysis, results are printed to ``coverage.txt`` in the project directory.

To read the coverage report, run:

```
```sh
go tool cover -html=coverage.txt
```

Expand Down
2 changes: 1 addition & 1 deletion bind_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (bu *bindUploader) createStageIfNeeded() error {
return (&SnowflakeError{
Number: code,
SQLState: data.Data.SQLState,
Message: err.Error(),
Message: data.Message,
QueryID: data.Data.QueryID,
}).exceptionTelemetry(bu.sc)
}
Expand Down
Loading
Loading