addressing https://dev.arvados.org/issues/17014#note-8 Tests
authorNico Cesar <nico@nicocesar.com>
Tue, 17 Nov 2020 17:23:09 +0000 (12:23 -0500)
committerNico Cesar <nico@nicocesar.com>
Tue, 17 Nov 2020 17:23:09 +0000 (12:23 -0500)
Arvados-DCO-1.1-Signed-off-by: Nico Cesar <nico@curii.com>

lib/controller/integration_test.go

index d50bc14537ce149b45b0ed7b6a3945eacf1e4de8..998b177d1160197eaaea1646c047dba76c749c79 100644 (file)
@@ -522,12 +522,11 @@ func (s *IntegrationSuite) TestRuntimeTokenInCR(c *check.C) {
                c.Logf("cr.UUID: %s", cr.UUID)
                row := dbconn.QueryRowContext(rootctx1, `SELECT runtime_token from container_requests where uuid=$1`, cr.UUID)
                c.Assert(row, check.NotNil)
-               // runtimeToken is *string and not a string because the database has a NULL column for this
-               var runtimeToken *string
-               err = row.Scan(&runtimeToken)
-               c.Assert(err, check.IsNil)
-               c.Assert(runtimeToken, check.NotNil)
-               c.Assert(*runtimeToken, check.DeepEquals, *tt.expectedToken)
+               var token sql.NullString
+               row.Scan(&token)
+               if c.Check(token.Valid, check.Equals, true) {
+                       c.Check(token.String, check.Equals, *tt.expectedToken)
+               }
        }
 }