mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-15 18:57:01 +00:00
chore(tests): reporter.SetOutputs tests have side effects [skip cascade] (#701)
testutils.MockVariable must be in a defer to restore the previous value. Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/701 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Earl Warren <contact@earl-warren.org> Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
parent
6e6ebbc981
commit
87d8366311
1 changed files with 2 additions and 2 deletions
|
@ -84,8 +84,8 @@ func TestReporterSetOutputs(t *testing.T) {
|
|||
t.Run("IgnoreTooBig", func(t *testing.T) {
|
||||
reporter, _, _ := mockReporter(t)
|
||||
|
||||
testutils.MockVariable(&outputKeyMaxLength, 5)
|
||||
testutils.MockVariable(&outputValueMaxLength, 5)
|
||||
defer testutils.MockVariable(&outputKeyMaxLength, 5)()
|
||||
defer testutils.MockVariable(&outputValueMaxLength, 5)()
|
||||
|
||||
in := map[string]string{
|
||||
"0123456": "b", // key too big
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue