From 665e814c5d17d21ce35dec1074081b6c14fb2136 Mon Sep 17 00:00:00 2001 From: Tyler McGoffin Date: Fri, 18 Oct 2024 12:58:00 -0700 Subject: [PATCH] Setup acceptance testing for auth and tests for auth-token and auth-status --- acceptance/acceptance_test.go | 9 +++++++++ acceptance/testdata/auth/auth-status.txtar | 3 +++ acceptance/testdata/auth/auth-token.txtar | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 acceptance/testdata/auth/auth-status.txtar create mode 100644 acceptance/testdata/auth/auth-token.txtar diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index 017e6e62b..8804b1534 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -63,6 +63,15 @@ func TestAPI(t *testing.T) { testscript.Run(t, testScriptParamsFor(tsEnv, "api")) } +func TestAuth(t *testing.T) { + var tsEnv testScriptEnv + if err := tsEnv.fromEnv(); err != nil { + t.Fatal(err) + } + + testscript.Run(t, testScriptParamsFor(tsEnv, "auth")) +} + func TestReleases(t *testing.T) { var tsEnv testScriptEnv if err := tsEnv.fromEnv(); err != nil { diff --git a/acceptance/testdata/auth/auth-status.txtar b/acceptance/testdata/auth/auth-status.txtar new file mode 100644 index 000000000..da3011d1a --- /dev/null +++ b/acceptance/testdata/auth/auth-status.txtar @@ -0,0 +1,3 @@ +# Check the authentication status +exec gh auth status --hostname $GH_HOST +stdout $GH_HOST \ No newline at end of file diff --git a/acceptance/testdata/auth/auth-token.txtar b/acceptance/testdata/auth/auth-token.txtar new file mode 100644 index 000000000..614d11817 --- /dev/null +++ b/acceptance/testdata/auth/auth-token.txtar @@ -0,0 +1,3 @@ +# Check authentication token +exec gh auth token --hostname $GH_HOST +stdout $GH_TOKEN \ No newline at end of file