ember-cli / ember-cli-update

Update Ember CLI projects
MIT License
277 stars 40 forks source link

ember-cli-update 0.43.3 ember-test-helpers-codemod failing with jscodeshift error #706

Closed lfrost closed 4 years ago

lfrost commented 4 years ago

I am trying to use ember-cli-update 0.43.3 to update an Ember 3.12.0 application to 3.13.0. I am first trying to run all codemods against 3.12.0. When running ember-test-helpers-codemod, I get the following error running jscodeshift.

$ ember -v
ember-cli: 3.12.0
node: 10.16.3
os: linux x64
$ ember-cli-update --version
0.43.3
$ ember-cli-update --run-codemods
? These codemods apply to your project. Select which ones to run. ember-modules-codemod, ember-qunit-codemod, ember-test-helpers-c
odemod, es5-getter-ember-codemod, qunit-dom-codemod
...
Running codemod ember-test-helpers-codemod
Running command 1 of 2
npx: installed 360 in 17.863s
Processing 15 files...
Spawning 7 workers...
Sending 3 files to free worker...
Sending 3 files to free worker...
Sending 3 files to free worker...
Sending 3 files to free worker...
Sending 3 files to free worker...
All done.
Results:
0 errors
15 unmodified
0 skipped
0 ok
Time elapsed: 8.371seconds
Finished running command 1 of 2
Running command 2 of 2
npx: installed 360 in 15.807s
Error: You have to provide at least one file/directory to transform.

---

Usage: jscodeshift [OPTION]... PATH...
  or:  jscodeshift [OPTION]... -t TRANSFORM_PATH PATH...
  or:  jscodeshift [OPTION]... -t URL PATH...
  or:  jscodeshift [OPTION]... --stdin < file_list.txt

Apply transform logic in TRANSFORM_PATH (recursively) to every PATH.
If --stdin is set, each line of the standard input is used as a path.

Options:
"..." behind an option means that it can be supplied multiple times.
All options are also passed to the transformer, which means you can supply custom options that are not listed here.

      --(no-)babel              apply babeljs to the transform file
                                (default: true)
  -c, --cpus=N                  start at most N child processes to process source files
                                (default: max(all - 1, 1))
  -d, --(no-)dry                dry run (no changes are made to files)
                                (default: false)
      --extensions=EXT          transform files with these file extensions (comma separated list)
                                (default: js)
  -h, --help                    print this help and exit
      --ignore-config=FILE ...  ignore files if they match patterns sourced from a configuration file (e.g. a .gitignore)
      --ignore-pattern=GLOB ...  ignore files that match a provided glob expression
      --parser=babel|babylon|flow|ts|tsx  the parser to use for parsing the source files
                                          (default: babel)
      --parser-config=FILE      path to a JSON file containing a custom parser configuration for flow or babylon
  -p, --(no-)print              print transformed files to stdout, useful for development
                                (default: false)
      --(no-)run-in-band        run serially in the current process
                                (default: false)
  -s, --(no-)silent             do not write to stdout or stderr
                                (default: false)
      --(no-)stdin              read file/directory list from stdin
                                (default: false)
  -t, --transform=FILE          path to the transform file. Can be either a local path or url
                                (default: ./transform.js)
  -v, --verbose=0|1|2           show more information about the transform process
                                (default: 0)
      --version                 print version and exit
Error: Command failed: ~/.npm/_npx/6902/lib/node_modules/ember-test-helpers-codemod/node_modules/jscodeshift/bin/jscodeshift.js -t ~/.npm/_npx/6902/lib/node_modules/ember-test-helpers-codemod/transforms/acceptance/index.js --extensions js,ts                                                                      
    at makeError (~/.npm/_npx/6902/lib/node_modules/ember-test-helpers-codemod/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (~/.npm/_npx/6902/lib/node_modules/ember-test-helpers-codemod/node_modules/execa/index.js:278:16)                               
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:6902) UnhandledPromiseRejectionWarning: Error: Command failed: ~/.npm/_npx/6902/lib/node_modules/ember-test-helpers-codemod/node_modules/jscodeshift/bin/jscodeshift.js -t ~/.npm/_npx/6902/lib/node_modules/ember-test-helpers-codemod/transforms/acceptance/index.js --extensions js,ts
    at makeError (~/.npm/_npx/6902/lib/node_modules/ember-test-helpers-codemod/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (~/.npm/_npx/6902/lib/node_modules/ember-test-helpers-codemod/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:6902) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:6902) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Error running command ember-test-helpers-codemod acceptance tests/acceptance

See DEBUG log attached to issue #705.

kellyselden commented 4 years ago

This is the second command it's trying to run https://github.com/ember-cli/ember-cli-update-codemods-manifest/blob/a1031d310cb7f8f6cd2d193b599b4af2e9b8de4a/manifest.json#L26.

ember-test-helpers-codemod acceptance tests/acceptance

Are you missing that directory?

lfrost commented 4 years ago

Yes, that directory is missing. I created a new project with the latest version of Ember CLI (3.13.1), and it still does not create that directory.

ls -1 tests
helpers
index.html
integration
test-helper.js
unit
kellyselden commented 4 years ago

I would file that here https://github.com/ember-codemods/ember-test-helpers-codemod, because the readme says it should work. Maybe they should check the dir before running jscodeshift?