Skip to content

Tests are not passing on master  #29

@temsa

Description

@temsa

As of 772ff91 ( version 1.2.1 ), this script would not lead to working tests:

git clone https://github.com/fastify/fastify-postgres.git
cd fastify-postgres
npm i
npm run postgres &
sleep 10
npm test

Note: my docker pg image is cached and instantiated for a while before tests starts.

The tests logs:

> fastify-postgres@1.2.1 test /path/to/fastify-postgres
> standard && tap test.js

test.js ...............................pg-native not installed, can't use native option - fallback to pg module
...ERROR:  relation "users" does not exist at character 13
STATEMENT:  INSERT INTO users(username) VALUES($1) RETURNING id
test.js ............................................. 35/40 11s
 fastify.pg.test use transact util with promise
 not ok (unnamed test)
   stack: |-
     Error: relation "users" does not exist
         at module.exports.Client._readError (/path/to/fastify-postgres/node_modules/pg-native/index.js:155:13)
         at module.exports.Client._emitResult (/path/to/fastify-postgres/node_modules/pg-native/index.js:178:12)
         at module.exports.Client._read (/path/to/fastify-postgres/node_modules/pg-native/index.js:220:31)
         at PQ.emit (events.js:182:13)
         at PQ.EventEmitter.emit (domain.js:442:20)
   message: relation "users" does not exist
   severity: ERROR
   code: 42P01
   position: '13'
   file: parse_relation.c
   line: '1160'
   routine: parserOpenTable
 
 fastify.pg.test use transact util with promise
 not ok test unfinished
   stack: |
     Object.<anonymous> (test.js:257:1)
   test: fastify.pg.test use transact util with promise
   at:
     line: 257
     column: 1
     file: test.js
     function: Object.<anonymous>
   source: |
     test('fastify.pg.test use transact util with promise', t => {
 
 not ok child test left in queue: t.test fastify.pg.test use transact util with callback
 not ok child test left in queue: t.test fastify.pg.test use transact util with commit callback
 not ok test count !== plan
   +++ found                                                          
   --- wanted                                                          
   -12                                                                
   +14                                                                
   results:
     ok: false
     count: 14
     pass: 11
     fail: 3
     bailout: false
     todo: 0
     skip: 0
     plan:
       start: 1
       end: 12
       skipAll: false
       skipReason: ''
       comment: ''
     failures:
       - ok: false
         id: 12
         time: 10028.298
         name: fastify.pg.test use transact util with promise
       - ok: false
         id: 13
         name: >-
           child test left in queue: t.test fastify.pg.test use transact util with
           callback
         parent: ''
       - ok: false
         id: 14
         name: >-
           child test left in queue: t.test fastify.pg.test use transact util with
           commit callback
         parent: ''

total ............................................... 35/40
 

 35 passing (11s)
 5 failing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions