Added postgres conformance test for binding (#2034)

* Added postgres conformance test for binding

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Added quotations to the connection string

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Added postgres docker for bindings

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes based on the review comment

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
This commit is contained in:
amulyavarote 2022-08-30 12:06:40 -07:00 committed by GitHub
parent d630c03885
commit 57e4ca0f29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 2 deletions

View File

@ -45,6 +45,7 @@ jobs:
- bindings.mqtt-emqx
- bindings.mqtt-mosquitto
- bindings.mqtt-vernemq
- bindings.postgres
- bindings.redis
- bindings.rabbitmq
- pubsub.aws.snssqs
@ -296,7 +297,7 @@ jobs:
- name: Start postgresql
run: |
docker-compose -f ./.github/infrastructure/docker-compose-postgresql.yml -p postgresql up -d
if: contains(matrix.component, 'postgresql')
if: contains(matrix.component, 'postgres')
- name: Start cassandra
run: |

View File

@ -0,0 +1,10 @@
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: postgres-binding
spec:
type: bindings.postgres
version: v1
metadata:
- name: url # Required
value: "host=localhost user=postgres password=example port=5432 connect_timeout=10 database=dapr_test"

View File

@ -57,3 +57,6 @@ components:
operations: ["create", "operations", "read"]
config:
checkInOrderProcessing: false
- component: postgres
allOperations: false
operations: [ "exec", "query", "close", "operations" ]

View File

@ -45,6 +45,7 @@ import (
b_influx "github.com/dapr/components-contrib/bindings/influx"
b_kafka "github.com/dapr/components-contrib/bindings/kafka"
b_mqtt "github.com/dapr/components-contrib/bindings/mqtt"
b_postgres "github.com/dapr/components-contrib/bindings/postgres"
b_rabbitmq "github.com/dapr/components-contrib/bindings/rabbitmq"
b_redis "github.com/dapr/components-contrib/bindings/redis"
p_snssqs "github.com/dapr/components-contrib/pubsub/aws/snssqs"
@ -475,6 +476,8 @@ func loadOutputBindings(tc TestComponent) bindings.OutputBinding {
binding = b_mqtt.NewMQTT(testLogger)
case "rabbitmq":
binding = b_rabbitmq.NewRabbitMQ(testLogger)
case "postgres":
binding = b_postgres.NewPostgres(testLogger)
default:
return nil
}