Skip to content

Commit

Permalink
[Tests] coveralls -> codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Aug 30, 2021
1 parent 397b6c5 commit 2a0d207
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-4+.yml
Expand Up @@ -83,7 +83,7 @@ jobs:
skip-ls-check: true
- run: npm run pretest
- run: npm run tests-only
- run: npm run coveralls
- uses: codecov/codecov-action@v1

node:
name: 'node 4+'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/packages.yml
Expand Up @@ -43,6 +43,7 @@ jobs:
after_install: npm run copy-metafiles && ./tests/dep-time-travel.sh && cd ${{ matrix.package }} && npm install
skip-ls-check: true
- run: cd ${{ matrix.package }} && npm run tests-only
- uses: codecov/codecov-action@v1

packages:
name: 'packages: all tests'
Expand Down
2 changes: 1 addition & 1 deletion .nycrc
@@ -1,7 +1,7 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"reporter": ["text-summary", "lcov", "text", "html", "json"],
"require": [
"babel-register"
],
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -36,4 +36,4 @@ script:
- npm run tests-only

after_success:
- npm run coveralls
- bash <(curl -s https://codecov.io/bash)
47 changes: 33 additions & 14 deletions appveyor.yml
Expand Up @@ -5,28 +5,31 @@ configuration:
# Test against this version of Node.js
environment:
matrix:
- nodejs_version: "16"
- nodejs_version: "14"
- nodejs_version: "12"
- nodejs_version: "10"
- nodejs_version: "8"
# - nodejs_version: "6"
# - nodejs_version: "4"
# - nodejs_version: "6"
# - nodejs_version: "4"

image: Visual Studio 2019
matrix:
fast_finish: false
exclude:
- configuration: WSL
nodejs_version: "10"
- configuration: WSL
nodejs_version: "8"
- configuration: WSL
nodejs_version: "6"
- configuration: WSL
nodejs_version: "4"

# allow_failures:
# - nodejs_version: "4" # for eslint 5
allow_failures:
- nodejs_version: "4" # for eslint 5

# platform:
# - x86
# - x64
platform:
- x86
- x64

# Initialization scripts. (runs before repo cloning)
init:
Expand All @@ -35,14 +38,26 @@ init:
if ($env:nodejs_version -eq "4") {
$env:NPM_VERSION="3"
}
if ($env:nodejs_version -in @("8", "10", "12")) {
$env:NPM_VERSION="6.14.5"
if ($env:nodejs_version -in @("8")) {
$env:NPM_VERSION="6"
}
if ($env:nodejs_version -in @("10", "12", "14", "16")) {
$env:NPM_VERSION="6" # TODO: use npm 7
$env:NPM_CONFIG_LEGACY_PEER_DEPS="true"
}
- ps: >-
$env:ESLINT_VERSION="7";
if ([int]$env:nodejs_version -le 8) {
$env:ESLINT_VERSION="6"
}
if ([int]$env:nodejs_version -le 7) {
$env:ESLINT_VERSION="5"
}
if ([int]$env:nodejs_version -le 6) {
$env:ESLINT_VERSION="4"
}
- ps: $env:WINDOWS_NYC_VERSION = "15.0.1"
- ps: $env:TRAVIS_NODE_VERSION = $env:nodejs_version

# Add `ci`-command to `PATH` for running commands either using cmd or wsl depending on the configuration
- ps: $env:PATH += ";$(Join-Path $(pwd) "scripts")"
Expand All @@ -54,6 +69,8 @@ before_build:

# Install dependencies
- ci npm install
- ci npm run copy-metafiles
- bash ./tests/dep-time-travel.sh 2>&1

# fix symlinks
- git config core.symlinks true
Expand Down Expand Up @@ -99,9 +116,6 @@ test_script:
$env:RESOLVERS = [string]::Join(";", $resolvers);
- FOR %%G in ("%RESOLVERS:;=";"%") do ( pushd %%~G & ci npm test & popd )

on_success:
- ci npm run coveralls

# Configuration-specific steps
for:
- matrix:
Expand All @@ -127,6 +141,9 @@ for:
}
$env:RESOLVERS = [string]::Join(";", $resolvers);
- IF DEFINED RESOLVERS FOR %%G in ("%RESOLVERS:;=";"%") do ( pushd %%~G & ci npm install --no-save nyc@%WINDOWS_NYC_VERSION% & popd )
# TODO: enable codecov for native windows builds
# on_success:
# - codecov
- matrix:
only:
- configuration: WSL
Expand All @@ -136,5 +153,7 @@ for:
- ps: $env:WSLENV += ":nodejs_version"
- ps: wsl curl -sL 'https://deb.nodesource.com/setup_${nodejs_version}.x' `| sudo APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 -E bash -
- wsl sudo DEBIAN_FRONTEND=noninteractive apt install -y nodejs
on_success:
- ci bash <(curl -s https://codecov.io/bash)

build: on
6 changes: 2 additions & 4 deletions package.json
Expand Up @@ -25,14 +25,13 @@
"watch": "npm run tests-only -- -- --watch",
"pretest": "linklocal",
"posttest": "eslint .",
"mocha": "cross-env BABEL_ENV=test nyc -s mocha",
"mocha": "cross-env BABEL_ENV=test nyc mocha",
"tests-only": "npm run mocha tests/src",
"test": "npm run tests-only",
"test-compiled": "npm run prepublish && BABEL_ENV=testCompiled mocha --compilers js:babel-register tests/src",
"test-all": "node --require babel-register ./scripts/testAll",
"prepublishOnly": "safe-publish-latest && npm run build",
"prepublish": "not-in-publish || npm run prepublishOnly",
"coveralls": "nyc report --reporter lcovonly && coveralls < ./coverage/lcov.info"
"prepublish": "not-in-publish || npm run prepublishOnly"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -69,7 +68,6 @@
"babel-register": "^6.26.0",
"babylon": "^6.18.0",
"chai": "^4.3.4",
"coveralls": "^3.1.1",
"cross-env": "^4.0.0",
"eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0",
"eslint-import-resolver-node": "file:./resolvers/node",
Expand Down
4 changes: 1 addition & 3 deletions resolvers/node/package.json
Expand Up @@ -9,8 +9,7 @@
"scripts": {
"prepublishOnly": "cp ../../{LICENSE,.npmrc} ./",
"tests-only": "nyc mocha",
"test": "npm run tests-only",
"coveralls": "nyc report --reporter lcovonly && cd ../.. && coveralls < ./resolvers/node/coverage/lcov.info"
"test": "npm run tests-only"
},
"repository": {
"type": "git",
Expand All @@ -35,7 +34,6 @@
},
"devDependencies": {
"chai": "^3.5.0",
"coveralls": "^3.1.0",
"mocha": "^3.5.3",
"nyc": "^11.9.0"
}
Expand Down
5 changes: 1 addition & 4 deletions resolvers/webpack/package.json
Expand Up @@ -6,9 +6,7 @@
"scripts": {
"prepublishOnly": "cp ../../{LICENSE,.npmrc} ./",
"tests-only": "nyc mocha -t 5s",
"test": "npm run tests-only",
"report": "nyc report --reporter=html",
"coveralls": "nyc report --reporter lcovonly && cd ../.. && coveralls < ./resolvers/webpack/coverage/lcov.info"
"test": "npm run tests-only"
},
"files": [
"index.js",
Expand Down Expand Up @@ -53,7 +51,6 @@
"babel-preset-es2015-argon": "latest",
"babel-register": "^6.26.0",
"chai": "^3.5.0",
"coveralls": "^3.1.0",
"mocha": "^3.5.3",
"nyc": "^11.9.0",
"webpack": "https://gist.github.com/ljharb/9cdb687f3806f8e6cb8a365d0b7840eb"
Expand Down
2 changes: 1 addition & 1 deletion tests/dep-time-travel.sh
Expand Up @@ -2,7 +2,7 @@

# expected: ESLINT_VERSION numeric env var

echo "installing ${ESLINT_VERSION}..."
echo "installing ${ESLINT_VERSION} in node ${TRAVIS_NODE_VERSION} with TS parser ${TS_PARSER:-default}..."

export NPM_CONFIG_LEGACY_PEER_DEPS=true

Expand Down

0 comments on commit 2a0d207

Please sign in to comment.