Skip to content

Instructions for running the tests #29

@arv

Description

@arv

I have postgres.app installed and running on port 5432 but there seems to be something else that I need to do to verify that things work as expected?

I also tried using act but I'm getting the same errors.

Here are the errors I'm seeing.

Terminal output

~/src/pg-logical-replication  qualify-paths ✗                                                                                                  21m ◒  ⍉
▶ POSTGRES_PORT=5432 npm run test

> [email protected] test
> jest --maxWorkers=1

 FAIL  src/test/decoder-wal2json.spec.ts
  ● wal2json › Insert, Delete(w/FK)

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)

  ● wal2json › Update

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)


  ● Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'end')

      18 |
      19 |   afterAll(async () => {
    > 20 |     await client.end();
         |                  ^
      21 |   });
      22 |
      23 |   it('Insert, Delete(w/FK)', async () => {

      at Object.<anonymous> (src/test/decoder-wal2json.spec.ts:20:18)

 FAIL  src/test/decoder-test.spec.ts
  ● test_decoding › Insert, Delete(w/FK)

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)

  ● test_decoding › Update

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)


  ● Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'end')

      17 |
      18 |   afterAll(async () => {
    > 19 |     await client.end();
         |                  ^
      20 |   });
      21 |
      22 |   it('Insert, Delete(w/FK)', async () => {

      at Object.<anonymous> (src/test/decoder-test.spec.ts:19:18)

 FAIL  src/test/decoder-pgoutput.spec.ts
  ● pgoutput › Insert, Delete(w/FK)

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)

  ● pgoutput › Update

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)

  ● pgoutput › Rollback

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)

  ● pgoutput › Huge transaction

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)


  ● Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'query')

      28 |
      29 |   afterAll(async () => {
    > 30 |     await client.query(
         |                  ^
      31 |       //language=sql
      32 |       `DROP
      33 |       PUBLICATION IF EXISTS "${publicationName}"`

      at Object.<anonymous> (src/test/decoder-pgoutput.spec.ts:30:18)

 FAIL  src/test/acknowledge.spec.ts
  ● acknowledge › Resume streaming using the internal _lastLsn value

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)


  ● Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'end')

      18 |
      19 |   afterAll(async () => {
    > 20 |     await client.end();
         |                  ^
      21 |   });
      22 |
      23 |   it('Resume streaming using the internal _lastLsn value', async () => {

      at Object.<anonymous> (src/test/acknowledge.spec.ts:20:18)

 FAIL  src/test/decoder-decoderbufs.spec.ts
  ● decoderbufs › Insert, Delete(w/FK)

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)

  ● decoderbufs › Update

    error: database "playground" does not exist

      at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
      at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
      at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
      at Socket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)


  ● Test suite failed to run

    TypeError: Cannot read properties of undefined (reading 'end')

      21 |
      22 |   afterAll(async () => {
    > 23 |     await client.end();
         |                  ^
      24 |   });
      25 |
      26 |   it('Insert, Delete(w/FK)', async () => {

      at Object.<anonymous> (src/test/decoder-decoderbufs.spec.ts:23:18)

Test Suites: 5 failed, 5 total
Tests:       11 failed, 11 total
Snapshots:   0 total
Time:        1.3 s, estimated 2 s
Ran all test suites.

~/src/pg-logical-replication  qualify-paths ✗                                                                                                  23m ◒  ⍉
▶

If I run

psql -c 'create table playground'

and then run the tests again using:

POSTGRES_PORT=5432 npm run test

I get a bunch of other errors.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions