preactjs / wmr

👩‍🚀 The tiny all-in-one development tool for modern web apps.
https://wmr.dev/
MIT License
4.92k stars 109 forks source link

Investigation of tests failing due to Node.js version 18 #937

Closed takurinton closed 2 years ago

takurinton commented 2 years ago

refs

935

936

changeset-bot[bot] commented 2 years ago

⚠️ No Changeset found

Latest commit: ad325fd0d2e3522567c7023321b4414323458620

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

takurinton commented 2 years ago

First, do an empty commit in the main branch to see if #935 is doing anything wrong.

takurinton commented 2 years ago

Oops, no changes to the code, so it's a dry run!

Since it is controlled here, we will try to include some debugging code. https://github.com/preactjs/wmr/blob/main/.github/workflows/main.yml#L22-L27

takurinton commented 2 years ago

I inserted dummy code and ran the test, but it failed with the same error as #935 . In other words, I thought there might not be any connection with #935. I can't be sure, though...

takurinton commented 2 years ago

The place where it is falling down is also due to the fact that it is a demo app test and there is no dist directory. This seems to be a problem with the original testing infrastructure. However, we feel that it will take a lot of work to expose and solve the underlying problems. In fact, I feel that this foundation is not well maintained.

takurinton commented 2 years ago

I am trying to fix a few things about my demo app test failing. Locally it fails because the .cache directory does not exist at my end, but in CI it fails because the dist directory does not exist. And while I can just ignore the .cache directory with error handling if it doesn’t exist, I can’t proceed to the next process if I can’t get the dist directory. Hmm...

takurinton commented 2 years ago

Oops!! The test that should have failed passed... It was certainly my wish that the test would pass, but I did not wish for it to pass when it should not.😱 image

The logs I put in are also working properly.

    console.log
      ../dist [
        '.env',
        '.env.development',
        '.env.development.local',
        '.env.local',
        'dist',
        'node_modules',
        'package.json',
        'public',
        'src',
        'tsconfig.json',
        'wmr.config.ts'
      ]

      at Object.<anonymous> (test/production.test.js:502:12)

    console.log
      dist [
        'about',             'alias-outside',
        'assets',            'chunks',
        'class-fields',      'compat',
        'env',               'error',
        'files',             'foo',
        'index.4baf50d8.js', 'index.html',
        'json',              'lazy-and-late',
        'meta-tags',         'pages'
      ]

      at Object.<anonymous> (test/production.test.js:506:12)

    console.log
      here is befor serveStatic

      at Object.<anonymous> (test/production.test.js:515:12)

    console.log
      here is after serveStatic

      at Object.<anonymous> (test/production.test.js:517:12)

    console.log
      If this test(demo app) have made it this far, you should not fail. Perhaps.

      at Object.<anonymous> (test/production.test.js:520:12)

Instead the lighthouse test is failing. Very unstable.

takurinton commented 2 years ago

@rschristian Whether this is a fluke or the effect of the previous commit (although I just planted the log), I don't have the authority to re-run the test, so can I ask you to re-run the test instead?

takurinton commented 2 years ago

@rschristian implemented it! Thank you! https://github.com/preactjs/wmr/pull/938

takurinton commented 2 years ago

Closing as this can be resolved in #938