• Stars
    star
    599
  • Rank 74,745 (Top 2 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

♻️ Test your libraries in many different versions of NodeJS, Ruby, Java and many other languages

autochecker

autochecker tests your libraries in many different versions of NodeJS, Ruby, Java and many other languages.

Created to make it easier and effortless to make sure your library works in many versions of a language runtime.

Works well with CI as well! (See some example output)

(Works out of the box with NodeJS projects right now, more in the future!)

Demonstration of functionality

Requirements

  • Docker -> install here
  • package.json scripts.test setup correctly (for NodeJS projects)
  • Two environment variables, DOCKER_HOST and DOCKER_CERT_PATH (comes by default with docker-machine)

DOCKER_HOST should look similar to this: tcp://192.168.99.100:2376

DOCKER_CERT_PATH should look similar to this: /Users/victor/.docker/machine/machines/default

Installation

As always, one step:

  • For one project > npm install autochecker

  • Globally on your computer OR to use with other languages > npm install -g autochecker

For extra style points, make sure autochecker is run before publishing your modules:

In package.json:

"scripts": {
	"prepublish": "autochecker 0.10 0.12 4.0 5.0"
}

Running NodeJS project out of the box

By default, executing autochecker will run the tests on all available versions.

You can specify which versions you want to test by adding them in the end of the command:

autochecker 0.10 0.11 4 5.10.1

Versions comes from the mhart/alpine-node docker image tags

Running with other languages

To see how you can run autochecker with a Ruby project + CI integration, please take a look at this repository: https://github.com/VictorBjelkholm/ruby-autochecker-example/

Otherwise, there is a couple of examples of other languages in the /examples directory

Setting max running tests

By default, autochecker starts as many testing sessions as os.cpu().length would return.

However, you can overwrite this by providing the TEST_LIMIT environment variable.

Example: TEST_LIMIT=10 autochecker to run 10 test sessions at a time

Custom Dockerfile template

You can specify custom Dockerfile template if you need additional tools installed, for example if you need git, create a file in the project DockerTemplate with the following

FROM mhart/alpine-node:$VERSION
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json .
# Adding extra tools
RUN apk add --update git
RUN npm install
COPY . .
CMD npm test

Variable $VERSION will be replaced by autochecker. More information about alpine images and additional tools at docker-alpine and alpine-node.

Aside from adding libraries to the container, the custom template can be useful to avoid running postinstall hooks. Just use RUN npm install --ignore-scripts instead.

Programmatic API

You can use autochecker in your own projects from NodeJS directly.

var autochecker = require('autochecker')
const Docker = require('dockerode')
var dockerode_instance = new Docker({socketPath: '/var/run/docker.sock'});
autochecker.runTestForVersion({
  logger: (msg) => { console.log(msg) },
  docker: dockerode_instance,
  version: '1.1.1', // version of project
  name: 'myproject', // name of project
  test_cmd: ['npm', 'test'], // command to run tests with
  image_name: 'app/image:commit', // What the built application image will be called
  path: join(__dirname, 'path_to_project'), // Path to project to build
  dockerfile: 'FROM nodejs:$VERSION', // Dockerfile
  base_image: 'base/image', // Base image, will add :$VERSION to the end
  verbose: false // To show full output or not
})((err, results) => {
  console.log(results)
  // => {version: '1.1.1', success: true || false, output: 'output from test_cmd'}
})

See cli.js for usage with testing multiple versions at once.

Changelog

You can find a list of all versions and changes in the CHANGELOG.md file

License

MIT License 2016 - Victor Bjelkholm

More Repositories

1

ngProgress

⏳ Angular provider for slim loading bar at the top of the page ( inspired by https://github.com/rstacruz/nprogress )
JavaScript
1,485
star
2

trymodule

➰ It's never been easier to try nodejs modules!
JavaScript
1,137
star
3

ipfscrape

Scrape pages and store them in IPFS
Shell
267
star
4

ipfsbin

〰 Distribute your code snippets in IPFS
JavaScript
134
star
5

atom-react-preview

♨️ Preview your React components directly in React, with mutable props! [Not maintained]
JavaScript
85
star
6

resort

A experiment with showing live video feeds with IPFS and libp2p
JavaScript
81
star
7

obsidian-wielder

Clojure inside your Obsidian documents!
TypeScript
68
star
8

pincoop

Pin your hashes all over the world
JavaScript
67
star
9

metamorph

Self-editing GPT-4 application
JavaScript
62
star
10

arch-mirror

IPFS mirror of pacman repositories
Shell
34
star
11

ipfschat

Global chat with IPFS
JavaScript
18
star
12

quickwiki

QuickWiki is the quickest wiki ever! Static, extensible and beautiful by default
Go
16
star
13

mullvad-find-fastest-server

Go
15
star
14

gx-js

Immutable Package management for the JavaScript ecosystem using IPFS
JavaScript
15
star
15

ipfs-webpack-plugin

Creates additional webpack assets for loading the assets via IPFS in the browser
JavaScript
10
star
16

tree-talk

A tree in the merkle-forest where you can just hang around and talk
CSS
9
star
17

alpine-mirror

Scripts for mirroring the APKs archives for Alpine-linux and testing it
Shell
8
star
18

magnet-to-ipfs

Go
8
star
19

webpack-node-ipfs-api-demo

Demo of how to use webpack + node-ipfs-api
JavaScript
7
star
20

js-ipfs-in-the-browser

JavaScript
6
star
21

Jitter

Figure out your network Jitter
JavaScript
6
star
22

referendum-2017

Projecte personal per visitar el lloc web de Catalunya Referèndum 2017 a través de l'IPFS
Go
5
star
23

ipfs-events

List of all events in IPFS
4
star
24

figma-shared-plugin-data

List of Figma Plugins and their shared data
4
star
25

ipfs-hack-day-barcelona-october-2017

IPFS Hack Day Barcelona - October 2017
4
star
26

Hoster

Easy manage host files via a CLI
Shell
4
star
27

js-ipfs-passing-data

JavaScript
3
star
28

pine

Vine clone over IPFS
JavaScript
3
star
29

self-editing-website

A P2P website that can edit and replicate itself
JavaScript
3
star
30

dweb.cat

Archive and entrypoint for important Catalan culture and language
HCL
2
star
31

ipfs-api-pubsub-ruby-example

Example with Ruby using go-ipfs HTTP API for pubsub
Ruby
2
star
32

vimrc

Vim Script
2
star
33

ipfs-chat

JavaScript
2
star
34

talk-ideal-foss-service

Talk performed at OPO.js Meetup #9 (June 19th 2019)
HTML
2
star
35

js-ipfs-development-environment

Makes it easy to setup a development environment for developing js-ipfs
Shell
2
star
36

programmer-backup-checklist

What to backup
2
star
37

dweb-wiki

A knowledge base geared towards building and researching a fully distributed web
HTML
2
star
38

cowpen

CLI for publishing immutable NPM packages/NodeJS modules
JavaScript
1
star
39

outside

Outside, a free-to-play MMORPG developed by Deity Games and the most popular game, with 7 billion+ active players
1
star
40

cljfx-graalvm

Trying to get cljfx + graalvm to play nicely
Clojure
1
star
41

github-dead-link-checker

Checks for dead links in Github organizations and repositories
Go
1
star
42

sci-reagent-with-let

Clojure
1
star
43

js-ipfs-docker

JavaScript
1
star
44

sympersister

Tiny local service for making sure symlinks always works
1
star
45

node-on-ipfs

NodeJS downloaded and then served with IPFS
JavaScript
1
star
46

livingthing

Clojure
1
star
47

npm-scripts-exec

npm-scripts-exec is a handy utility to make your life as a nodejs developer easier, by exposing npm scripts as normal shell commands
Shell
1
star
48

crux-site-mock

A redacted clone of the private `crux-site` repo to enable people to preview and contribute to the Crux documentation sections of http://opencrux.com
SCSS
1
star
49

clojulator

Calculator made with Clojurescript + om
Clojure
1
star