pinojs / pino

🌲 super fast, all natural json logger
http://getpino.io
MIT License
14.21k stars 875 forks source link

pino test suite failed on legacy-code-todo-rewrite/jestAdapterInit.js #1257

Closed phracek closed 2 years ago

phracek commented 2 years ago

See traceback from our test suite:

ok 36 - test/transport/targets.test.js # time=179.001ms {
    # Subtest: file-target mocked
        1..1
        ok 1 - should be equivalent
    ok 1 - file-target mocked # time=146.6ms

    1..1
    # time=179.001ms
}

1..36
# time=105793.553ms
------------------|---------|----------|---------|---------|-------------------
File              | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
------------------|---------|----------|---------|---------|-------------------
All files         |   99.88 |    99.44 |     100 |   99.88 |                   
 src              |     100 |      100 |     100 |     100 |                   
  browser.js      |     100 |      100 |     100 |     100 |                   
  file.js         |     100 |      100 |     100 |     100 |                   
  pino.js         |     100 |      100 |     100 |     100 |                   
 src/lib          |   99.84 |     99.2 |     100 |   99.83 |                   
  deprecations.js |     100 |      100 |     100 |     100 |                   
  levels.js       |     100 |      100 |     100 |     100 |                   
  meta.js         |     100 |      100 |     100 |     100 |                   
  multistream.js  |     100 |      100 |     100 |     100 |                   
  proto.js        |     100 |      100 |     100 |     100 |                   
  redaction.js    |     100 |      100 |     100 |     100 |                   
  symbols.js      |     100 |      100 |     100 |     100 |                   
  time.js         |     100 |      100 |     100 |     100 |                   
  tools.js        |     100 |    99.46 |     100 |     100 | 441               
  transport.js    |   97.77 |    93.93 |     100 |   97.77 | 63                
------------------|---------|----------|---------|---------|-------------------
FAIL test/jest/basic.spec.js
  ● Test suite failed to run

    Cannot find module '..' from 'node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:324:11)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.333 s
Ran all test suites matching /test\/jest/i.
npm ERR! Test failed.  See above for more details.
mcollina commented 2 years ago

I can't reproduce this failure. Maybe you have some stale dependencies?

phracek commented 2 years ago

Some more information:

> pino@7.5.1 test /opt/app-root/src
> npm run lint && tap test/*test.js test/*/*test.js && jest test/jest && npm run test-types

> pino@7.5.1 lint /opt/app-root/src
> eslint .

TAP version 13
ok 1 - test/basic.test.js # time=1239.487ms {
    # Subtest: pino version is exposed on export
        ok 1 - should be equal
        1..1
phracek commented 2 years ago

See full log here: http://artifacts.dev.testing-farm.io/b3a01fd3-9c31-4c91-a6c1-8419a5cab654/work-fedoraSHIDbo/log.txt

jsumners commented 2 years ago

Please provide a minimal reproduction. We do not see this error in our CI.

phracek commented 2 years ago

On Fedora 34, clone this repository and call commands:

pino@7.5.1 test /opt/app-root/src npm run lint && tap test/test.js test//*test.js && jest test/jest && npm run test-types

pino@7.5.1 lint /opt/app-root/src eslint .

or only npm test in the cloned directory

mcollina commented 2 years ago

I do not have a Fedora environment available or the time to create one unfortunately :/.

This looks like to be specific to Jest and Fedora... something that is a very complex setup to preproduce and maintain support for.

If you want I can create a new npm task for you to just run the tap test (no types and no jest) so that you can have more stable builds.

mhdawson commented 2 years ago

I ran on a Fedora 34 machine with nodejs 12. I don't see any failures. We'll need more help to recreate the problem.

If you have a machine that you can reliably recreate on and can give me access that might help, as it does not fail on my Fedora 34 machine. What I did was

Which appears to complete without any failures.

phracek commented 2 years ago

@mhdawson But it was tested with nodejs 14 and not nodejs 12

mhdawson commented 2 years ago

@phracek ok I did not see which node.js version in the posts above. Unfortunately I just retried on the same machine using yum module install nodejs:14 and all the tests still seem to pass.

LudoPL commented 2 years ago

I got the same error :

    Cannot find module '..' from 'node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js'
      at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:324:11)

in my ci pipeline, but not when I try to launch the same test on my computer (even inside the same docker image used by the ci-pipeline).

jsumners commented 2 years ago

Without a reproduction, there isn't anything we can do.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.