Commit graph

27 commits

Author SHA1 Message Date
vilmibm
245c3c7425 move survey helper and test helpers to prompt pkg 2020-07-27 17:00:09 -05:00
vilmibm
c06eacf4ee remove obsolete ensureScopes 2020-07-21 17:42:52 -05:00
vilmibm
36ade42ba3 scriptability improvements: issue commands
This commit is part of work to make gh more scriptable. It includes both
some general purpose helpers towards this goal as well as improvements
to the issue commands. Other commands will follow.

- Adds `utils/terminal.go` for finding out about gh's execution environment
- introduces `stubTerminal` for either faking being attached to a tty or not during tests
- updates issue commands to behave better when not attached to a tty:
  - issue list doesn't print fuzzy dates
  - issue list doesn't print header
  - issue list prints state explicitly
  - issue create no longer hangs
  - issue create fails with clear error unless both -t and -b are specified
  - issue view prints raw issue body
  - issue view prints metadata in a consistent, linewise format
2020-07-14 12:30:53 -05:00
Mislav Marohnić
c08d4f0697 Write all per-host config entries to hosts.yml
Read from and write to the `hosts.yml` file every time `config.yml` is
accessed. Everything that before went under the `hosts:` map now belongs
to `hosts.yml`.
2020-06-02 15:35:13 +02:00
Mislav Marohnić
f42c9d4b2d Allow stubbing multiple config files 2020-06-02 13:19:21 +02:00
vilmibm
780875d645 fix tests 2020-05-15 16:47:11 -05:00
Mislav Marohnić
3000847bb2
Merge pull request #874 from cli/httpmock
Parallelism-safe mechanism for stubbing HTTP responses
2020-05-08 17:34:57 +02:00
vilmibm
d81e622700 lightest weight reviewing
this commit add very basic non-interactive PR reviewing. You can either
review the "current" or a passed PR (number or URL) as approved, changes
requested, or commented via CLI flags.
2020-05-07 13:30:34 -05:00
Mislav Marohnić
0a4d4ee007 Replace FakeHTTP with httpmock which is now compatible 2020-05-07 15:19:14 +02:00
Mislav Marohnić
256d31950a Migrate a single test over to httpmock to demonstrate its use 2020-05-06 22:06:37 +02:00
Corey Johnson
3a7bde2cce RunCommand doesn't take the command to be run 2020-05-01 10:09:30 -07:00
Corey Johnson
210c47572c Move RunCommand to testing file 2020-04-30 12:14:40 -07:00
vilmibm
c4693077aa move config stuff to its own package 2020-04-20 13:57:16 -05:00
vilmibm
a325db3051 new config infrastructure
- adds config get and config set commands
- supports arbitrary k/v strings set at top and host level
- supports writing an updated config, preserving comments
- supports mostly lazy evaluation of yaml
2020-04-17 15:17:44 -05:00
Mislav Marohnić
734497a8d8
Code fixes informed by golangci-lint failures (#738) 2020-04-03 16:33:34 +02:00
vilmibm
88cf6ce16e consolidate CmdStubber into test package 2020-03-23 16:36:24 -05:00
vilmibm
5187ad4431 move preparecmd and Runnable to its own package 2020-03-23 16:32:29 -05:00
vilmibm
a23549001e cleanup 2020-03-13 15:14:32 -05:00
vilmibm
fba4f4d19e InitCmdStubber 2020-03-13 15:12:23 -05:00
vilmibm
ed8aaa83e3 add CmdStubber 2020-03-13 15:12:09 -05:00
vilmibm
6732aa9725 fix tests 2020-02-12 08:48:25 -06:00
Mislav Marohnić
a710893fc1 Rename to cli/cli 2020-01-24 16:08:52 +01:00
Mislav Marohnić
1fc9c8f9d6 Test the scenario where the target branch already exists 2019-11-14 20:29:24 +01:00
Mislav Marohnić
524fe0a69b 🔥 last instance of mockOpenInBrowser 2019-11-06 19:41:18 +01:00
Mislav Marohnić
32e36d2fe0 Merge branch 'master' into exec-cmd-error-info 2019-11-06 19:36:12 +01:00
Mislav Marohnić
8ee97d72cd Extract outputStub into testing.go 2019-11-01 23:20:15 +01:00
Corey Johnson
cf1feb847e Add gh issue list and gh issue view ISSUE_NUMBER 2019-10-31 11:02:27 -07:00