From ed3b24ebacaf20a205c945ebb157f5098957d51c Mon Sep 17 00:00:00 2001 From: couragecowardlydog Date: Fri, 3 Mar 2023 20:30:48 +0530 Subject: [PATCH 1/9] Update package.json feat: include examples in pack & add script for midnight smoker test --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index a993ce4ba..3d42afbfb 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "test", "docs", "example.js", + "examples", "lib" ], "scripts": { @@ -29,6 +30,7 @@ "test-ci-pnpm": "pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types", "test-ci-yarn-pnp": "yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly", "test-types": "tsc && tsd && ts-node test/types/pino.ts", + "test-ci-smoke": "node examples/basic.js", "transpile": "node ./test/fixtures/ts/transpile.cjs", "cov-ui": "tap --ts --coverage-report=html", "bench": "node benchmarks/utils/runbench all", From 315f27e78ba4056a147ef48b34ef1fcd80ad973d Mon Sep 17 00:00:00 2001 From: couragecowardlydog Date: Fri, 3 Mar 2023 20:35:38 +0530 Subject: [PATCH 2/9] Update package.json chore: remove files that doesn't exists on root --- package.json | 3 --- smoke.js | 0 2 files changed, 3 deletions(-) create mode 100644 smoke.js diff --git a/package.json b/package.json index 3d42afbfb..e81f32283 100644 --- a/package.json +++ b/package.json @@ -12,11 +12,8 @@ "pino.d.ts", "bin.js", "browser.js", - "pretty.js", - "usage.txt", "test", "docs", - "example.js", "examples", "lib" ], diff --git a/smoke.js b/smoke.js new file mode 100644 index 000000000..e69de29bb From 60ac9c1c35df8612483302596a106d154f9dd718 Mon Sep 17 00:00:00 2001 From: couragecowardlydog Date: Fri, 3 Mar 2023 21:15:29 +0530 Subject: [PATCH 3/9] feat: add midnight-smoker Add smoke file & update ci script --- package.json | 6 +++--- smoke.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e81f32283..56f7ee20d 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "browser.js", "test", "docs", - "examples", + "smoke.js", "lib" ], "scripts": { @@ -23,11 +23,11 @@ "lint": "eslint .", "prepublishOnly": "tap --no-check-coverage test/internals/version.test.js", "test": "npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types", - "test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types", + "test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types && npx midnight-smoker test-ci-smoke", "test-ci-pnpm": "pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types", "test-ci-yarn-pnp": "yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly", "test-types": "tsc && tsd && ts-node test/types/pino.ts", - "test-ci-smoke": "node examples/basic.js", + "test-ci-smoke": "node smoke.js", "transpile": "node ./test/fixtures/ts/transpile.cjs", "cov-ui": "tap --ts --coverage-report=html", "bench": "node benchmarks/utils/runbench all", diff --git a/smoke.js b/smoke.js index e69de29bb..f4dd2af2f 100644 --- a/smoke.js +++ b/smoke.js @@ -0,0 +1,43 @@ +'use strict' + +// Pino's primary usage writes ndjson to `stdout`: +const pino = require('pino')() + +// However, if "human readable" output is desired, +// `pino-pretty` can be provided as the destination +// stream by uncommenting the following line in place +// of the previous declaration: +// const pino = require('..')(require('pino-pretty')()) + +pino.info('hello world') +pino.error('this is at error level') +pino.info('the answer is %d', 42) +pino.info({ obj: 42 }, 'hello world') +pino.info({ obj: 42, b: 2 }, 'hello world') +pino.info({ nested: { obj: 42 } }, 'nested') +setImmediate(() => { + pino.info('after setImmediate') +}) +pino.error(new Error('an error')) + +const child = pino.child({ a: 'property' }) +child.info('hello child!') + +const childsChild = child.child({ another: 'property' }) +childsChild.info('hello baby..') + +pino.debug('this should be mute') + +pino.level = 'trace' + +pino.debug('this is a debug statement') + +pino.child({ another: 'property' }).debug('this is a debug statement via child') +pino.trace('this is a trace statement') + +pino.debug('this is a "debug" statement with "') + +pino.info(new Error('kaboom')) +pino.info(null) + +pino.info(new Error('kaboom'), 'with', 'a', 'message') From 856f09901916c8eefb68cfe0bf4d8955be2fddb1 Mon Sep 17 00:00:00 2001 From: couragecowardlydog Date: Fri, 3 Mar 2023 21:17:25 +0530 Subject: [PATCH 4/9] Update smoke.js --- smoke.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/smoke.js b/smoke.js index f4dd2af2f..5c19dd132 100644 --- a/smoke.js +++ b/smoke.js @@ -1,14 +1,6 @@ 'use strict' - -// Pino's primary usage writes ndjson to `stdout`: const pino = require('pino')() -// However, if "human readable" output is desired, -// `pino-pretty` can be provided as the destination -// stream by uncommenting the following line in place -// of the previous declaration: -// const pino = require('..')(require('pino-pretty')()) - pino.info('hello world') pino.error('this is at error level') pino.info('the answer is %d', 42) From debd407f4da582f99a559610aad011a23350daa3 Mon Sep 17 00:00:00 2001 From: couragecowardlydog Date: Sat, 4 Mar 2023 07:59:54 +0530 Subject: [PATCH 5/9] Update package.json fix: midnight-smoker as dev dependency --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 56f7ee20d..75a8018d8 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,10 @@ "docs": "docsify serve", "browser-test": "airtap --local 8080 test/browser*test.js", "lint": "eslint .", + "smoker": "npm exec smoker test-ci-smoke", "prepublishOnly": "tap --no-check-coverage test/internals/version.test.js", "test": "npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types", - "test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types && npx midnight-smoker test-ci-smoke", + "test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types && npm run smoker", "test-ci-pnpm": "pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types", "test-ci-yarn-pnp": "yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly", "test-types": "tsc && tsd && ts-node test/types/pino.ts", @@ -90,6 +91,7 @@ "jest": "^29.0.3", "log": "^6.0.0", "loglevel": "^1.6.7", + "midnight-smoker": "^2.0.1", "pino-pretty": "^9.0.0", "pre-commit": "^1.2.2", "proxyquire": "^2.1.3", From 429c5b5d65576b97ca7dd23cf563fb4372d70347 Mon Sep 17 00:00:00 2001 From: couragecowardlydog Date: Sat, 4 Mar 2023 15:47:39 +0530 Subject: [PATCH 6/9] fix: refer smoker in ./node_modules/.bin Signed-off-by: couragecowardlydog --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 75a8018d8..1656224c0 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "docs": "docsify serve", "browser-test": "airtap --local 8080 test/browser*test.js", "lint": "eslint .", - "smoker": "npm exec smoker test-ci-smoke", + "smoker": "node ./node_modules/.bin/smoker test-ci-smoke", "prepublishOnly": "tap --no-check-coverage test/internals/version.test.js", "test": "npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types", "test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types && npm run smoker", From d5338d2eacc2ea4fb1e8b22d1899e976ae96658b Mon Sep 17 00:00:00 2001 From: couragecowardlydog Date: Sun, 5 Mar 2023 20:18:55 +0530 Subject: [PATCH 7/9] fix: remove smoke part of test-ci Signed-off-by: couragecowardlydog --- .github/workflows/smoke.yml | 30 ++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/smoke.yml diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml new file mode 100644 index 000000000..f98a2bee5 --- /dev/null +++ b/.github/workflows/smoke.yml @@ -0,0 +1,30 @@ +name: smoke + +on: + push: + branches: + - main + paths-ignore: + - 'docs/**' + - '*.md' + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + smoke: + name: smoke :: run tests against package after npm pack + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: npm install + - uses: boneskull/nodejs-production-test-action@v1 + with: + script: test-ci-smoke diff --git a/package.json b/package.json index 1656224c0..735c6a2a0 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "smoker": "node ./node_modules/.bin/smoker test-ci-smoke", "prepublishOnly": "tap --no-check-coverage test/internals/version.test.js", "test": "npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types", - "test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types && npm run smoker", + "test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types", "test-ci-pnpm": "pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types", "test-ci-yarn-pnp": "yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly", "test-types": "tsc && tsd && ts-node test/types/pino.ts", From 7a605545479aff5e7100a7e0b81b76180472f496 Mon Sep 17 00:00:00 2001 From: couragecowardlydog Date: Sun, 5 Mar 2023 20:42:53 +0530 Subject: [PATCH 8/9] fix: yaml lint error Signed-off-by: couragecowardlydog --- .github/workflows/smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index f98a2bee5..7f621246c 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -19,7 +19,7 @@ concurrency: jobs: smoke: - name: smoke :: run tests against package after npm pack + name: Smoke Test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From d25673029705b2ddceaedfb3ae91ec5d215b7905 Mon Sep 17 00:00:00 2001 From: Vivekanandan Sakthivelu Date: Sun, 5 Mar 2023 23:24:00 +0530 Subject: [PATCH 9/9] Update package.json Co-authored-by: Matteo Collina --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 735c6a2a0..c1aed27e9 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "docs": "docsify serve", "browser-test": "airtap --local 8080 test/browser*test.js", "lint": "eslint .", - "smoker": "node ./node_modules/.bin/smoker test-ci-smoke", + "smoker": "smoker test-ci-smoke", "prepublishOnly": "tap --no-check-coverage test/internals/version.test.js", "test": "npm run lint && npm run transpile && tap --ts && jest test/jest && npm run test-types", "test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types",