[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
This commit is contained in:
Gusted 2023-08-06 22:19:36 +02:00
parent c805aa23b5
commit 47a268ada8
No known key found for this signature in database
GPG key ID: FD821B732837125F

View file

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