[ARVADOS] updated: 2.1.0-21-gc77a932d5
Git user
git at public.arvados.org
Thu Oct 22 16:33:18 UTC 2020
Summary of changes:
lib/boot/supervisor.go | 2 ++
lib/controller/integration_test.go | 14 ++++++++++++++
2 files changed, 16 insertions(+)
via c77a932d5ec11838ff447ed56570b87823b9dd04 (commit)
from 87e3b2dd69e25bc1fdcf50c0dca623e871bce99b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit c77a932d5ec11838ff447ed56570b87823b9dd04
Author: Tom Clegg <tom at tomclegg.ca>
Date: Thu Oct 22 12:04:21 2020 -0400
17014: Test database connection to test cluster.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/boot/supervisor.go b/lib/boot/supervisor.go
index 3484a1444..90217eabe 100644
--- a/lib/boot/supervisor.go
+++ b/lib/boot/supervisor.go
@@ -59,6 +59,8 @@ type Supervisor struct {
environ []string // for child processes
}
+func (super *Supervisor) Cluster() *arvados.Cluster { return super.cluster }
+
func (super *Supervisor) Start(ctx context.Context, cfg *arvados.Config, cfgPath string) {
super.ctx, super.cancel = context.WithCancel(ctx)
super.done = make(chan struct{})
diff --git a/lib/controller/integration_test.go b/lib/controller/integration_test.go
index 077493ffc..cc0b697d4 100644
--- a/lib/controller/integration_test.go
+++ b/lib/controller/integration_test.go
@@ -7,6 +7,7 @@ package controller
import (
"bytes"
"context"
+ "database/sql"
"encoding/json"
"io"
"math"
@@ -133,6 +134,19 @@ func (s *IntegrationSuite) SetUpSuite(c *check.C) {
}
}
+func (s *IntegrationSuite) TestDatabaseConnection(c *check.C) {
+ ctx, cancel := context.WithCancel(context.Background())
+ defer cancel()
+ db, err := sql.Open("postgres", s.testClusters["z1111"].super.Cluster().PostgreSQL.Connection.String())
+ c.Assert(err, check.IsNil)
+ defer db.Close()
+ conn, err := db.Conn(ctx)
+ c.Assert(err, check.IsNil)
+ defer conn.Close()
+ _, err = conn.ExecContext(ctx, `SELECT 1`)
+ c.Assert(err, check.IsNil)
+}
+
func (s *IntegrationSuite) TearDownSuite(c *check.C) {
for _, c := range s.testClusters {
c.super.Stop()
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list