{"id":13510365,"url":"https://github.com/victorb/autochecker","last_synced_at":"2025-04-05T08:06:48.805Z","repository":{"id":66012711,"uuid":"56036048","full_name":"victorb/autochecker","owner":"victorb","description":"♻️ Test your libraries in many different versions of NodeJS, Ruby, Java and many other languages","archived":false,"fork":false,"pushed_at":"2020-03-13T20:47:31.000Z","size":3838,"stargazers_count":597,"open_issues_count":10,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-18T12:31:50.746Z","etag":null,"topics":["docker","java","nodejs","ruby","testing"],"latest_commit_sha":null,"homepage":"http://victorbjelkholm.github.io/autochecker/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victorb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-04-12T06:09:35.000Z","updated_at":"2024-01-04T16:04:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"5d6a5845-09c0-4518-a116-5d05c8fffb91","html_url":"https://github.com/victorb/autochecker","commit_stats":null,"previous_names":["victorbjelkholm/autochecker"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fautochecker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fautochecker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fautochecker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fautochecker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victorb","download_url":"https://codeload.github.com/victorb/autochecker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305934,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","java","nodejs","ruby","testing"],"created_at":"2024-08-01T02:01:35.741Z","updated_at":"2025-04-05T08:06:48.789Z","avatar_url":"https://github.com/victorb.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","testing"],"sub_categories":[],"readme":"# autochecker\n\nautochecker tests your libraries in many different versions of NodeJS, Ruby, Java and many other languages.\n\nCreated to make it easier and effortless to make sure your library works in many versions of a language runtime.\n\nWorks well with CI as well! ([See some example output](https://github.com/VictorBjelkholm/ruby-autochecker-example/))\n\n(Works out of the box with NodeJS projects right now, more in the future!)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./demo.gif\" alt=\"Demonstration of functionality\"\u003e\n\u003c/p\u003e\n\n## Requirements\n\n* Docker -\u003e [install here](https://www.docker.com/products/docker-toolbox)\n* `package.json` `scripts.test` setup correctly (for NodeJS projects)\n* Two environment variables, `DOCKER_HOST` and `DOCKER_CERT_PATH` (comes by default with docker-machine)\n\n`DOCKER_HOST` should look similar to this: `tcp://192.168.99.100:2376`\n\n`DOCKER_CERT_PATH` should look similar to this: `/Users/victor/.docker/machine/machines/default`\n\n## Installation\n\nAs always, one step:\n\n* For one project \u003e `npm install autochecker`\n\n* Globally on your computer OR to use with other languages \u003e `npm install -g autochecker`\n\nFor extra style points, make sure autochecker is run before publishing your modules:\n\nIn `package.json`:\n\n```json\n\"scripts\": {\n\t\"prepublish\": \"autochecker 0.10 0.12 4.0 5.0\"\n}\n```\n\n## Running NodeJS project out of the box\n\nBy default, executing `autochecker` will run the tests on all available versions.\n\nYou can specify which versions you want to test by adding them in the end of the command:\n\n`autochecker 0.10 0.11 4 5.10.1`\n\nVersions comes from the `mhart/alpine-node` docker image tags\n\n## Running with other languages\n\nTo 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/\n\nOtherwise, there is a couple of examples of other languages in the [/examples](/examples) directory\n\n## Setting max running tests\n\nBy default, autochecker starts as many testing sessions as `os.cpu().length` would return. \n\nHowever, you can overwrite this by providing the TEST_LIMIT environment variable.\n\nExample: `TEST_LIMIT=10 autochecker` to run 10 test sessions at a time\n\n## Custom Dockerfile template\n\nYou can specify custom Dockerfile template if you need additional tools installed, for\nexample if you need `git`, create a file in the project `DockerTemplate` with the following\n\n```\nFROM mhart/alpine-node:$VERSION\nRUN mkdir -p /usr/src/app\nWORKDIR /usr/src/app\nCOPY package.json .\n# Adding extra tools\nRUN apk add --update git\nRUN npm install\nCOPY . .\nCMD npm test\n```\n\nVariable `$VERSION` will be replaced by autochecker. More information about alpine images\nand additional tools at \n[docker-alpine](https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md) and\n[alpine-node](https://github.com/mhart/alpine-node).\n\nAside from adding libraries to the container, the custom template can be useful to avoid running postinstall\nhooks. Just use `RUN npm install --ignore-scripts` instead.\n\n## Programmatic API\n\nYou can use `autochecker` in your own projects from NodeJS directly.\n\n```javascript\nvar autochecker = require('autochecker')\nconst Docker = require('dockerode')\nvar dockerode_instance = new Docker({socketPath: '/var/run/docker.sock'});\nautochecker.runTestForVersion({\n  logger: (msg) =\u003e { console.log(msg) },\n  docker: dockerode_instance,\n  version: '1.1.1', // version of project\n  name: 'myproject', // name of project\n  test_cmd: ['npm', 'test'], // command to run tests with\n  image_name: 'app/image:commit', // What the built application image will be called\n  path: join(__dirname, 'path_to_project'), // Path to project to build\n  dockerfile: 'FROM nodejs:$VERSION', // Dockerfile\n  base_image: 'base/image', // Base image, will add :$VERSION to the end\n  verbose: false // To show full output or not\n})((err, results) =\u003e {\n  console.log(results)\n  // =\u003e {version: '1.1.1', success: true || false, output: 'output from test_cmd'}\n})\n```\n\nSee `cli.js` for usage with testing multiple versions at once.\n\n## Changelog\n\nYou can find a list of all versions and changes in the [CHANGELOG.md](CHANGELOG.md) file\n\n## License\n\nMIT License 2016 - Victor Bjelkholm\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorb%2Fautochecker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorb%2Fautochecker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorb%2Fautochecker/lists"}