Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1198

Collection.findOne({_id: id}) failing on TravisCI Build

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.33
    • Component/s: MongoDB 3.4
    • Labels:
    • Environment:
      TravisCI, Node (LTS/Latest Stable)

      I am struggling with a mongodb bug. I am currently running some tests locally and running some tests on TravisCI.

      Locally, all tests pass.

      > jest --coverage
      
       PASS  __test__/modules/Auth.test.js
       PASS  __test__/modules/UserManager.test.js
       PASS  __test__/TravisCI.test.js
      
      Test Suites: 3 passed, 3 total
      Tests:       7 passed, 7 total
      Snapshots:   0 total
      Time:        2.535s
      Ran all test suites.
      

      However, on Travis, I get the following error:

        ● Auth Module › should authenticate a valid user
          expect(received).toEqual(expected)
          
          Expected value to equal:
            {"_id": "5a106615c7e216113c7940a0", "email": "test@test.com", "name": "Test User", "password": "$2a$12$Nug3WgSLqkZGRytfsJ16kOHvTPMmwGc7Ngpxx1fJrCg0dwMopWA5m"}
          Received:
            null
          
          Difference:
          
            Comparing two different types of values. Expected object but received null.
            
            at Object.it (__test__/modules/Auth.test.js:37:62)
                at <anonymous>
            at process._tickCallback (internal/process/next_tick.js:188:7)
      

      I am looking up an object by ID but it is returning null, despite having just created it using collection.insert.

      The code is open source, and the line that fails is here:

      This is the corresponding travis fail:

      Expected Behaviour is TravisCI test mimics my local test.

            Assignee:
            Unassigned Unassigned
            Reporter:
            udia Alexander Wong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: