Added test function for repos and repo-create test
This commit is contained in:
parent
1313612245
commit
18428671c3
2 changed files with 20 additions and 0 deletions
|
|
@ -72,6 +72,14 @@ func TestReleases(t *testing.T) {
|
|||
testscript.Run(t, testScriptParamsFor(tsEnv, "release"))
|
||||
}
|
||||
|
||||
func TestRepos(t *testing.T) {
|
||||
var tsEnv testScriptEnv
|
||||
if err := tsEnv.fromEnv(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
testscript.Run(t, testScriptParamsFor(tsEnv, "repos"))
|
||||
}
|
||||
|
||||
func testScriptParamsFor(tsEnv testScriptEnv, command string) testscript.Params {
|
||||
var files []string
|
||||
if tsEnv.script != "" {
|
||||
|
|
|
|||
12
acceptance/testdata/repos/repo-create-view.txtar
vendored
Normal file
12
acceptance/testdata/repos/repo-create-view.txtar
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Use gh as a credential helper
|
||||
exec gh auth setup-git
|
||||
|
||||
# Create a repository with a file so it has a default branch
|
||||
exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private
|
||||
|
||||
# Defer repo cleanup
|
||||
defer gh repo delete --yes $ORG/$SCRIPT_NAME-$RANDOM_STRING
|
||||
|
||||
# Check that the repo exists
|
||||
exec gh repo view $ORG/$SCRIPT_NAME-$RANDOM_STRING --json name --jq '.name'
|
||||
stdout $SCRIPT_NAME-$RANDOM_STRING
|
||||
Loading…
Add table
Add a link
Reference in a new issue