1
0
Fork 0
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:
Earl Warren 2025-07-29 13:34:04 +00:00 committed by earl-warren
parent e99d975589
commit a6fa98926c
No known key found for this signature in database
GPG key ID: F128CBE6AB3A7201
4 changed files with 2 additions and 12 deletions

View file

@ -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"

View file

@ -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 {

View file

@ -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 }
}