Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Updating globby breaks tests #56

Closed
2 tasks
ryan-roemer opened this issue Jul 31, 2019 · 3 comments · Fixed by #237
Closed
2 tasks

BUG: Updating globby breaks tests #56

ryan-roemer opened this issue Jul 31, 2019 · 3 comments · Fixed by #237
Labels
bug Something isn't working

Comments

@ryan-roemer
Copy link
Member

ryan-roemer commented Jul 31, 2019

Work

  • Wait for next release of mock-fs
  • Great on FAST_GLOB_STATS hack and remove

Notes

Like mock-fs related with maybe something like a new fs call not mockable? Fails on 10, 11 but succeeds on 8.

Example test failure: https://travis-ci.com/FormidableLabs/serverless-jetpack/jobs/221406242

1) util/bundle#resolveFilePathsFromPatterns
       should error on no patterns, no matches:
     Uncaught Error: Method not implemented�[0m�[90m
      at notImplemented (node_modules/mock-fs/lib/binding.js:140:9)
      at Object.Binding.readdir (node_modules/mock-fs/lib/binding.js:890:5)
      at Object.<anonymous> (node_modules/mock-fs/lib/index.js:33:39)
      at Object.readdir (fs.js:778:11)
      at readdirWithFileTypes (node_modules/@nodelib/fs.scandir/out/providers/async.js:15:17)
      at Object.read (node_modules/@nodelib/fs.scandir/out/providers/async.js:9:16)
      at AsyncReader.scandir [as _scandir] (node_modules/@nodelib/fs.scandir/out/index.js:11:11)
      at AsyncReader._worker (node_modules/@nodelib/fs.walk/out/readers/async.js:56:14)
      at Object.push (node_modules/fastq/queue.js:88:14)
      at AsyncReader._pushToQueue (node_modules/@nodelib/fs.walk/out/readers/async.js:49:21)
      at Immediate.setImmediate (node_modules/@nodelib/fs.walk/out/readers/async.js:27:18)

Diff (the revert actually):

diff --git a/package.json b/package.json
index bddc030..4929cbc 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
   },
   "dependencies": {
     "archiver": "^3.0.0",
-    "globby": "^10.0.1",
+    "globby": "^9.2.0",
     "inspectdep": "^0.2.0",
     "jest-worker": "^24.6.0",
     "make-dir": "^3.0.0",
@ryan-roemer ryan-roemer added the bug Something isn't working label Jul 31, 2019
@ryan-roemer
Copy link
Member Author

Issue is: tschaub/mock-fs#272

Fix is implemented in: tschaub/mock-fs#287 but not released yet.

@ryan-roemer
Copy link
Member Author

Tried 11.0.0 but hit win problems: https://ci.appveyor.com/project/FormidableLabs/serverless-jetpack?fullLog=true

Commit undoing 11 in branch: 8f97fce

ryan-roemer added a commit that referenced this issue Mar 7, 2020
- Most dependency updates. 
- Skipping #94
- Skipping globby because of #56
@ryan-roemer
Copy link
Member Author

Upgraded and failed only on Appveyor: https://ci.appveyor.com/project/FormidableLabs/serverless-jetpack/builds/31777923

yarn run v1.21.1
$ yarn lint && yarn test:spec
$ eslint .
$ mocha test/spec
  index
    trace mode
      packaging
        1) traces dependencies
        2) excludes ignores and package include when tracing
        3) allows missing when tracing
        4) traces with various trace.include options
      configurations
        √ traces with service config even if non-individually function is false
        √ traces with service config and skips individually + trace=false functions
        √ pattern matches service and traces individually + trace=true functions
        √ traces for service-level individually and trace
  util/bundle#resolveFilePathsFromPatterns
    √ should error on no patterns, no matches
    √ should match on no patterns, basic sources
    √ should handle broad exclude and include re-adding in
    √ doesn't removes appropriate serverless.EXT config file
    - should handle only node_modules
    - should handle sources and node_modules
  8 passing (234ms)
  2 pending
  4 failing
  1) index
       trace mode
         packaging
           traces dependencies:
     AssertionError: expected createZip to have been called with arguments matching {
  files: ["one.js", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json"]
}
{
  bundlePath: "C:\projects\serverless-jetpack\.serverless\sls-mocked.zip",
  cwd: "C:\projects\serverless-jetpack",
  files: ["one.js"]
  files: ["one.js", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json"]
}
      at Context.<anonymous> (test\spec\index.spec.js:103:18)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  2) index
       trace mode
         packaging
           excludes ignores and package include when tracing:
     AssertionError: expected createZip to have been called with arguments matching {
  files: ["numbers.js", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json"]
}
Call 1:
{
  bundlePath: "C:\projects\serverless-jetpack\.serverless\has-ignores.zip",
  cwd: "C:\projects\serverless-jetpack",
  files: ["has-ignores.js"]
  files: ["numbers.js", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json"]
}
Call 2:
{
  bundlePath: "C:\projects\serverless-jetpack\.serverless\sls-mocked.zip",
  cwd: "C:\projects\serverless-jetpack",
  files: ["numbers.js"]
  files: ["numbers.js", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json"]
}
      at Context.<anonymous> (test\spec\index.spec.js:173:18)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  3) index
       trace mode
         packaging
           allows missing when tracing:
     AssertionError: expected createZip to have been called with arguments matching {
  files: ["numbers.js", "node_modules/all-missing/index.js", "node_modules/all-missing/package.json", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json", "node_modules/two-pkg/index.js", "node_modules/two-pkg/package.json"]
}
Call 1:
{
  bundlePath: "C:\projects\serverless-jetpack\.serverless\has-missings.zip",
  cwd: "C:\projects\serverless-jetpack",
  files: ["has-missings.js"]
  files: ["numbers.js", "node_modules/all-missing/index.js", "node_modules/all-missing/package.json", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json", "node_modules/two-pkg/index.js", "node_modules/two-pkg/package.json"]
}
Call 2:
{
  bundlePath: "C:\projects\serverless-jetpack\.serverless\sls-mocked.zip",
  cwd: "C:\projects\serverless-jetpack",
  files: ["numbers.js"]
  files: ["numbers.js", "node_modules/all-missing/index.js", "node_modules/all-missing/package.json", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json", "node_modules/two-pkg/index.js", "node_modules/two-pkg/package.json"]
}
      at Context.<anonymous> (test\spec\index.spec.js:285:18)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
  4) index
       trace mode
         packaging
           traces with various trace.include options:
     AssertionError: expected createZip to have been called with arguments matching {
  files: ["one.js", "two.js", "additional.js", "extra.js", "node_modules/additional-pkg/index.js", "node_modules/additional-pkg/package.json", "node_modules/extra-pkg/index.js", "node_modules/extra-pkg/package.json", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json", "node_modules/two-pkg/index.js", "node_modules/two-pkg/package.json"]
}
Call 1:
{
  bundlePath: "C:\projects\serverless-jetpack\.serverless\red.zip",
  cwd: "C:\projects\serverless-jetpack",
  files: ["red.js", "additional.js", "green.js"]
  files: ["one.js", "two.js", "additional.js", "extra.js", "node_modules/additional-pkg/index.js", "node_modules/additional-pkg/package.json", "node_modules/extra-pkg/index.js", "node_modules/extra-pkg/package.json", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json", "node_modules/two-pkg/index.js", "node_modules/two-pkg/package.json"]
}
Call 2:
{
  bundlePath: "C:\projects\serverless-jetpack\.serverless\sls-mocked.zip",
  cwd: "C:\projects\serverless-jetpack",
  files: ["one.js", "two.js", "additional.js", "extra.js"]
  files: ["one.js", "two.js", "additional.js", "extra.js", "node_modules/additional-pkg/index.js", "node_modules/additional-pkg/package.json", "node_modules/extra-pkg/index.js", "node_modules/extra-pkg/package.json", "node_modules/one-pkg/index.js", "node_modules/one-pkg/package.json", "node_modules/two-pkg/index.js", "node_modules/two-pkg/package.json"]
}
      at Context.<anonymous> (test\spec\index.spec.js:443:18)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)

ryan-roemer added a commit that referenced this issue May 13, 2021
- Handle special characters in file names
- Update `globby` to `v11`. Fixes #56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant