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

five-bells-integration-test

v6.3.0

Published

A module to help with testing Five Bells components against each other

Downloads

335

Readme

five-bells-integration-test

A module to help with testing Five Bells components against each other

Introduction

This module is used by the CI tests of the different Five Bells components. This module is installed with each component as a dev dependency and run during continuous integration. When run, it installs the other components and then tests them against the local working tree of the current component.

Installation

npm install --save-dev five-bells-integration-test

Usage (with Docker)

Get the Docker image for the Five Bells integration tests, and save yourself a lot of configuration and slow building steps on your laptop:

docker pull michielbdejong/five-bells-integration-test

That pulls in a certified build from Docker's hub, but if you like to build the Docker imager yourself then just do docker build . instead.

You are probably not so interested in seeing the integration tests run on the master branches of the various repos as they were when this Docker image was built, because you can already watch that on circleci, but just so you know, the command for that would be:

docker run michielbdejong/five-bells-integration-test

So instead, go inside the container and run the tests interactively:

docker run -it --rm michielbdejong/five-bells-integration-test /bin/bash
$ cd integration-test/ilp-kit ; git status ; git fetch origin ; git checkout origin/my-awesome-improvement-that-I-want-to-test ; cd ../..
$ vim src/tests/index.js # add some debug statement to that failing `beforeEach` hook
$ vim integration-test/node_modules/ilp-connector/src/lib/route-builder.js +123 # add a console.log statement to see how that error is caused
$ ./src/bin/integration test advanced connector_first # run only the 'advanced' and 'connector_first' integration test
$ ./src/bin/integration test # run all the integration tests

Repositories tested by the integration tests:

  • ilp-kit
  • ilp-kit-cli
  • ilp
  • ilp-connector
  • ilp-routing
  • ilp-plugin-virtual
  • ilp-plugin-settlement-adapter
  • ilp-plugin-bells
  • five-bells-ledger
  • five-bells-shared
  • five-bells-condition

The branch-matching done by integration-loader is quite nifty, although sometimes you will have to read the code to know exactly what is going on. Roughly, what it does is:

  • if the branch in the /app folder is master, then test all master branches against each other.
  • if the branch is something else, try to check out that branch name on the different repositories as well. This allows you to refactor across repositories!
  • when run as npm run integration in the ilp-kit repository (not using this Docker image), it will load appropriate the versions of components, as specified by ilp-kit's package.json file. This allows the master branches of different components to be ahead of the ilp-kit master branch, which can be useful when we are working on a big change that will break the Interledger network. Updating ilp-kit can be postponed until all the components have been tested thoroughly.

To check out a cross-repo branch, for instance mj-currency_scale, do the following inside the container:

$ cd /app
$ git branch mj-currency_scale
$ git checkout mj-currency_scale
$ ./node_modules/.bin/integration-loader
$ src/bin/integration setup
$ cd integration-test/ilp-kit
$ npm rebuild node-sass; npm run build # this is necessary because running npm install as root causes it to skip the postinstall hook
$ cd ../..
$ ps auxwww # kill any npm/node processes still running from previous runs
$ src/bin/integration test connector_first
$ src/bin/integration test

You will probably need to manually keep track of which version of which package is installed in /app/node_modules, /app/integration-test/node_modules, and /app/integration-test/ilp-kit/node_modules to make sure you are testing the versions you want to. Of course, you can also still run the integration tests on circleci.com, or direcyly on your laptop, without Docker.

Usage (without Docker)

In any five-bells module which has five-bells-integration-test installed, simply run:

npm run integration

This is enabled by the following config in the package.json:

{
  "scripts": {
    "integration": "integration test"
  }
}

Tests

The five-bells-integration-test module can be tested on its own:

npm install
npm test