Commit graph

89 commits

Author SHA1 Message Date
William Martin
96ac8d6a2f Support pr view for intra-org forks 2024-12-13 14:27:41 +01:00
Heath Stewart
5da86e07e7
Merge changes from #10004
Merges changes from @williammartin including acceptance tests and word changes.

Co-authored-by: William Martin <williammartin@github.com>
2024-12-08 20:34:21 -08:00
William Martin
9bd8f09774 Use safepaths for run download 2024-12-04 22:12:58 +01:00
William Martin
694e565384 Fix PR checkout panic when base repo is not in remotes 2024-12-02 17:20:57 +01:00
William Martin
6a97dbfadf Add acceptance test for bare repo create 2024-11-11 15:51:52 +01:00
William Martin
a569d1030d Export empty results for cache list 2024-11-06 13:02:14 +01:00
Aarni Koskela
1c4c8e5145 Fix verbiage for deleting workflow runs
It's not deleting _workflows_ (which are specified in YAML)...
2024-11-04 17:55:35 +02:00
Andy Feller
37da12a9d2 Rename similar to other coarse commandset tests
Based on insights gained from reviewing conventions in #9815 with @jtmcg, I'm renaming this testscript to keep consistent with `gpg-key`, `label`, `ssh-key`, etc.
2024-10-28 12:54:50 +01:00
Andy Feller
911f070936 Skip extension testscript if bash isn't available
As this testscript creates a Bash-based script extension, the testscript should be skipped if it isn't on the path and executable.

Ideally, we would refactor this test to isolate that portion of the tests OR switch to a Go-based extension that can be compiled and run everywhere.
2024-10-28 12:54:50 +01:00
Andy Feller
ed24477fd3 Add comprehensive testscript for gh ext commandset
Rather than multiple separate testscripts per `gh ext` subcommand, this commit adds a comprehensive test around `gh extension` commandset.
2024-10-28 12:54:47 +01:00
Andy Feller
6dc86e5f40 Rename testscript for consistency
Similar to `gpg-key`, `label`, `ssh-key`, this coarse grained testscript should be named after the commandset given it isn't a collection of targeted scenarios.
2024-10-28 12:40:15 +01:00
Andy Feller
c27677bda6 Add comprehensive testscript for gh ruleset 2024-10-28 12:40:12 +01:00
Tyler McGoffin
7a5dc50324 Modify script to use the project number returned by the api upon creation 2024-10-25 09:03:50 -07:00
Tyler McGoffin
7148304344 Add acceptance test for project-create and project-delete 2024-10-24 12:53:52 -07:00
William Martin
2a2adfed0f
Merge pull request #9787 from cli/jtmcg/testscripts-auth
Add acceptance tests for `gh auth` commands
2024-10-24 18:42:31 +02:00
bagtoad
f72a82db99 Refactor gpg-key delete to align with ssh-key delete 2024-10-24 09:59:02 -06:00
bagtoad
2f849f03ff Add acceptance tests for org command 2024-10-24 09:58:06 -06:00
William Martin
76e6fbba36 Add SSH Key Acceptance test 2024-10-24 17:46:17 +02:00
William Martin
4100992d40 Add Acceptance test for label command 2024-10-24 17:00:54 +02:00
bagtoad
f27cddcb92 Add acceptance test for gpg-key 2024-10-24 08:43:40 -06:00
Tyler McGoffin
2b480daf7a Address PR feedback 2024-10-23 13:57:57 -07:00
Tyler McGoffin
0614d85027 Add acceptance tests for auth-setup-git and formattedStringToEnv helper func
To test this, I decided to look into the .gitconfig used for the test and
examine the credential helpers. However, the format of the git command is

`git config --get credential.<URL>.helper`

What's awkward about this is that the <URL> depends on the host the user
specified when running the tests, meaning I'd need to create a key like
credential.https://github.com.helper to access what I need while setting
this up.

There was no functionality for string formatting before, so I added the
command formattedStringToEnv which essentially wraps fmt.Sprintf() and
saves the string to an environment variable.

This allowed me to dynamically create the config key in the test.
2024-10-23 13:33:17 -07:00
Tyler McGoffin
aaf4c4e4e3 Clean up auth-login-logout acceptance test with native functionality
The previous commit introduced two new functions, setEnvVar and
deleteEnvVar that are duplicative of functionality native to testscripts.
This commit switches to the native functionality and removes the
duplicative functions introduced in the previous commit.

Additionally, it removes the `--token` flag that was added to
`gh auth login`
2024-10-21 16:42:48 -07:00
Tyler McGoffin
52daa9cf7d Add --token flag to gh auth login to accept a PAT as a flag
Additionally, this commit adds acceptance testing for `gh auth login` and
`gh auth logout`.

The --token flag was necessary for adding testing for `gh auth login`
because the current implementation with `--with-token` appears to be
broken. It hangs, waiting for user input, but user input doesn't exit it.

Additionally, it appears that `--with-token` is intended to allow for TTY
input of an auth token, but it isn't implemented.

`--with-token` does work when used with the redirect operator `<` when the
token is saved in a file. However, due to limitations of testscripts, I
could not use a file for saving the token in a repeatable manner. Thus,
implementing the `--token` flag seemed like a quick solution to validate
that the direction I was going during testing was valid.

Whether the flag stays or not is up for discussion, and I'd love to get
input on that from the team.
2024-10-21 16:38:10 -07:00
Tyler McGoffin
665e814c5d Setup acceptance testing for auth and tests for auth-token and auth-status 2024-10-21 16:36:05 -07:00
Andy Feller
6192ac74df Update variable testscripts based on secret
This commit refactors a bit of the variable testscripts given the changes in the secret testscripts efforts, removing potentially unnecessary assertions and making these look more similar to other testscripts.
2024-10-21 16:02:26 -04:00
Andy Feller
fa03013a23 Merge branch 'trunk' into andyfeller/testscripts-variable 2024-10-21 15:38:56 -04:00
Andy Feller
b3c0c39f47 Merge branch 'trunk' into andyfeller/testscripts-secret 2024-10-21 12:49:09 -04:00
Kynan Ware
e39a78ea29
Merge branch 'trunk' into kw/github-cli-590-add-search-acceptance-tests 2024-10-21 10:23:00 -06:00
bagtoad
1736de2cd1 Fix single quote not expanding vars 2024-10-21 10:20:37 -06:00
Andy Feller
acf62dacf2 Address @williammartin PR feedback 2024-10-21 11:53:05 -04:00
Andy Feller
f4f161c096 Refactor gh secret testscript
This is a bit of a refactor based on the work done in `gh workflow` as a better approach to verify secrets created are what we expect.

Changes made:

1. Removed `env2lower` as it wasn't being used in testscripts
2. Added `replace` custom command to deal with testing organization workflow secrets
3. Refactored secret testscripts to create and run workflow that tests the value of the secret provided
4. Minor reordering of test `acceptance` test functions as appending to the end is confusing and adds conflicts
5. Removed stdout TTY assertions
2024-10-18 15:56:03 -04:00
Tyler McGoffin
ba324d85eb Wrap true in '' in repo-fork-sync 2024-10-18 09:37:30 -07:00
Tyler McGoffin
3f4a2aea2f Rename acceptance test directory from repos to repo 2024-10-18 09:37:30 -07:00
Tyler McGoffin
6c3ad5011b Remove unnecessary flags from repo-delete testscript 2024-10-18 09:31:02 -07:00
Tyler McGoffin
25f2956e67 Replace LICENSE
Makefile
README.md
acceptance
api
bin
build
cmd
context
docs
git
go.mod
go.sum
internal
pkg
script
share
test
utils commands with
2024-10-18 09:31:02 -07:00
Tyler McGoffin
ee0d9ab901 Wrap boolean strings in '' so it is clear they are strings 2024-10-18 09:31:02 -07:00
Tyler McGoffin
a5a77532df Remove unnecessary gh auth setup-git steps 2024-10-18 09:31:02 -07:00
Tyler McGoffin
e7549c93f9 Cleanup some inconsistencies and improve collapse some functionality 2024-10-18 09:31:02 -07:00
Tyler McGoffin
95ed11d9ba Add acceptance tests for repo deploy-key add/list/delete 2024-10-18 09:31:02 -07:00
Tyler McGoffin
96fa8534da Add acceptance tests for repo-fork and repo-sync 2024-10-18 09:31:02 -07:00
Tyler McGoffin
7508131356 Add acceptance test for repo-set-default 2024-10-18 09:31:02 -07:00
Tyler McGoffin
c572edbfd7 Add acceptance test for repo-edit 2024-10-18 09:31:02 -07:00
Tyler McGoffin
fb6f7733c4 Add acceptance tests for repo-list and repo-rename 2024-10-18 09:31:02 -07:00
Tyler McGoffin
0c632d7c4e Acceptance testing for repo-archive and repo-unarchive 2024-10-18 09:31:02 -07:00
Tyler McGoffin
60e20ee531 Add acceptance test for repo-clone 2024-10-18 09:31:02 -07:00
Tyler McGoffin
83cbdc4f36 Added acceptance test for repo-delete 2024-10-18 09:31:02 -07:00
Tyler McGoffin
18428671c3 Added test function for repos and repo-create test 2024-10-18 09:31:02 -07:00
bagtoad
b361cf4495 Implement acceptance tests for search commands 2024-10-18 10:17:34 -06:00
Andy Feller
1571a113c2 Merge branch 'trunk' into andyfeller/testscripts-secret 2024-10-18 09:46:25 -04:00