Skip to content

Commit

Permalink
chore: fix coverage issues (stipsan#883)
Browse files Browse the repository at this point in the history
* chore: fix coverage issues

* chore: fix missing coverage folder issue

* chore: don't run twice

* chore: use npx to solve windows issues

* chore: ignore master

* chore: fix node8 on windows ci

* chore: push to same branch

* chore: remove npx workarounds

* docs: update feature compat table

* docs: update feature compat table

* chore: don't push empty commits

* docs: update feature compat table

* chore: avoid formatting issues

* chore: include node 13
  • Loading branch information
stipsan authored Nov 21, 2019
1 parent 22871b3 commit 72698b7
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 124 deletions.
17 changes: 2 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:8.12.0
- image: circleci/node:8.16.0
# To support coverage reports from forks
environment:
CODECLIMATE_REPO_TOKEN: 688d3234f9bb133fe6efa4dfe74f7a7510f2d9c1dca419875de8257a5f02da45
COVERALLS_REPO_TOKEN: uXjaiJ9eS9qZ22QdYHeiqwrsQi9aOWJbz
FORCE_COLOR: true

steps:
Expand All @@ -20,21 +19,9 @@ jobs:
# --frozen-lockfile ensures yarn.lockfile isn't accidentally outdated compared to package.json
- run: yarn install --no-progress --frozen-lockfile

# Running the testing suite with coverage enabled doubles as
# npx -p node-bin@latest -- yarn test
- run: yarn coverage

# Allows browsing the html coverage report generated by nyc
- store_artifacts:
path: ./coverage/lcov-report

# Let the CI know we got test results it can parse
- store_test_results:
path: ./junit

# Easy debug junit xml files by storing them in the build
- store_artifacts:
path: ./junit
- run: yarn codeclimate

# Make sure we don't get any surprises later when we try to publish a release
- run: yarn prepublishOnly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
needs: [build]
strategy:
matrix:
node_version: [8, 10, 12]
node_version: [13, 12, 10, 8]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: Test Coveralls

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v1

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: npm install, make test-coverage
run: |
yarn --frozen-lockfile
yarn coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/updatecompat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: update compat

on:
push:
branches:
branches-ignore:
- master

jobs:
Expand All @@ -27,4 +27,5 @@ jobs:
- name: push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ioredis-mock · [![npm](https://img.shields.io/npm/dm/ioredis-mock.svg?style=flat-square)](https://npm-stat.com/charts.html?package=ioredis-mock) [![npm version](https://img.shields.io/npm/v/ioredis-mock.svg?style=flat-square)](https://www.npmjs.com/package/ioredis-mock) [![Redis Compatibility: 60%](https://img.shields.io/badge/redis-60%25-yellow.svg?style=flat-square)](compat.md) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
# ioredis-mock · [![npm](https://img.shields.io/npm/dm/ioredis-mock.svg?style=flat-square)](https://npm-stat.com/charts.html?package=ioredis-mock) [![npm version](https://img.shields.io/npm/v/ioredis-mock.svg?style=flat-square)](https://www.npmjs.com/package/ioredis-mock) [![Redis Compatibility: 61%](https://img.shields.io/badge/redis-61%25-yellow.svg?style=flat-square)](compat.md) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)

This library emulates [ioredis](https://github.com/luin/ioredis) by performing
all operations in-memory. The best way to do integration testing against redis
Expand Down
8 changes: 4 additions & 4 deletions compat.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Supported commands ![Commands Coverage: 60%](https://img.shields.io/badge/coverage-60%25-yellow.svg)
## Supported commands ![Commands Coverage: 61%](https://img.shields.io/badge/coverage-61%25-yellow.svg)

| redis | ioredis | ioredis-mock |
| --------------------------------------------------------------------- | :----------------: | :----------------: |
Expand Down Expand Up @@ -174,22 +174,22 @@
| [zcard](http://redis.io/commands/ZCARD) | :white_check_mark: | :white_check_mark: |
| [zcount](http://redis.io/commands/ZCOUNT) | :white_check_mark: | :white_check_mark: |
| [zincrby](http://redis.io/commands/ZINCRBY) | :white_check_mark: | :white_check_mark: |
| [zinterstore](http://redis.io/commands/ZINTERSTORE) | :white_check_mark: | :x: |
| [zinterstore](http://redis.io/commands/ZINTERSTORE) | :white_check_mark: | :white_check_mark: |
| [zlexcount](http://redis.io/commands/ZLEXCOUNT) | :white_check_mark: | :x: |
| [zpopmax](http://redis.io/commands/ZPOPMAX) | :white_check_mark: | :x: |
| [zpopmin](http://redis.io/commands/ZPOPMIN) | :white_check_mark: | :x: |
| [zrange](http://redis.io/commands/ZRANGE) | :white_check_mark: | :white_check_mark: |
| [zrangebylex](http://redis.io/commands/ZRANGEBYLEX) | :white_check_mark: | :x: |
| [zrangebyscore](http://redis.io/commands/ZRANGEBYSCORE) | :white_check_mark: | :white_check_mark: |
| [zrank](http://redis.io/commands/ZRANK) | :white_check_mark: | :x: |
| [zrank](http://redis.io/commands/ZRANK) | :white_check_mark: | :white_check_mark: |
| [zrem](http://redis.io/commands/ZREM) | :white_check_mark: | :white_check_mark: |
| [zremrangebylex](http://redis.io/commands/ZREMRANGEBYLEX) | :white_check_mark: | :x: |
| [zremrangebyrank](http://redis.io/commands/ZREMRANGEBYRANK) | :white_check_mark: | :white_check_mark: |
| [zremrangebyscore](http://redis.io/commands/ZREMRANGEBYSCORE) | :white_check_mark: | :white_check_mark: |
| [zrevrange](http://redis.io/commands/ZREVRANGE) | :white_check_mark: | :white_check_mark: |
| [zrevrangebylex](http://redis.io/commands/ZREVRANGEBYLEX) | :white_check_mark: | :x: |
| [zrevrangebyscore](http://redis.io/commands/ZREVRANGEBYSCORE) | :white_check_mark: | :white_check_mark: |
| [zrevrank](http://redis.io/commands/ZREVRANK) | :white_check_mark: | :x: |
| [zrevrank](http://redis.io/commands/ZREVRANK) | :white_check_mark: | :white_check_mark: |
| [zscan](http://redis.io/commands/ZSCAN) | :white_check_mark: | :white_check_mark: |
| [zscore](http://redis.io/commands/ZSCORE) | :white_check_mark: | :white_check_mark: |
| [zunionstore](http://redis.io/commands/ZUNIONSTORE) | :white_check_mark: | :x: |
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
],
"scripts": {
"codeclimate": "codeclimate-test-reporter < ./coverage/lcov.info",
"precoverage": "nyc --reporter=lcov yarn test --reporter mocha-circleci-reporter --reporter-options testsuitesTitle=node@$(node --version),mochaFile=junit/$(node --version).xml",
"coverage": "yarn codeclimate",
"precoverage": "npx rimraf coverage && npx mkdirp coverage && yarn test",
"coverage": "nyc report --reporter=text-lcov > ./coverage/lcov.info",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"lint": "eslint .",
"prepublishOnly": "npx rimraf lib && npx mkdirp lib && babel src --out-dir lib",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"test": "mocha --require babel-core/register --recursive",
"test": "nyc mocha --require babel-core/register --recursive",
"update-compat": "node scripts/update-compat && git add compat.md README.md && git commit --quiet -m \"docs: Update feature compat table\" &> /dev/null || true"
},
"dependencies": {
Expand Down Expand Up @@ -59,7 +59,7 @@
"ioredis": "4.14.1",
"lint-staged": "9.4.2",
"mocha": "6.2.2",
"mocha-circleci-reporter": "0.0.3",
"mocha-lcov-reporter": "^1.3.0",
"nyc": "14.1.1",
"prettier": "1.18.2",
"prettier-package-json": "2.1.0",
Expand Down
3 changes: 2 additions & 1 deletion scripts/update-compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');
const fs = require('fs');
const commands = require('redis-commands');
const redis = require('ioredis');
const prettier = require('prettier');
const RedisMock = require('../src');

const mockedRedis = new RedisMock();
Expand Down Expand Up @@ -65,7 +66,7 @@ ${tableRows}`;

fs.writeFile(
path.resolve(__dirname, '..', 'compat.md'),
tableMd,
prettier.format(tableMd, { parser: 'markdown' }),
'utf8',
err => {
if (err) throw err;
Expand Down
103 changes: 6 additions & 97 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1104,11 +1104,6 @@ chardet@^0.7.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==

charenc@~0.0.1:
version "0.0.2"
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=

chokidar@^1.6.1:
version "1.7.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
Expand Down Expand Up @@ -1226,11 +1221,6 @@ combined-stream@^1.0.6, combined-stream@~1.0.6:
dependencies:
delayed-stream "~1.0.0"

commander@2.15.1:
version "2.15.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==

commander@2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
Expand Down Expand Up @@ -1347,11 +1337,6 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5:
shebang-command "^1.2.0"
which "^1.2.9"

crypt@~0.0.1:
version "0.0.2"
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=

d@1, d@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a"
Expand All @@ -1372,13 +1357,6 @@ date-fns@^1.27.2:
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c"
integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==

debug@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
dependencies:
ms "2.0.0"

debug@3.2.6, debug@^3.2.6:
version "3.2.6"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
Expand Down Expand Up @@ -2266,18 +2244,6 @@ glob-parent@^5.0.0:
dependencies:
is-glob "^4.0.1"

glob@7.1.2:
version "7.1.2"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==
dependencies:
fs.realpath "^1.0.0"
inflight "^1.0.4"
inherits "2"
minimatch "^3.0.4"
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@7.1.3:
version "7.1.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
Expand Down Expand Up @@ -2432,11 +2398,6 @@ hasha@^3.0.0:
dependencies:
is-stream "^1.0.1"

he@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0=

he@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
Expand Down Expand Up @@ -2628,7 +2589,7 @@ is-boolean-object@^1.0.0:
resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93"
integrity sha1-mPiygDBoQhmpXzdc+9iM40Bd/5M=

is-buffer@^1.1.5, is-buffer@~1.1.1:
is-buffer@^1.1.5:
version "1.1.6"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
Expand Down Expand Up @@ -3299,15 +3260,6 @@ math-random@^1.0.1:
resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c"
integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==

md5@^2.1.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9"
integrity sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=
dependencies:
charenc "~0.0.1"
crypt "~0.0.1"
is-buffer "~1.1.1"

merge-source-map@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646"
Expand Down Expand Up @@ -3438,31 +3390,17 @@ mixin-deep@^1.2.0:
for-in "^1.0.2"
is-extendable "^1.0.1"

mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1:
mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
dependencies:
minimist "0.0.8"

mocha-circleci-reporter@0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/mocha-circleci-reporter/-/mocha-circleci-reporter-0.0.3.tgz#5303d722cdb0390c2e03632517055c06146df6a0"
integrity sha512-sZHmd+HH0pgQjTdk0itV2+RSOikqLo7kravRLKTmzcvyu9lA69pXd4KLAv5NMcF4c3EnSatX0iBSM4gSXFYjEw==
dependencies:
mocha "^5.1.1"
mocha-junit-reporter "^1.17.0"

mocha-junit-reporter@^1.17.0:
version "1.23.1"
resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.23.1.tgz#ba11519c0b967f404e4123dd69bc4ba022ab0f12"
integrity sha512-qeDvKlZyAH2YJE1vhryvjUQ06t2hcnwwu4k5Ddwn0GQINhgEYFhlGM0DwYCVUHq5cuo32qAW6HDsTHt7zz99Ng==
dependencies:
debug "^2.2.0"
md5 "^2.1.0"
mkdirp "~0.5.1"
strip-ansi "^4.0.0"
xml "^1.0.0"
mocha-lcov-reporter@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz#469bdef4f8afc9a116056f079df6182d0afb0384"
integrity sha1-Rpve9PivyaEWBW8HnfYYLQr7A4Q=

mocha@6.2.2:
version "6.2.2"
Expand Down Expand Up @@ -3493,23 +3431,6 @@ mocha@6.2.2:
yargs-parser "13.1.1"
yargs-unparser "1.6.0"

mocha@^5.1.1:
version "5.2.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6"
integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==
dependencies:
browser-stdout "1.3.1"
commander "2.15.1"
debug "3.1.0"
diff "3.5.0"
escape-string-regexp "1.0.5"
glob "7.1.2"
growl "1.10.5"
he "1.1.1"
minimatch "3.0.4"
mkdirp "0.5.1"
supports-color "5.4.0"

ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
Expand Down Expand Up @@ -4879,13 +4800,6 @@ strip-json-comments@^3.0.1:
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7"
integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==

supports-color@5.4.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54"
integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==
dependencies:
has-flag "^3.0.0"

supports-color@6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a"
Expand Down Expand Up @@ -5220,11 +5134,6 @@ write@1.0.3:
dependencies:
mkdirp "^0.5.1"

xml@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=

y18n@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
Expand Down

0 comments on commit 72698b7

Please sign in to comment.