npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mongodb-connection-fixture

v0.0.14

Published

Fixture data used by mongodb-connection-model for testing.

Downloads

29

Readme

mongodb-connection-fixture travis npm

Fixture data used by mongodb-connection-model for testing.

Example

var fixtures = require('mongodb-connection-fixture').MATRIX;
var connect = require('mongodb-connection-model').connect;
var format = require('util').format;

if (fixtures.length === 0) {
  describe(format('Connect to %d instances in the cloud #slow', fixtures.length), function() {
    it.skip('please see https://github.com/mongodb-js/connection-fixture');
  });
} else {
  describe(format('Connect to %d instances in the cloud #slow', fixtures.length), function() {
    fixtures.map(function(model) {
      if (process.env.dry) {
        it(format('should connect to `%s`', model.name));
      } else {
        it(format('should connect to `%s`', model.name), function(done) {
          this.slow(5000);
          this.timeout(10000);
          connect(model, done);
        });
      }
    });
  });
}

Configuration

The mongodb-connection-fixture module is configurable via environment variables which will automatically control the values returned when running require('mongodb-connection-fixture').MATRIX.

The best way to explain is by using our mocha example above. So first, clone this repo and install dependecies:

git clone [email protected]:mongodb-js/connection-fixture.git ~/mongodb/connection-fixture;
cd ~/mongodb/connection-fixture && npm install;

Now if we just npm run example, we'll see the following:

Connect to 0 instances in the cloud #slow
  - please see https://github.com/mongodb-js/connection-fixture


0 passing (5ms)
1 pending

0 functional tests isn't so good... Fortunately, there are 4 environment variables we can use to make this > 0:

  • MONGODB_KERBEROS
  • MONGODB_KERBEROS_PASSWORD
  • MONGODB_LDAP_PASSWORD
  • MONGODB_PASSWORD_INTEGRATIONS
  • MONGODB_PASSWORD_COMPASS
  • MONGODB_PASSWORD_FANCLUB
MONGODB_KERBEROS=1 npm run example;
Connect to 1 instances in the cloud #slow
  - should connect to `Enterprise: Kerberos (evergreen only)`


0 passing (8ms)
1 pending
MONGODB_KERBEROS=1 MONGODB_KERBEROS_PASSWORD=arlo npm run example;
Connect to 2 instances in the cloud #slow
  - should connect to `Enterprise: Kerberos (evergreen only)`
  - should connect to `Enterprise: Kerberos w/ password (evergreen only)`


0 passing (7ms)
2 pending
MONGODB_KERBEROS=1 MONGODB_KERBEROS_PASSWORD=arlo MONGODB_LDAP_PASSWORD=basil npm run example;
Connect to 3 instances in the cloud #slow
  - should connect to `Enterprise: LDAP (evergreen only)`
  - should connect to `Enterprise: Kerberos (evergreen only)`
  - should connect to `Enterprise: Kerberos w/ password (evergreen only)`


0 passing (6ms)
3 pending
MONGODB_PASSWORD_INTEGRATIONS=foo npm run example;
  Connect to 21 instances in the cloud #slow
    - should connect to `🔒  [email protected] Standalone: Store 1`
    - should connect to `🔒  [email protected] Standalone: Store 1`
    - should connect to `🔒  [email protected] Replicaset: Store 1`
    - should connect to `🔒  [email protected] Replicaset: Store 2`
    - should connect to `🔒  [email protected] Replicaset: Store 3`
    - should connect to `🔒  [email protected] Cluster: Router 1`
    - should connect to `🔒  [email protected] Cluster: Router 2`
    - should connect to `🔒  [email protected] Cluster: Router 3`
    - should connect to `🔒  [email protected] Cluster: Config 1`
    - should connect to `🔒  [email protected] Cluster: Config 2`
    - should connect to `🔒  [email protected] Cluster: Config 3`
    - should connect to `🔒  [email protected] Cluster: Store 1`
    - should connect to `🔒  [email protected] Cluster: Store 2`
    - should connect to `🔒  [email protected] Cluster: Store 3`
    - should connect to `🔒  [email protected] Cluster: Router 1`
    - should connect to `🔒  [email protected] Cluster: Store 1`
    - should connect to `🔒  [email protected] Cluster: Store 2`
    - should connect to `🔒  [email protected] Cluster: Store 3`
    - should connect to `🔒  [email protected] Cluster: Config 1`
    - should connect to `🔒  [email protected] Cluster: Config 2`
    - should connect to `🔒  [email protected] Cluster: Config 3`


  0 passing (6ms)
  21 pending
MONGODB_PASSWORD_INTEGRATIONS=foo MONGODB_PASSWORD_COMPASS=bar npm run example
  Connect to 42 instances in the cloud #slow
    - should connect to `🔒  [email protected] Standalone: Store 1`
    - should connect to `🔒  [email protected] Standalone: Store 1`
    - should connect to `🔒  [email protected] Replicaset: Store 1`
    - should connect to `🔒  [email protected] Replicaset: Store 2`
    - should connect to `🔒  [email protected] Replicaset: Store 3`
    - should connect to `🔒  [email protected] Cluster: Router 1`
    - should connect to `🔒  [email protected] Cluster: Router 2`
    - should connect to `🔒  [email protected] Cluster: Router 3`
    - should connect to `🔒  [email protected] Cluster: Config 1`
    - should connect to `🔒  [email protected] Cluster: Config 2`
    - should connect to `🔒  [email protected] Cluster: Config 3`
    - should connect to `🔒  [email protected] Cluster: Store 1`
    - should connect to `🔒  [email protected] Cluster: Store 2`
    - should connect to `🔒  [email protected] Cluster: Store 3`
    - should connect to `🔒  [email protected] Cluster: Router 1`
    - should connect to `🔒  [email protected] Cluster: Store 1`
    - should connect to `🔒  [email protected] Cluster: Store 2`
    - should connect to `🔒  [email protected] Cluster: Store 3`
    - should connect to `🔒  [email protected] Cluster: Config 1`
    - should connect to `🔒  [email protected] Cluster: Config 2`
    - should connect to `🔒  [email protected] Cluster: Config 3`
    - should connect to `🔒  [email protected] Standalone: Store 1`
    - should connect to `🔒  [email protected] Standalone: Store 1`
    - should connect to `🔒  [email protected] Replicaset: Store 1`
    - should connect to `🔒  [email protected] Replicaset: Store 2`
    - should connect to `🔒  [email protected] Replicaset: Store 3`
    - should connect to `🔒  [email protected] Cluster: Router 1`
    - should connect to `🔒  [email protected] Cluster: Router 2`
    - should connect to `🔒  [email protected] Cluster: Router 3`
    - should connect to `🔒  [email protected] Cluster: Config 1`
    - should connect to `🔒  [email protected] Cluster: Config 2`
    - should connect to `🔒  [email protected] Cluster: Config 3`
    - should connect to `🔒  [email protected] Cluster: Store 1`
    - should connect to `🔒  [email protected] Cluster: Store 2`
    - should connect to `🔒  [email protected] Cluster: Store 3`
    - should connect to `🔒  [email protected] Cluster: Router 1`
    - should connect to `🔒  [email protected] Cluster: Store 1`
    - should connect to `🔒  [email protected] Cluster: Store 2`
    - should connect to `🔒  [email protected] Cluster: Store 3`
    - should connect to `🔒  [email protected] Cluster: Config 1`
    - should connect to `🔒  [email protected] Cluster: Config 2`
    - should connect to `🔒  [email protected] Cluster: Config 3`


  0 passing (8ms)
  42 pending
MONGODB_PASSWORD_INTEGRATIONS=foo MONGODB_PASSWORD_COMPASS=bar MONGODB_PASSWORD_FANCLUB=baz npm run example
Connect to 63 instances in the cloud #slow
  - should connect to `🔒  [email protected] Standalone: Store 1`
  - should connect to `🔒  [email protected] Standalone: Store 1`
  - should connect to `🔒  [email protected] Replicaset: Store 1`
  - should connect to `🔒  [email protected] Replicaset: Store 2`
  - should connect to `🔒  [email protected] Replicaset: Store 3`
  - should connect to `🔒  [email protected] Cluster: Router 1`
  - should connect to `🔒  [email protected] Cluster: Router 2`
  - should connect to `🔒  [email protected] Cluster: Router 3`
  - should connect to `🔒  [email protected] Cluster: Config 1`
  - should connect to `🔒  [email protected] Cluster: Config 2`
  - should connect to `🔒  [email protected] Cluster: Config 3`
  - should connect to `🔒  [email protected] Cluster: Store 1`
  - should connect to `🔒  [email protected] Cluster: Store 2`
  - should connect to `🔒  [email protected] Cluster: Store 3`
  - should connect to `🔒  [email protected] Cluster: Router 1`
  - should connect to `🔒  [email protected] Cluster: Store 1`
  - should connect to `🔒  [email protected] Cluster: Store 2`
  - should connect to `🔒  [email protected] Cluster: Store 3`
  - should connect to `🔒  [email protected] Cluster: Config 1`
  - should connect to `🔒  [email protected] Cluster: Config 2`
  - should connect to `🔒  [email protected] Cluster: Config 3`
  - should connect to `🔒  [email protected] Standalone: Store 1`
  - should connect to `🔒  [email protected] Standalone: Store 1`
  - should connect to `🔒  [email protected] Replicaset: Store 1`
  - should connect to `🔒  [email protected] Replicaset: Store 2`
  - should connect to `🔒  [email protected] Replicaset: Store 3`
  - should connect to `🔒  [email protected] Cluster: Router 1`
  - should connect to `🔒  [email protected] Cluster: Router 2`
  - should connect to `🔒  [email protected] Cluster: Router 3`
  - should connect to `🔒  [email protected] Cluster: Config 1`
  - should connect to `🔒  [email protected] Cluster: Config 2`
  - should connect to `🔒  [email protected] Cluster: Config 3`
  - should connect to `🔒  [email protected] Cluster: Store 1`
  - should connect to `🔒  [email protected] Cluster: Store 2`
  - should connect to `🔒  [email protected] Cluster: Store 3`
  - should connect to `🔒  [email protected] Cluster: Router 1`
  - should connect to `🔒  [email protected] Cluster: Store 1`
  - should connect to `🔒  [email protected] Cluster: Store 2`
  - should connect to `🔒  [email protected] Cluster: Store 3`
  - should connect to `🔒  [email protected] Cluster: Config 1`
  - should connect to `🔒  [email protected] Cluster: Config 2`
  - should connect to `🔒  [email protected] Cluster: Config 3`
  - should connect to `🔒  [email protected] Standalone: Store 1`
  - should connect to `🔒  [email protected] Standalone: Store 1`
  - should connect to `🔒  [email protected] Replicaset: Store 1`
  - should connect to `🔒  [email protected] Replicaset: Store 2`
  - should connect to `🔒  [email protected] Replicaset: Store 3`
  - should connect to `🔒  [email protected] Cluster: Router 1`
  - should connect to `🔒  [email protected] Cluster: Router 2`
  - should connect to `🔒  [email protected] Cluster: Router 3`
  - should connect to `🔒  [email protected] Cluster: Config 1`
  - should connect to `🔒  [email protected] Cluster: Config 2`
  - should connect to `🔒  [email protected] Cluster: Config 3`
  - should connect to `🔒  [email protected] Cluster: Store 1`
  - should connect to `🔒  [email protected] Cluster: Store 2`
  - should connect to `🔒  [email protected] Cluster: Store 3`
  - should connect to `🔒  [email protected] Cluster: Router 1`
  - should connect to `🔒  [email protected] Cluster: Store 1`
  - should connect to `🔒  [email protected] Cluster: Store 2`
  - should connect to `🔒  [email protected] Cluster: Store 3`
  - should connect to `🔒  [email protected] Cluster: Config 1`
  - should connect to `🔒  [email protected] Cluster: Config 2`
  - should connect to `🔒  [email protected] Cluster: Config 3`


0 passing (9ms)
63 pending

TravisCI

# Enable any functional tests in this project for the following cloud manager users
travis encrypt MONGODB_PASSWORD_INTEGRATIONS='<users_password>' --add;
travis encrypt MONGODB_PASSWORD_COMPASS='<users_password>' --add;
travis encrypt MONGODB_PASSWORD_FANCLUB='<users_password>' --add;

See the cloud-stage doc on google drive for password values.

Evergreen

# Enable any functional tests in this project for Kerberos or LDAP
EVERGREEN=1;

License

Apache 2.0