Page MenuHomePhabricator

[Cashtab] Automatically update jest snapshots
AbandonedPublic

Authored by kieran709 on Jun 3 2022, 16:55.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Summary

Jest tests should run automatically before any commit. Husky has been added to handle this. Related to T2439.

Test Plan

-This test plan is a WIP-
navigate to web/cashtab
make a test comment
commit the test comment
observe that the snapshot tests run automatically before anything is committed

Unsure if updated snapshots will be committed, script may need to change to stage and commit updated snapshots.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
auto-update-snapshots
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19250
Build 38247: Build Diffcashtab-tests
Build 38246: arc lint + arc unit

Event Timeline

Tail of the build log:

npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-logical@5.0.4',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-nesting@10.1.3',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-opacity-percentage@1.1.2',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-overflow-shorthand@3.0.3',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-place@7.0.4',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-preset-env@7.4.3',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-pseudo-class-any-link@7.1.1',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated text-encoding@0.6.4: no longer maintained
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated ts-custom-error@2.2.2: npm package tarball contains useless codeclimate-reporter binary, please update to version 3.1.1. See https://github.com/adriengibrat/ts-custom-error/issues/32

> cashtab@1.0.0 prepare
> cd ../.. && husky install web/cashtab/.husky

sh: 1: husky: not found
npm notice 
npm notice New major version of npm available! 7.7.6 -> 8.12.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.12.1>
npm notice Run `npm install -g npm@8.12.1` to update!
npm notice 
npm ERR! code 127
npm ERR! path /work/web/cashtab
npm ERR! command failed
npm ERR! command sh -c cd ../.. && husky install web/cashtab/.husky

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-06-03T16_56_49_552Z-debug.log
Build cashtab-tests failed with exit code 127

Altered pre-commit script

Tail of the build log:

npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-logical@5.0.4',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-nesting@10.1.3',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-opacity-percentage@1.1.2',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-overflow-shorthand@3.0.3',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-place@7.0.4',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-preset-env@7.4.3',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-pseudo-class-any-link@7.1.1',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || >=16' },
npm WARN EBADENGINE   current: { node: 'v15.14.0', npm: '7.7.6' }
npm WARN EBADENGINE }
npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated text-encoding@0.6.4: no longer maintained
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm WARN deprecated ts-custom-error@2.2.2: npm package tarball contains useless codeclimate-reporter binary, please update to version 3.1.1. See https://github.com/adriengibrat/ts-custom-error/issues/32

> cashtab@1.0.0 prepare
> cd ../.. && husky install web/cashtab/.husky

sh: 1: husky: not found
npm notice 
npm notice New major version of npm available! 7.7.6 -> 8.12.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.12.1>
npm notice Run `npm install -g npm@8.12.1` to update!
npm notice 
npm ERR! code 127
npm ERR! path /work/web/cashtab
npm ERR! command failed
npm ERR! command sh -c cd ../.. && husky install web/cashtab/.husky

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-06-03T17_19_25_128Z-debug.log
Build cashtab-tests failed with exit code 127

Reinstall husky as a dev-dependency.

kieran709 retitled this revision from [Cashtab] Autmatically update jest snapshots to [Cashtab] Automatically update jest snapshots.Jun 3 2022, 17:37
bytesofman requested changes to this revision.Jun 3 2022, 20:39

I think this ended up being identical to the one we landed, minus a specific test plan. Good work! Please abandon now that D11566 is landed.