From 47a268ada8722e0ac015d36695cf97880ec1503a Mon Sep 17 00:00:00 2001
From: Gusted <postmaster@gusted.xyz>
Date: Sun, 6 Aug 2023 22:19:36 +0200
Subject: [PATCH] [GITEA] Fix printed integration test location

- When running integration testing, the location of the function is
logged, this is determined from the stack trace, to skip helper
function, it must be given how many function to skip.
- `PrepareTestEnv` calls `PrintCurrentTest` which does the determination
of the location. `PrepareTestEnv` gave an skip number of `2` to account for itself and
- Since https://github.com/go-gitea/gitea/pull/25330  `PrintCurrentTest`
adds 1 to the skip number to account for itself. However
`PrepareTestEnv` wasn't modified to account for that and thus the
location of functions was printing the location of the testing.go in the
Go standard library.
- Regresion of https://github.com/go-gitea/gitea/pull/25330
---
 tests/test_utils.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test_utils.go b/tests/test_utils.go
index 3bcd872d6c..6a4bbac224 100644
--- a/tests/test_utils.go
+++ b/tests/test_utils.go
@@ -182,7 +182,7 @@ func InitTest(requireGitea bool) {
 
 func PrepareTestEnv(t testing.TB, skip ...int) func() {
 	t.Helper()
-	ourSkip := 2
+	ourSkip := 1
 	if len(skip) > 0 {
 		ourSkip += skip[0]
 	}