Skip to content

Commit

Permalink
#105 Working testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Sep 6, 2024
1 parent 873c75e commit 68b5168
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
4 changes: 3 additions & 1 deletion connectororacle/connectororacle_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ func ExampleNewConnector() {
// For more information, visit https://github.com/senzing-garage/go-databasing/blob/main/connectormssql/connectororacle_examples_test.go
ctx := context.TODO()
// See https://godror.github.io/godror/doc/connection.html
configuration := `user="sysdba" password="Passw0rd" connectString="localhost:1521/FREEPDB1"`
// See https://pkg.go.dev/github.com/godror/godror
// configuration := `user="sysdba" password="Passw0rd" connectString="localhost:1521/FREEPDB1"`
configuration := `user="sys" sysdba=true password="Passw0rd" connectString="localhost:1521/FREE"`
databaseConnector, err := NewConnector(ctx, configuration)
failOnError(err)
_ = databaseConnector // Faux use of databaseConnector
Expand Down
9 changes: 1 addition & 8 deletions connectororacle/connectororacle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package connectororacle

import (
"context"
"fmt"
"os"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -16,13 +14,8 @@ import (
func TestNewConnector(test *testing.T) {
ctx := context.TODO()
// configuration := `user="sysdba" password="Passw0rd" connectString="localhost:1521/FREEPDB1"`
configuration := `user="sysdba" password="Passw0rd" connectString="localhost:1521/FREE"`
configuration := `user="sys" password="Passw0rd" sysdba=true noTimezoneCheck=true connectString="localhost:1521/FREE"`
databaseConnector, err := NewConnector(ctx, configuration)

for _, e := range os.Environ() {
fmt.Println(e)
}

require.NoError(test, err)
_, err = databaseConnector.Connect(ctx)
require.NoError(test, err)
Expand Down
7 changes: 7 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ These are "one-time tasks" which may already have been completed.

To run the tests successfully, Sqlite, PostgreSQL, MySQL, and MsSQL databases need to be accessable.

1. :thinking: Set environment variables.
Example:

```console
export LD_LIBRARY_PATH=/opt/senzing/er/lib:/opt/oracle/instantclient_23_5:$LD_LIBRARY_PATH
```

1. Run tests.
Example:

Expand Down
5 changes: 3 additions & 2 deletions makefiles/linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ coverage-osarch-specific:


.PHONY: dependencies-for-development-osarch-specific
dependencies-for-development-osarch-specific:
dependencies-for-development-osarch-specific:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.58.1


Expand Down Expand Up @@ -74,7 +74,8 @@ setup-osarch-specific:

.PHONY: test-osarch-specific
test-osarch-specific:
@go test -json -v -p 1 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
# @go test -json -v -p 1 ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
@go test -json -v -p 1 ./connectororacle 2>&1 | tee /tmp/gotest.log | gotestfmt

# -----------------------------------------------------------------------------
# Makefile targets supported only by this platform.
Expand Down

0 comments on commit 68b5168

Please sign in to comment.