node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

Following CONTRIBUTING.md instructions for testing results in test errors #757

Closed gr2m closed 4 years ago

gr2m commented 4 years ago

Hello there 👋

I'm the maintainer of @octokit/rest. I'm looking to test the upcoming v17 release with a few dependents to catch errors before you do. I've tried setting up your respository using the instructions at https://github.com/node-gh/gh/blob/master/CONTRIBUTING.md, but I see a lot of errors

$ npm test ``` npm test > gh@2.8.5 test /Users/gregor/Projects/octokit/rest.js-dependants/gh > npm run env:test -- jest > gh@2.8.5 env:test /Users/gregor/Projects/octokit/rest.js-dependants/gh > cross-env NODE_ENV=testing GH_USER=protoEvangelion GH_TOKEN=0001 "jest" FAIL __tests__/alias.test.ts E2E: Alias Module Test ✕ User alias is expanded `gh user --user=zeno` (1189ms) ● E2E: Alias Module Test › User alias is expanded `gh user --user=zeno` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/alias.test.ts:11:16) PASS __tests__/help.test.ts E2E: Help Module Test ✓ `gh --help` (1855ms) FAIL __tests__/notification.test.ts E2E: Notification Module Test ✕ List Notifications `gh nt` (1063ms) ● E2E: Notification Module Test › List Notifications `gh nt` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/notification.test.ts:11:16) FAIL __tests__/milestone.test.ts E2E: Milestone Module Test ✕ List Milestones `gh ms --list` (966ms) ● E2E: Milestone Module Test › List Milestones `gh ms --list` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/milestone.test.ts:11:16) PASS __tests__/version.test.ts E2E: Version Module Test ✓ Check Current version `gh --version` (1088ms) FAIL __tests__/user.test.ts (6.42s) E2E: User Module Test ✕ List Current User `gh user` (1196ms) ✓ Generates token end to end without 2fa (1318ms) ✕ Logout Current User `gh user --logout` (1080ms) ✕ Show just the current username `gh user --whoami` (1216ms) ● E2E: User Module Test › List Current User `gh user` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/user.test.ts:14:16) ● E2E: User Module Test › Logout Current User `gh user --logout` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/user.test.ts:47:16) ● E2E: User Module Test › Show just the current username `gh user --whoami` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/user.test.ts:52:16) PASS __tests__/utils.test.ts Unit test for utils module ✓ openFileInEditor fn returns expected msg from editor (3ms) ✓ cleanFileContents cleans comments & new lines (3ms) PASS __tests__/cmd.test.ts tryResolvingByAlias function ✓ Shows gi as a valid alias for the gists cmd (4ms) ✓ Shows nothing for bogus alias (1ms) tryResolvingByHelpOrVersion function ✓ finds version cmd (1ms) ✓ finds help cmd ✓ returns arg on fail (1ms) tryResolvingByPlugin function ✓ finds plugin path (1ms) ✓ returns (1ms) loadCommand function ✓ finds pr cmd (281ms) ✓ finds the version cmd (3ms) ✓ finds the help cmd (4ms) PASS __tests__/fp.test.ts Unit test for fp module ✓ safeReaddir fn returns expected files (3ms) ✓ safeImport fn returns expected file or error (21ms) PASS __tests__/git.test.ts Git Module Tests Function parseRemoteUrl ssh clone url ✓ should parse remote url with score on repo name ✓ should parse remote url with score on username https clone url ✓ should parse remote url with score on repo name ✓ should parse remote url with score on username PASS __tests__/base.test.ts Unit test for base module ✓ Checks which files match a pattern in a directory (5ms) FAIL __tests__/gists.test.ts (7.392s) E2E: Gist Module Test ✕ List Gists `gh gi` (1193ms) ✕ Open gist in browser `gh gi --browser --id 5444883` (1179ms) ✕ Create new gist `gh gi --new hello --content "Hello World!"` (1022ms) ✕ Fork a gist `gh gi --fork 5444883` (1157ms) ✕ Delete gists `gh gi --delete 5250d21093b46bd0665c2e8656d16bd2 --delete 30e5d3c69a6997617ab69d07b733105e` (1275ms) ● E2E: Gist Module Test › List Gists `gh gi` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/gists.test.ts:12:16) ● E2E: Gist Module Test › Open gist in browser `gh gi --browser --id 5444883` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/gists.test.ts:17:16) ● E2E: Gist Module Test › Create new gist `gh gi --new hello --content "Hello World!"` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/gists.test.ts:22:16) ● E2E: Gist Module Test › Fork a gist `gh gi --fork 5444883` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/gists.test.ts:27:16) ● E2E: Gist Module Test › Delete gists `gh gi --delete 5250d21093b46bd0665c2e8656d16bd2 --delete 30e5d3c69a6997617ab69d07b733105e` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/gists.test.ts:34:17) FAIL __tests__/repo.test.ts (9.773s) E2E: Repo Module Test ✕ List Repos `gh re --list` (1073ms) ✕ List Repos `gh re --browser` (1080ms) ✕ Search repositories from GitHub org showing detailed results. `gh re --detailed --search octocat org:github` (1259ms) ✕ Create new repo `gh re --new foo --init` (1144ms) ✕ List labels on a repo `gh re --label --list --repo gh` (755ms) ✕ Fork a repo `gh re --fork prettier --user prettier` (708ms) ✕ Delete repo `gh re --delete foo` (675ms) Unit tests for repo cmd ✓ Cloning repo url is correct (3ms) ● E2E: Repo Module Test › List Repos `gh re --list` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/repo.test.ts:13:16) ● E2E: Repo Module Test › List Repos `gh re --browser` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/repo.test.ts:18:16) ● E2E: Repo Module Test › Search repositories from GitHub org showing detailed results. `gh re --detailed --search octocat org:github` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/repo.test.ts:23:16) ● E2E: Repo Module Test › Create new repo `gh re --new foo --init` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/repo.test.ts:28:16) ● E2E: Repo Module Test › List labels on a repo `gh re --label --list --repo gh` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/repo.test.ts:33:16) ● E2E: Repo Module Test › Fork a repo `gh re --fork prettier --user prettier` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/repo.test.ts:38:16) ● E2E: Repo Module Test › Delete repo `gh re --delete foo` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/repo.test.ts:43:26) FAIL __tests__/issue.test.ts (10.49s) E2E: Issues Module Test ✕ List Issues `gh is` (1276ms) ✕ Assign Issues `gh is --assign -A protoEvangelion --number 1` (1240ms) ✕ Open issue in browser `gh is 55 --browser` (1068ms) ✕ Create a new issue `gh is -N -t "Node GH rocks!" -m "msg" -L bug,question,test` (1246ms) ✕ Comment on Issues `gh is 1 -c "comment"` (1215ms) ✕ Close Issue `gh is --close --number 7 --number 10` (771ms) ✕ Open Issue `gh is --open --number 7 --number 10` (718ms) ✕ Search Issues `gh is -s hi` (701ms) ✕ Lock issue in browser `gh is 138 --lock --lock-reason off-topic` (660ms) ● E2E: Issues Module Test › List Issues `gh is` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:11:16) ● E2E: Issues Module Test › Assign Issues `gh is --assign -A protoEvangelion --number 1` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:16:16) ● E2E: Issues Module Test › Open issue in browser `gh is 55 --browser` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:21:16) ● E2E: Issues Module Test › Create a new issue `gh is -N -t "Node GH rocks!" -m "msg" -L bug,question,test` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:27:13) ● E2E: Issues Module Test › Comment on Issues `gh is 1 -c "comment"` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:33:16) ● E2E: Issues Module Test › Close Issue `gh is --close --number 7 --number 10` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:38:16) ● E2E: Issues Module Test › Open Issue `gh is --open --number 7 --number 10` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:43:16) ● E2E: Issues Module Test › Search Issues `gh is -s hi` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:48:16) ● E2E: Issues Module Test › Lock issue in browser `gh is 138 --lock --lock-reason off-topic` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/issue.test.ts:53:16) FAIL __tests__/pull-request.test.ts (12.776s) E2E: Pull Request Module Test ✕ List PRs `gh pr` (1417ms) ✕ List Detailed PRs `gh pr --detailed` (1167ms) ✕ List Detailed PRs `gh pr --detailed --prettyPrint` (1154ms) ✕ Open pr in browser `gh pr 55 --browser` (1444ms) ✕ Fetch & Rebase PR `gh pr 55 --fetch --rebase` (1079ms) ✕ Fwd PR to another user `gh pr 97 --fwd node-gh-bot` (812ms) ✕ Get PR Info `gh pr --info 50` (752ms) ✕ Comment on PR `gh pr 50 --comment "Just started reviewing :)"` (726ms) ✕ Close PR `gh pr --close --number 50 --number 40` (681ms) ✕ Open PR `gh pr --open --number 50 --number 40` (641ms) ✕ Submit PR `gh pr -s protoEvangelion -b master -t "pr title" -D "pr description"` (648ms) ✕ Submit PR as a draft `gh pr -s protoEvangelion --draft=true -b master -t "pr title" -D "description"` (652ms) ○ skipped List PRs `gh pr --list --prettyPrint` ○ skipped List PRs & sorty by complexity `gh pr --list --sort complexity` ○ skipped Fetch PR `gh pr 55` ● E2E: Pull Request Module Test › List PRs `gh pr` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:13:26) ● E2E: Pull Request Module Test › List Detailed PRs `gh pr --detailed` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:19:26) ● E2E: Pull Request Module Test › List Detailed PRs `gh pr --detailed --prettyPrint` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:25:26) ● E2E: Pull Request Module Test › Open pr in browser `gh pr 55 --browser` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:30:16) ● E2E: Pull Request Module Test › Fetch & Rebase PR `gh pr 55 --fetch --rebase` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:54:16) ● E2E: Pull Request Module Test › Fwd PR to another user `gh pr 97 --fwd node-gh-bot` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:59:16) ● E2E: Pull Request Module Test › Get PR Info `gh pr --info 50` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:64:16) ● E2E: Pull Request Module Test › Comment on PR `gh pr 50 --comment "Just started reviewing :)"` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:69:16) ● E2E: Pull Request Module Test › Close PR `gh pr --close --number 50 --number 40` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:74:16) ● E2E: Pull Request Module Test › Open PR `gh pr --open --number 50 --number 40` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:79:16) ● E2E: Pull Request Module Test › Submit PR `gh pr -s protoEvangelion -b master -t "pr title" -D "pr description"` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:85:13) ● E2E: Pull Request Module Test › Submit PR as a draft `gh pr -s protoEvangelion --draft=true -b master -t "pr title" -D "description"` ,, 16 | var result = execSync(cmd, { cwd: process.cwd(), ...customEnv }) 17 | } catch (error) { > 18 | throw new Error(error.output.toString()) | ^ 19 | } 20 | 21 | return result.toString() at Object.runCmd (src/test-utils.ts:18:15) at Object.done (__tests__/pull-request.test.ts:92:13) ```

I did the following

  1. git clone
  2. npm install
  3. npm build
  4. npm link
  5. npm test

If you could help me with the setup I'd be happy to help with the migration to v17

protoEvangelion commented 4 years ago

Hey @gr2m good to see you around :) Sorry for the late reply!

I don't expect you to get back to me given that you already merged v17 ;)

That is really strange. It seems like Jest is swallowing the actual error some how even though it's set to verbose. It runs fine for me ATM as well as on multiple CI envs.

I'll close for now and keep an eye out for similar reports.

Would it be helpful if I went through the upgrade process to v17?

gr2m commented 4 years ago

Would it be helpful if I went through the upgrade process to v17?

Yeah I would recommend to do it. Please ping me if you run into any trouble :)