mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
chore: a single testutils for both act and the runner (#759)
keep it DRY <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner/--> - other - [PR](https://code.forgejo.org/forgejo/runner//pulls/759): <!--number 759 --><!--line 0 --><!--description Y2hvcmU6IGEgc2luZ2xlIHRlc3R1dGlscyBmb3IgYm90aCBhY3QgYW5kIHRoZSBydW5uZXI=-->chore: a single testutils for both act and the runner<!--description--> <!--end release-notes-assistant--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/759 Reviewed-by: fnetX <fnetx@noreply.code.forgejo.org> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
e99d975589
commit
a6fa98926c
4 changed files with 2 additions and 12 deletions
|
@ -13,7 +13,7 @@ import (
|
|||
"code.forgejo.org/forgejo/runner/act/container"
|
||||
"code.forgejo.org/forgejo/runner/act/exprparser"
|
||||
"code.forgejo.org/forgejo/runner/act/model"
|
||||
"code.forgejo.org/forgejo/runner/act/testutils"
|
||||
"code.forgejo.org/forgejo/runner/testutils"
|
||||
|
||||
"github.com/docker/go-connections/nat"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
|
|
@ -21,7 +21,7 @@ import (
|
|||
"google.golang.org/protobuf/types/known/structpb"
|
||||
|
||||
"code.forgejo.org/forgejo/runner/internal/pkg/client/mocks"
|
||||
"code.forgejo.org/forgejo/runner/internal/pkg/testutils"
|
||||
"code.forgejo.org/forgejo/runner/testutils"
|
||||
)
|
||||
|
||||
func rowsToString(rows []*runnerv1.LogRow) string {
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package testutils
|
||||
|
||||
func MockVariable[T any](p *T, v T) (reset func()) {
|
||||
old := *p
|
||||
*p = v
|
||||
return func() { *p = old }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue