Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ linters:
- gosec
- misspell
- nakedret
- paralleltest
- stylecheck
- tparallel
- unconvert
- unparam
- whitespace
Expand Down Expand Up @@ -50,3 +52,7 @@ issues:
- linters: [ gosec ]
text: 'G304: Potential file inclusion via variable'
path: '^(example|tools)\/'

# We don't run parallel integration tests
- linters: [ paralleltest, tparallel ]
path: '^test/integration'
23 changes: 23 additions & 0 deletions github/actions_artifacts_test.go
Comment thread
gmlewis marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

func TestActionsService_ListArtifacts(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -58,6 +59,7 @@ func TestActionsService_ListArtifacts(t *testing.T) {
}

func TestActionsService_ListArtifacts_invalidOwner(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -66,6 +68,7 @@ func TestActionsService_ListArtifacts_invalidOwner(t *testing.T) {
}

func TestActionsService_ListArtifacts_invalidRepo(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -74,6 +77,7 @@ func TestActionsService_ListArtifacts_invalidRepo(t *testing.T) {
}

func TestActionsService_ListArtifacts_notFound(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -95,6 +99,7 @@ func TestActionsService_ListArtifacts_notFound(t *testing.T) {
}

func TestActionsService_ListWorkflowRunArtifacts(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/runs/1/artifacts", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -136,6 +141,7 @@ func TestActionsService_ListWorkflowRunArtifacts(t *testing.T) {
}

func TestActionsService_ListWorkflowRunArtifacts_invalidOwner(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -144,6 +150,7 @@ func TestActionsService_ListWorkflowRunArtifacts_invalidOwner(t *testing.T) {
}

func TestActionsService_ListWorkflowRunArtifacts_invalidRepo(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -152,6 +159,7 @@ func TestActionsService_ListWorkflowRunArtifacts_invalidRepo(t *testing.T) {
}

func TestActionsService_ListWorkflowRunArtifacts_notFound(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/runs/1/artifacts", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -173,6 +181,7 @@ func TestActionsService_ListWorkflowRunArtifacts_notFound(t *testing.T) {
}

func TestActionsService_GetArtifact(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -219,6 +228,7 @@ func TestActionsService_GetArtifact(t *testing.T) {
}

func TestActionsService_GetArtifact_invalidOwner(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -227,6 +237,7 @@ func TestActionsService_GetArtifact_invalidOwner(t *testing.T) {
}

func TestActionsService_GetArtifact_invalidRepo(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -235,6 +246,7 @@ func TestActionsService_GetArtifact_invalidRepo(t *testing.T) {
}

func TestActionsService_GetArtifact_notFound(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -256,6 +268,7 @@ func TestActionsService_GetArtifact_notFound(t *testing.T) {
}

func TestActionsService_DownloadArtifact(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -294,6 +307,7 @@ func TestActionsService_DownloadArtifact(t *testing.T) {
}

func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -302,6 +316,7 @@ func TestActionsService_DownloadArtifact_invalidOwner(t *testing.T) {
}

func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -310,6 +325,7 @@ func TestActionsService_DownloadArtifact_invalidRepo(t *testing.T) {
}

func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedirects(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -325,6 +341,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_dontFollowRedire
}

func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(t *testing.T) {
t.Parallel()
client, mux, serverURL := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts/1/zip", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -352,6 +369,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(
}

func TestActionsService_DeleteArtifact(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -376,6 +394,7 @@ func TestActionsService_DeleteArtifact(t *testing.T) {
}

func TestActionsService_DeleteArtifact_invalidOwner(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -384,6 +403,7 @@ func TestActionsService_DeleteArtifact_invalidOwner(t *testing.T) {
}

func TestActionsService_DeleteArtifact_invalidRepo(t *testing.T) {
t.Parallel()
client, _, _ := setup(t)

ctx := context.Background()
Expand All @@ -392,6 +412,7 @@ func TestActionsService_DeleteArtifact_invalidRepo(t *testing.T) {
}

func TestActionsService_DeleteArtifact_notFound(t *testing.T) {
t.Parallel()
client, mux, _ := setup(t)

mux.HandleFunc("/repos/o/r/actions/artifacts/1", func(w http.ResponseWriter, r *http.Request) {
Expand All @@ -410,6 +431,7 @@ func TestActionsService_DeleteArtifact_notFound(t *testing.T) {
}

func TestArtifact_Marshal(t *testing.T) {
t.Parallel()
testJSONMarshal(t, &Artifact{}, "{}")

u := &Artifact{
Expand Down Expand Up @@ -456,6 +478,7 @@ func TestArtifact_Marshal(t *testing.T) {
}

func TestArtifactList_Marshal(t *testing.T) {
t.Parallel()
testJSONMarshal(t, &ArtifactList{}, "{}")

u := &ArtifactList{
Expand Down
Loading